summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tegra
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-12-18 19:15:25 +0300
committerThierry Reding <treding@nvidia.com>2015-01-27 12:14:58 +0300
commit359ae687dbd16c76f5519a5750444f5a3b00ad18 (patch)
treeac1ed7e54cff8e8609e4414f39b12cf7123b366e /drivers/gpu/drm/tegra
parent666cb873328b5075eb511662858bab02d084ff64 (diff)
downloadlinux-359ae687dbd16c76f5519a5750444f5a3b00ad18.tar.xz
drm/tegra: Add minimal power management
For now only disable the KMS hotplug polling helper logic upon suspend and re-enable it on resume. Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Mark Zhang <markz@nvidia.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra')
-rw-r--r--drivers/gpu/drm/tegra/drm.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 0edfb5e0b374..5bccb20889f7 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -996,6 +996,30 @@ static int host1x_drm_remove(struct host1x_device *dev)
return 0;
}
+#ifdef CONFIG_PM_SLEEP
+static int host1x_drm_suspend(struct device *dev)
+{
+ struct drm_device *drm = dev_get_drvdata(dev);
+
+ drm_kms_helper_poll_disable(drm);
+
+ return 0;
+}
+
+static int host1x_drm_resume(struct device *dev)
+{
+ struct drm_device *drm = dev_get_drvdata(dev);
+
+ drm_kms_helper_poll_enable(drm);
+
+ return 0;
+}
+#endif
+
+static const struct dev_pm_ops host1x_drm_pm_ops = {
+ SET_SYSTEM_SLEEP_PM_OPS(host1x_drm_suspend, host1x_drm_resume)
+};
+
static const struct of_device_id host1x_drm_subdevs[] = {
{ .compatible = "nvidia,tegra20-dc", },
{ .compatible = "nvidia,tegra20-hdmi", },
@@ -1017,6 +1041,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
static struct host1x_driver host1x_drm_driver = {
.driver = {
.name = "drm",
+ .pm = &host1x_drm_pm_ops,
},
.probe = host1x_drm_probe,
.remove = host1x_drm_remove,