drm/rockchip: vop: add vop power domain support
authorMark Yao <yzq@rock-chips.com>
Wed, 1 Apr 2015 05:48:53 +0000 (13:48 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Fri, 3 Apr 2015 06:23:36 +0000 (14:23 +0800)
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

index 6115898efe6b1e9622e0798b19a0d3cf7e4b7574..ccb0ce073ef2af6f2233fbc88428ea176dbea855 100644 (file)
@@ -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);
 }
 
 /*