aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-17 05:15:31 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-10-17 05:17:18 -0400
commitaa1e49a3752f09b3d2ab706f6d48916a04acf557 (patch)
tree6b6f9d0429f4b2c19b3c38b0281eed9dd7083490 /drivers
parent8c05a412243b522a263326c4839aec081151147c (diff)
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')
-rw-r--r--drivers/video/omap2/vrfb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/video/omap2/vrfb.c b/drivers/video/omap2/vrfb.c
index e4a0450a39a1..5d8fdac3b800 100644
--- a/drivers/video/omap2/vrfb.c
+++ b/drivers/video/omap2/vrfb.c
@@ -77,6 +77,8 @@ static void __iomem *vrfb_base;
77static int num_ctxs; 77static int num_ctxs;
78static struct vrfb_ctx *ctxs; 78static struct vrfb_ctx *ctxs;
79 79
80static bool vrfb_loaded;
81
80static void omap2_sms_write_rot_control(u32 val, unsigned ctx) 82static void omap2_sms_write_rot_control(u32 val, unsigned ctx)
81{ 83{
82 __raw_writel(val, vrfb_base + SMS_ROT_CONTROL(ctx)); 84 __raw_writel(val, vrfb_base + SMS_ROT_CONTROL(ctx));
@@ -336,6 +338,12 @@ out:
336} 338}
337EXPORT_SYMBOL(omap_vrfb_request_ctx); 339EXPORT_SYMBOL(omap_vrfb_request_ctx);
338 340
341bool omap_vrfb_supported(void)
342{
343 return vrfb_loaded;
344}
345EXPORT_SYMBOL(omap_vrfb_supported);
346
339static int __init vrfb_probe(struct platform_device *pdev) 347static int __init vrfb_probe(struct platform_device *pdev)
340{ 348{
341 struct resource *mem; 349 struct resource *mem;
@@ -375,11 +383,19 @@ static int __init vrfb_probe(struct platform_device *pdev)
375 ctxs[i].base = mem->start; 383 ctxs[i].base = mem->start;
376 } 384 }
377 385
386 vrfb_loaded = true;
387
378 return 0; 388 return 0;
379} 389}
380 390
391static void __exit vrfb_remove(struct platform_device *pdev)
392{
393 vrfb_loaded = false;
394}
395
381static struct platform_driver vrfb_driver = { 396static struct platform_driver vrfb_driver = {
382 .driver.name = "omapvrfb", 397 .driver.name = "omapvrfb",
398 .remove = __exit_p(vrfb_remove),
383}; 399};
384 400
385static int __init vrfb_init(void) 401static int __init vrfb_init(void)