clk: msm: mdss: enable pll resources once in prepare
Enable PLL resource only once in prepare. The current driver enables and disables PLL resources multiple times during the course of prepare routine. Change-Id: I9fbf58e7e509dda55d8ec01ec7d305ccf1691f94 Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
This commit is contained in:
parent
f1f853212f
commit
c41b5b1cc5
1 changed files with 15 additions and 11 deletions
|
@ -254,13 +254,6 @@ static int dsi_pll_enable(struct clk *c)
|
||||||
struct dsi_pll_vco_clk *vco = to_vco_clk(c);
|
struct dsi_pll_vco_clk *vco = to_vco_clk(c);
|
||||||
struct mdss_pll_resources *pll = vco->priv;
|
struct mdss_pll_resources *pll = vco->priv;
|
||||||
|
|
||||||
rc = mdss_pll_resource_enable(pll, true);
|
|
||||||
if (rc) {
|
|
||||||
pr_err("ndx=%d Failed to enable mdss dsi pll resources\n",
|
|
||||||
pll->index);
|
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Try all enable sequences until one succeeds */
|
/* Try all enable sequences until one succeeds */
|
||||||
for (i = 0; i < vco->pll_en_seq_cnt; i++) {
|
for (i = 0; i < vco->pll_en_seq_cnt; i++) {
|
||||||
rc = vco->pll_enable_seqs[i](pll);
|
rc = vco->pll_enable_seqs[i](pll);
|
||||||
|
@ -270,12 +263,10 @@ static int dsi_pll_enable(struct clk *c)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rc) {
|
if (rc)
|
||||||
mdss_pll_resource_enable(pll, false);
|
|
||||||
pr_err("ndx=%d DSI PLL failed to lock\n", pll->index);
|
pr_err("ndx=%d DSI PLL failed to lock\n", pll->index);
|
||||||
} else {
|
else
|
||||||
pll->pll_on = true;
|
pll->pll_on = true;
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
@ -902,18 +893,31 @@ int pll_vco_prepare_8996(struct clk *c)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = mdss_pll_resource_enable(pll, true);
|
||||||
|
if (rc) {
|
||||||
|
pr_err("ndx=%d Failed to enable mdss dsi pll resources\n",
|
||||||
|
pll->index);
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
if ((pll->vco_cached_rate != 0)
|
if ((pll->vco_cached_rate != 0)
|
||||||
&& (pll->vco_cached_rate == c->rate)) {
|
&& (pll->vco_cached_rate == c->rate)) {
|
||||||
rc = c->ops->set_rate(c, pll->vco_cached_rate);
|
rc = c->ops->set_rate(c, pll->vco_cached_rate);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
pr_err("index=%d vco_set_rate failed. rc=%d\n",
|
pr_err("index=%d vco_set_rate failed. rc=%d\n",
|
||||||
rc, pll->index);
|
rc, pll->index);
|
||||||
|
mdss_pll_resource_enable(pll, false);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = dsi_pll_enable(c);
|
rc = dsi_pll_enable(c);
|
||||||
|
|
||||||
|
if (rc) {
|
||||||
|
mdss_pll_resource_enable(pll, false);
|
||||||
|
pr_err("ndx=%d failed to enable dsi pll\n", pll->index);
|
||||||
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue