drm/msm/dsi: save pll state before dsi host is powered off
authorHarigovindan P <harigovi@codeaurora.org>
Thu, 6 Feb 2020 08:56:15 +0000 (14:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 12:00:12 +0000 (13:00 +0100)
[ Upstream commit a1028dcfd0dd97884072288d0c8ed7f30399b528 ]

Save pll state before dsi host is powered off. Without this change
some register values gets resetted.

Signed-off-by: Harigovindan P <harigovi@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/dsi/dsi_manager.c
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c

index 355a60b4a536f40f74001d686b6f675d7aa00480..73127948f54d97819e43fff729d476ccf7ab7412 100644 (file)
@@ -479,6 +479,7 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
        struct msm_dsi *msm_dsi1 = dsi_mgr_get_dsi(DSI_1);
        struct mipi_dsi_host *host = msm_dsi->host;
        struct drm_panel *panel = msm_dsi->panel;
+       struct msm_dsi_pll *src_pll;
        bool is_dual_dsi = IS_DUAL_DSI();
        int ret;
 
@@ -519,6 +520,10 @@ static void dsi_mgr_bridge_post_disable(struct drm_bridge *bridge)
                                                                id, ret);
        }
 
+       /* Save PLL status if it is a clock source */
+       src_pll = msm_dsi_phy_get_pll(msm_dsi->phy);
+       msm_dsi_pll_save_state(src_pll);
+
        ret = msm_dsi_host_power_off(host);
        if (ret)
                pr_err("%s: host %d power off failed,%d\n", __func__, id, ret);
index 3522863a4984faeeb234ab036ebf8f6fb36c109a..21519229fe73ade997183c8b377f7400d7ac70cb 100644 (file)
@@ -724,10 +724,6 @@ void msm_dsi_phy_disable(struct msm_dsi_phy *phy)
        if (!phy || !phy->cfg->ops.disable)
                return;
 
-       /* Save PLL status if it is a clock source */
-       if (phy->usecase != MSM_DSI_PHY_SLAVE)
-               msm_dsi_pll_save_state(phy->pll);
-
        phy->cfg->ops.disable(phy);
 
        dsi_phy_regulator_disable(phy);