summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorTomasz Figa <t.figa@samsung.com>2013-03-26 14:52:33 +0100
committerChanho Park <chanho61.park@samsung.com>2014-03-20 17:32:28 +0900
commit66728f190f4cd46f6c93c1c177d49d435c3657c2 (patch)
treeb967b03e55564084cf63d485d7fb3bde25999089 /drivers/video
parent6647f6167e06f7cabd8a3d594ea03711e86bc375 (diff)
downloadlinux-3.10-66728f190f4cd46f6c93c1c177d49d435c3657c2.tar.gz
linux-3.10-66728f190f4cd46f6c93c1c177d49d435c3657c2.tar.bz2
linux-3.10-66728f190f4cd46f6c93c1c177d49d435c3657c2.zip
video: display: panel-s6e8aa0: Add support for suspend/resume
This patch adds suspend and resume callbacks to the driver to turn off the display on suspend and turn it back on on resume if it was enabled before. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/display/panel-s6e8aa0.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/video/display/panel-s6e8aa0.c b/drivers/video/display/panel-s6e8aa0.c
index 59c1ec97ea2..3f691879ff5 100644
--- a/drivers/video/display/panel-s6e8aa0.c
+++ b/drivers/video/display/panel-s6e8aa0.c
@@ -1227,6 +1227,30 @@ static int s6e8aa0_remove(struct platform_device *pdev)
return 0;
}
+static int s6e8aa0_suspend(struct device *dev)
+{
+ struct s6e8aa0 *lcd = dev_get_drvdata(dev);
+
+ if (lcd->power != FB_BLANK_UNBLANK)
+ return 0;
+
+ return display_entity_set_state(&lcd->entity, DISPLAY_ENTITY_STATE_OFF);
+}
+
+static int s6e8aa0_resume(struct device *dev)
+{
+ struct s6e8aa0 *lcd = dev_get_drvdata(dev);
+
+ if (lcd->power != FB_BLANK_UNBLANK)
+ return 0;
+
+ return display_entity_set_state(&lcd->entity, DISPLAY_ENTITY_STATE_ON);
+}
+
+static struct dev_pm_ops s6e8aa0_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(s6e8aa0_suspend, s6e8aa0_resume)
+};
+
static struct platform_driver s6e8aa0_driver = {
.probe = s6e8aa0_probe,
.remove = s6e8aa0_remove,
@@ -1234,6 +1258,7 @@ static struct platform_driver s6e8aa0_driver = {
.name = "panel_s6e8aa0",
.owner = THIS_MODULE,
.of_match_table = of_match_ptr(s6e8aa0_of_match),
+ .pm = &s6e8aa0_pm_ops,
},
};
module_platform_driver(s6e8aa0_driver);