diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-17 05:15:31 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-10-17 05:17:18 -0400 |
commit | aa1e49a3752f09b3d2ab706f6d48916a04acf557 (patch) | |
tree | 6b6f9d0429f4b2c19b3c38b0281eed9dd7083490 /drivers | |
parent | 8c05a412243b522a263326c4839aec081151147c (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.c | 16 |
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; | |||
77 | static int num_ctxs; | 77 | static int num_ctxs; |
78 | static struct vrfb_ctx *ctxs; | 78 | static struct vrfb_ctx *ctxs; |
79 | 79 | ||
80 | static bool vrfb_loaded; | ||
81 | |||
80 | static void omap2_sms_write_rot_control(u32 val, unsigned ctx) | 82 | static 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 | } |
337 | EXPORT_SYMBOL(omap_vrfb_request_ctx); | 339 | EXPORT_SYMBOL(omap_vrfb_request_ctx); |
338 | 340 | ||
341 | bool omap_vrfb_supported(void) | ||
342 | { | ||
343 | return vrfb_loaded; | ||
344 | } | ||
345 | EXPORT_SYMBOL(omap_vrfb_supported); | ||
346 | |||
339 | static int __init vrfb_probe(struct platform_device *pdev) | 347 | static 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 | ||
391 | static void __exit vrfb_remove(struct platform_device *pdev) | ||
392 | { | ||
393 | vrfb_loaded = false; | ||
394 | } | ||
395 | |||
381 | static struct platform_driver vrfb_driver = { | 396 | static struct platform_driver vrfb_driver = { |
382 | .driver.name = "omapvrfb", | 397 | .driver.name = "omapvrfb", |
398 | .remove = __exit_p(vrfb_remove), | ||
383 | }; | 399 | }; |
384 | 400 | ||
385 | static int __init vrfb_init(void) | 401 | static int __init vrfb_init(void) |