diff options
Diffstat (limited to 'drivers/video/omap2/dss/dss.c')
-rw-r--r-- | drivers/video/omap2/dss/dss.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c index 3469e38d4fb0..a9f61bd038ec 100644 --- a/drivers/video/omap2/dss/dss.c +++ b/drivers/video/omap2/dss/dss.c @@ -134,6 +134,13 @@ void dss_restore_context(void) #undef SR #undef RR +/* + * OMAP4 does not allow aggressive DSS clock cutting, so we must keep the + * clocks enabled during display use. These next two methods on OMAP4 + * increment and decrement the global mainclk counter. The needed opt + * clocks are enabled once during bootup and then handled by the pm + * framework. + */ bool dss_get_mainclk_state() { return dss.mainclk_state; @@ -141,20 +148,22 @@ bool dss_get_mainclk_state() int dss_mainclk_enable() { + int ret = 0; + if (!dss.mainclk_state) { - pm_runtime_get_sync(&dss.pdev->dev); - dss.mainclk_state = true; - return 0; + ret = pm_runtime_get_sync(&dss.pdev->dev); + if (ret >= 0) + dss.mainclk_state = true; } - return -EINVAL; + return ret; } void dss_mainclk_disable() { if (dss.mainclk_state) { - pm_runtime_put_sync(&dss.pdev->dev); dss.mainclk_state = false; + pm_runtime_put_sync(&dss.pdev->dev); } } |