diff options
author | Marcus Lorentzon <marcus.xm.lorentzon@stericsson.com> | 2011-10-03 18:03:56 +0200 |
---|---|---|
committer | Jonas ABERG <jonas.aberg@stericsson.com> | 2011-10-11 07:51:59 +0200 |
commit | 2eed72e34b56e00322eee4dd702564be88543e48 (patch) | |
tree | e5ee8d9c39e4b04d5cd34c523803cafe2ce4d51d | |
parent | a0ed24718e13226416729a590f4840a49827d1b1 (diff) |
video: mcde: Add generic suspend/resume for MCDE bus
Most suspend/resume implementations are the same. This adds
default implementation using display device set_power_mode.
ST-Ericsson ID: 365249
ST-Ericsson Linux next: NA
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I4dcead9f8e00363e67e73f6658828ead01c53694
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32867
Reviewed-by: Marcus LORENTZON <marcus.xm.lorentzon@stericsson.com>
Tested-by: Marcus LORENTZON <marcus.xm.lorentzon@stericsson.com>
Reviewed-by: Jimmy RUBIN <jimmy.rubin@stericsson.com>
Reviewed-by: Per PERSSON <per.xb.persson@stericsson.com>
-rw-r--r-- | drivers/video/mcde/mcde_bus.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/video/mcde/mcde_bus.c b/drivers/video/mcde/mcde_bus.c index a742aea5b3d..852451954a4 100644 --- a/drivers/video/mcde/mcde_bus.c +++ b/drivers/video/mcde/mcde_bus.c @@ -106,7 +106,10 @@ static int mcde_drv_suspend(struct device *_dev, pm_message_t state) struct mcde_display_driver *drv = to_mcde_display_driver(_dev->driver); struct mcde_display_device *dev = to_mcde_display_device(_dev); - return drv->suspend(dev, state); + if (drv->suspend) + return drv->suspend(dev, state); + else + return dev->set_power_mode(dev, MCDE_DISPLAY_PM_OFF); } static int mcde_drv_resume(struct device *_dev) @@ -114,7 +117,10 @@ static int mcde_drv_resume(struct device *_dev) struct mcde_display_driver *drv = to_mcde_display_driver(_dev->driver); struct mcde_display_device *dev = to_mcde_display_device(_dev); - return drv->resume(dev); + if (drv->resume) + return drv->resume(dev); + else + return dev->set_power_mode(dev, MCDE_DISPLAY_PM_STANDBY); } /* Bus device */ @@ -139,10 +145,8 @@ int mcde_display_driver_register(struct mcde_display_driver *drv) drv->driver.remove = mcde_drv_remove; if (drv->shutdown) drv->driver.shutdown = mcde_drv_shutdown; - if (drv->suspend) - drv->driver.suspend = mcde_drv_suspend; - if (drv->resume) - drv->driver.resume = mcde_drv_resume; + drv->driver.suspend = mcde_drv_suspend; + drv->driver.resume = mcde_drv_resume; return driver_register(&drv->driver); } |