drm/rockchip: vop: add vop power domain support
diff mbox

Message ID 1427867333-2246-1-git-send-email-mark.yao@rock-chips.com
State New, archived
Headers show

Commit Message

yao mark April 1, 2015, 5:48 a.m. UTC
From: Mark Yao <yzq@rock-chips.com>

Reference the power domain incase vop power down when
in use.

Signed-off-by: Mark Yao <yzq@rock-chips.com>
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c |    7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index d041921..7a61c8e 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -421,6 +421,12 @@  static void vop_enable(struct drm_crtc *crtc)
 	if (vop->is_enabled)
 		return;
 
+	ret = pm_runtime_get_sync(vop->dev);
+	if (ret < 0) {
+		dev_err(vop->dev, "failed to get pm runtime: %d\n", ret);
+		return;
+	}
+
 	ret = clk_enable(vop->hclk);
 	if (ret < 0) {
 		dev_err(vop->dev, "failed to enable hclk - %d\n", ret);
@@ -517,6 +523,7 @@  static void vop_disable(struct drm_crtc *crtc)
 	clk_disable(vop->dclk);
 	clk_disable(vop->aclk);
 	clk_disable(vop->hclk);
+	pm_runtime_put(vop->dev);
 }
 
 /*