Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6781a5a0 authored by Vinu Deokaran's avatar Vinu Deokaran
Browse files

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: default avatarVinu Deokaran <vinud@codeaurora.org>
parent f7fd823a
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -252,13 +252,6 @@ static int dsi_pll_enable(struct clk *c)
	struct dsi_pll_vco_clk *vco = to_vco_clk(c);
	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 */
	for (i = 0; i < vco->pll_en_seq_cnt; i++) {
		rc = vco->pll_enable_seqs[i](pll);
@@ -268,12 +261,10 @@ static int dsi_pll_enable(struct clk *c)
			break;
	}

	if (rc) {
		mdss_pll_resource_enable(pll, false);
	if (rc)
		pr_err("ndx=%d DSI PLL failed to lock\n", pll->index);
	} else {
	else
		pll->pll_on = true;
	}

	return rc;
}
@@ -813,18 +804,31 @@ int pll_vco_prepare_8996(struct clk *c)
		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)
	    && (pll->vco_cached_rate == c->rate)) {
		rc = c->ops->set_rate(c, pll->vco_cached_rate);
		if (rc) {
			pr_err("index=%d vco_set_rate failed. rc=%d\n",
					rc, pll->index);
			mdss_pll_resource_enable(pll, false);
			goto error;
		}
	}

	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:
	return rc;
}