disp: msm: dsi: Handle GDSC PM in pre/post clk on/off

Currently, power_state variable does not reflect the GDSC
status. Due to this, there are scenarios where ctrl_power_on
is not happening leading to clock failures. This change
updates power_state based on current status of all the
regulators. GDSC enable is moved to pre_clkon and GDSC
disable is moved to post_clkoff.

Change-Id: I6d9508d5dffda0c94bd3b3bd9b5feb4724dc9dc7
Signed-off-by: Ritesh Kumar <riteshk@codeaurora.org>
[cohens@codeaurora.org: fixed static analysis error]
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This commit is contained in:
Ritesh Kumar
2020-04-01 15:34:29 +05:30
committed by Steve Cohen
parent 6d59f959d3
commit 755686a110
3 changed files with 20 additions and 24 deletions

View File

@@ -1039,12 +1039,19 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable)
int rc = 0;
if (enable) {
rc = pm_runtime_get_sync(dsi_ctrl->drm_dev->dev);
if (rc < 0) {
DSI_CTRL_ERR(dsi_ctrl,
"Power resource enable failed, rc=%d\n", rc);
goto error;
}
if (!dsi_ctrl->current_state.host_initialized) {
rc = dsi_pwr_enable_regulator(
&dsi_ctrl->pwr_info.host_pwr, true);
if (rc) {
DSI_CTRL_ERR(dsi_ctrl, "failed to enable host power regs\n");
goto error;
goto error_get_sync;
}
}
@@ -1057,8 +1064,9 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable)
&dsi_ctrl->pwr_info.host_pwr,
false
);
goto error;
goto error_get_sync;
}
return rc;
} else {
rc = dsi_pwr_enable_regulator(&dsi_ctrl->pwr_info.digital,
false);
@@ -1076,7 +1084,14 @@ static int dsi_ctrl_enable_supplies(struct dsi_ctrl *dsi_ctrl, bool enable)
goto error;
}
}
rc = pm_runtime_put_sync(dsi_ctrl->drm_dev->dev);
if (rc < 0)
DSI_CTRL_ERR(dsi_ctrl,
"Power resource disable failed, rc=%d\n", rc);
return rc;
}
error_get_sync:
pm_runtime_put_sync(dsi_ctrl->drm_dev->dev);
error:
return rc;
}