msm: mdss: Use clock safe wrapper for reading DSI hw version

Attempting to read without proper clock votes will result
in a unclocked access leading to a watchdog. Enable only
the DSI BUS clocks instead of all the DSI clocks while
reading the DSI revision register.

Change-Id: Ia83fda764d145e96d2df813379c57cf6529b1c0c
Signed-off-by: Naveen Ramaraj <nramaraj@codeaurora.org>
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
This commit is contained in:
Naveen Ramaraj 2015-05-08 16:11:32 -07:00 committed by David Keitel
parent bc9915b818
commit cc97a775f4

View file

@ -275,6 +275,9 @@ void mdss_dsi_read_hw_revision(struct mdss_dsi_ctrl_pdata *ctrl)
void mdss_dsi_get_hw_revision(struct mdss_dsi_ctrl_pdata *ctrl)
{
if (ctrl->shared_data->hw_rev)
return;
mdss_dsi_clk_ctrl(ctrl, ctrl->dsi_clk_handle, MDSS_DSI_CORE_CLK,
MDSS_DSI_CLK_ON);
ctrl->shared_data->hw_rev = MIPI_INP(ctrl->ctrl_base);
@ -1315,7 +1318,7 @@ static int mdss_dsi_cmd_dma_tpg_tx(struct mdss_dsi_ctrl_pdata *ctrl,
struct dsi_buf *tp)
{
int len, i, ret = 0, data = 0;
u32 *bp, ctrl_rev;
u32 *bp;
struct mdss_dsi_ctrl_pdata *mctrl = NULL;
if (tp->len > DMA_TPG_FIFO_LEN) {
@ -1323,9 +1326,9 @@ static int mdss_dsi_cmd_dma_tpg_tx(struct mdss_dsi_ctrl_pdata *ctrl,
return -EINVAL;
}
ctrl_rev = MIPI_INP(ctrl->ctrl_base);
mdss_dsi_get_hw_revision(ctrl);
if (ctrl_rev < MDSS_DSI_HW_REV_103) {
if (ctrl->shared_data->hw_rev < MDSS_DSI_HW_REV_103) {
pr_err("CMD DMA TPG not supported for this DSI version\n");
return -EINVAL;
}
@ -2279,7 +2282,6 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
int ret = -EINVAL;
int rc = 0;
bool hs_req = false;
u32 ctrl_rev;
if (mdss_get_sd_client_cnt())
return -EPERM;
@ -2302,10 +2304,10 @@ int mdss_dsi_cmdlist_commit(struct mdss_dsi_ctrl_pdata *ctrl, int from_mdp)
/* make sure dsi_cmd_mdp is idle */
mdss_dsi_cmd_mdp_busy(ctrl);
ctrl_rev = MIPI_INP(ctrl->ctrl_base);
mdss_dsi_get_hw_revision(ctrl);
/* For DSI versions less than 1.3.0, CMD DMA TPG is not supported */
if (req && (ctrl_rev < MDSS_DSI_HW_REV_103))
if (req && (ctrl->shared_data->hw_rev < MDSS_DSI_HW_REV_103))
req->flags &= ~CMD_REQ_DMA_TPG;
pr_debug("%s: ctrl=%d from_mdp=%d pid=%d\n", __func__,