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-11-18 11:42:56 +0900
commit8a003c2e383644f835a2f19454746458fb84eb8e (patch)
tree067c764fbd560d0dbe433e1dff8e5df9e74e0a64 /drivers/video
parent89f5f0f08fd69cadf3adf7bf6381739d4c84afb5 (diff)
downloadlinux-3.10-8a003c2e383644f835a2f19454746458fb84eb8e.tar.gz
linux-3.10-8a003c2e383644f835a2f19454746458fb84eb8e.tar.bz2
linux-3.10-8a003c2e383644f835a2f19454746458fb84eb8e.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);