diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-17 09:15:31 (GMT) |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-17 09:17:18 (GMT) |
commit | aa1e49a3752f09b3d2ab706f6d48916a04acf557 (patch) | |
tree | 6b6f9d0429f4b2c19b3c38b0281eed9dd7083490 /drivers/video/omap2/vrfb.c | |
parent | 8c05a412243b522a263326c4839aec081151147c (diff) | |
download | linux-fsl-qoriq-aa1e49a3752f09b3d2ab706f6d48916a04acf557.tar.xz |
OMAPDSS: VRFB: add omap_vrfb_supported()
Add an exported function omap_vrfb_supported() which returns true if the
vrfb driver has been loaded succesfully. This can be used to decide if
VRFB can be used or not.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/vrfb.c')
-rw-r--r-- | drivers/video/omap2/vrfb.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c index e4a0450..5d8fdac 100644 --- a/drivers/video/omap2/vrfb.c +++ b/drivers/video/omap2/vrfb.c @@ -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)); @@ -336,6 +338,12 @@ out: } 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; @@ -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) |