From: Yakir Yang Date: Mon, 15 Feb 2016 11:11:37 +0000 (+0800) Subject: drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time X-Git-Tag: v4.7-rc1~77^2~65^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=211f276ed3d96e964d2d1106a198c7f4a4b3f4c0;p=karo-tx-linux.git drm: bridge: analogix/dp: add panel prepare/unprepare in suspend/resume time Turn off the panel power in suspend time would help to reduce power waste. Tested-by: Caesar Wang Tested-by: Douglas Anderson Tested-by: Heiko Stuebner Tested-by: Javier Martinez Canillas Signed-off-by: Yakir Yang --- diff --git a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c index bc59e8d997b3..5292b28aec8a 100644 --- a/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_core.c @@ -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);