Commit 5c6497bc authored by Paul Walmsley's avatar Paul Walmsley Committed by Tony Lindgren

OMAP3 clock: recalculate DPLL subtree after bypass entry/exit

The DPLL's rate changes when it enters or leaves bypass, so the DPLL's
rate and the rates of all dependent clocks need to be recalculated
when this happens.

Also, fix test for bypass to test against the appropriate bypass clock,
rather than the parent clock (which is not the bypass clock for DPLL1
and DPLL2).
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 9c909ac9
...@@ -180,7 +180,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) ...@@ -180,7 +180,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
} }
/* /*
* omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness * _omap3_noncore_dpll_bypass - instruct a DPLL to bypass and wait for readiness
* @clk: pointer to a DPLL struct clk * @clk: pointer to a DPLL struct clk
* *
* Instructs a non-CORE DPLL to enter low-power bypass mode. In * Instructs a non-CORE DPLL to enter low-power bypass mode. In
...@@ -270,15 +270,26 @@ static int _omap3_noncore_dpll_stop(struct clk *clk) ...@@ -270,15 +270,26 @@ static int _omap3_noncore_dpll_stop(struct clk *clk)
static int omap3_noncore_dpll_enable(struct clk *clk) static int omap3_noncore_dpll_enable(struct clk *clk)
{ {
int r; int r;
long rate;
struct dpll_data *dd;
if (clk == &dpll3_ck) if (clk == &dpll3_ck)
return -EINVAL; return -EINVAL;
if (clk->parent->rate == omap2_get_dpll_rate(clk)) dd = clk->dpll_data;
if (!dd)
return -EINVAL;
rate = omap2_get_dpll_rate(clk);
if (dd->bypass_clk->rate == rate)
r = _omap3_noncore_dpll_bypass(clk); r = _omap3_noncore_dpll_bypass(clk);
else else
r = _omap3_noncore_dpll_lock(clk); r = _omap3_noncore_dpll_lock(clk);
if (!r)
clk->rate = rate;
return r; return r;
} }
...@@ -399,6 +410,8 @@ static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate) ...@@ -399,6 +410,8 @@ static int omap3_noncore_dpll_set_rate(struct clk *clk, unsigned long rate)
pr_debug("clock: %s: set rate: entering bypass.\n", clk->name); pr_debug("clock: %s: set rate: entering bypass.\n", clk->name);
ret = _omap3_noncore_dpll_bypass(clk); ret = _omap3_noncore_dpll_bypass(clk);
if (!ret)
clk->rate = rate;
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment