Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339638
b: refs/heads/master
c: aa1e49a
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Oct 17, 2012
1 parent af84250 commit 0159159
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8c05a412243b522a263326c4839aec081151147c
refs/heads/master: aa1e49a3752f09b3d2ab706f6d48916a04acf557
16 changes: 16 additions & 0 deletions trunk/drivers/video/omap2/vrfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ static void __iomem *vrfb_base;
static int num_ctxs;
static struct vrfb_ctx *ctxs;

static bool vrfb_loaded;

static void omap2_sms_write_rot_control(u32 val, unsigned ctx)
{
__raw_writel(val, vrfb_base + SMS_ROT_CONTROL(ctx));
Expand Down Expand Up @@ -336,6 +338,12 @@ int omap_vrfb_request_ctx(struct vrfb *vrfb)
}
EXPORT_SYMBOL(omap_vrfb_request_ctx);

bool omap_vrfb_supported(void)
{
return vrfb_loaded;
}
EXPORT_SYMBOL(omap_vrfb_supported);

static int __init vrfb_probe(struct platform_device *pdev)
{
struct resource *mem;
Expand Down Expand Up @@ -375,11 +383,19 @@ static int __init vrfb_probe(struct platform_device *pdev)
ctxs[i].base = mem->start;
}

vrfb_loaded = true;

return 0;
}

static void __exit vrfb_remove(struct platform_device *pdev)
{
vrfb_loaded = false;
}

static struct platform_driver vrfb_driver = {
.driver.name = "omapvrfb",
.remove = __exit_p(vrfb_remove),
};

static int __init vrfb_init(void)
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/video/omapvrfb.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct vrfb {
};

#ifdef CONFIG_OMAP2_VRFB
extern bool omap_vrfb_supported(void);
extern int omap_vrfb_request_ctx(struct vrfb *vrfb);
extern void omap_vrfb_release_ctx(struct vrfb *vrfb);
extern void omap_vrfb_adjust_size(u16 *width, u16 *height,
Expand All @@ -49,6 +50,7 @@ extern int omap_vrfb_map_angle(struct vrfb *vrfb, u16 height, u8 rot);
extern void omap_vrfb_restore_context(void);

#else
static inline bool omap_vrfb_supported(void) { return false; }
static inline int omap_vrfb_request_ctx(struct vrfb *vrfb) { return 0; }
static inline void omap_vrfb_release_ctx(struct vrfb *vrfb) {}
static inline void omap_vrfb_adjust_size(u16 *width, u16 *height,
Expand Down

0 comments on commit 0159159

Please sign in to comment.