drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time
authorYakir Yang <ykk@rock-chips.com>
Mon, 15 Feb 2016 11:11:37 +0000 (19:11 +0800)
committerYakir Yang <ykk@rock-chips.com>
Tue, 5 Apr 2016 02:13:10 +0000 (10:13 +0800)
Turn off the panel power in suspend time would help to reduce
power waste.

Tested-by: Caesar Wang <wxt@rock-chips.com>
Tested-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Yakir Yang <ykk@rock-chips.com>
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c

index bc59e8d997b306985a7f7ff10b25badfa4a98749..5292b28aec8a76fdaa23fbba5e8811ac7d900c96 100644 (file)
@@ -1400,6 +1400,12 @@ int analogix_dp_suspend(struct device *dev)
        struct analogix_dp_device *dp = dev_get_drvdata(dev);
 
        clk_disable_unprepare(dp->clock);
+
+       if (dp->plat_data->panel) {
+               if (drm_panel_unprepare(dp->plat_data->panel))
+                       DRM_ERROR("failed to turnoff the panel\n");
+       }
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(analogix_dp_suspend);
@@ -1415,6 +1421,13 @@ int analogix_dp_resume(struct device *dev)
                return ret;
        }
 
+       if (dp->plat_data->panel) {
+               if (drm_panel_prepare(dp->plat_data->panel)) {
+                       DRM_ERROR("failed to setup the panel\n");
+                       return -EBUSY;
+               }
+       }
+
        return 0;
 }
 EXPORT_SYMBOL_GPL(analogix_dp_resume);