diff options
| author | Grygorii Strashko <Grygorii.Strashko@linaro.org> | 2015-02-26 08:57:17 -0500 |
|---|---|---|
| committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2015-03-24 08:01:36 -0400 |
| commit | 8450c8d071d858e8f95855a7b5897df3981e3d21 (patch) | |
| tree | 9ecb2b931d99c0a8ca730a2c35ae67cc1c8dc5eb | |
| parent | 223bfd6911a0129d819b4dadb0eec93da014a9d9 (diff) | |
drm/omap: add hibernation callbacks
Setting a dev_pm_ops suspend/resume pair but not a set of hibernation
functions means those pm functions will not be called upon hibernation.
Fix this by using SIMPLE_DEV_PM_OPS, which appropriately assigns the
suspend and hibernation handlers and move
omap_drm_suspend/omap_drm_resume under CONFIG_PM_SLEEP to avoid build
warnings.
Signed-off-by: Grygorii Strashko <Grygorii.Strashko@linaro.org>
[tomi.valkeinen@ti.com: fix conflict, clean up description]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
| -rw-r--r-- | drivers/gpu/drm/omapdrm/omap_drv.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index c6980985884b..94920d47e3b6 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
| @@ -707,6 +707,7 @@ static int pdev_remove(struct platform_device *device) | |||
| 707 | return 0; | 707 | return 0; |
| 708 | } | 708 | } |
| 709 | 709 | ||
| 710 | #ifdef CONFIG_PM_SLEEP | ||
| 710 | static int omap_drm_suspend(struct device *dev) | 711 | static int omap_drm_suspend(struct device *dev) |
| 711 | { | 712 | { |
| 712 | struct drm_device *drm_dev = dev_get_drvdata(dev); | 713 | struct drm_device *drm_dev = dev_get_drvdata(dev); |
| @@ -724,20 +725,14 @@ static int omap_drm_resume(struct device *dev) | |||
| 724 | 725 | ||
| 725 | return omap_gem_resume(dev); | 726 | return omap_gem_resume(dev); |
| 726 | } | 727 | } |
| 727 | |||
| 728 | #ifdef CONFIG_PM | ||
| 729 | static const struct dev_pm_ops omapdrm_pm_ops = { | ||
| 730 | .suspend = omap_drm_suspend, | ||
| 731 | .resume = omap_drm_resume, | ||
| 732 | }; | ||
| 733 | #endif | 728 | #endif |
| 734 | 729 | ||
| 730 | static SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume); | ||
| 731 | |||
| 735 | static struct platform_driver pdev = { | 732 | static struct platform_driver pdev = { |
| 736 | .driver = { | 733 | .driver = { |
| 737 | .name = DRIVER_NAME, | 734 | .name = DRIVER_NAME, |
| 738 | #ifdef CONFIG_PM | ||
| 739 | .pm = &omapdrm_pm_ops, | 735 | .pm = &omapdrm_pm_ops, |
| 740 | #endif | ||
| 741 | }, | 736 | }, |
| 742 | .probe = pdev_probe, | 737 | .probe = pdev_probe, |
| 743 | .remove = pdev_remove, | 738 | .remove = pdev_remove, |
