diff options
author | Vikram Pandita <[email protected]> | 2012-07-04 05:00:44 -0600 |
---|---|---|
committer | Paul Walmsley <[email protected]> | 2012-07-04 05:00:44 -0600 |
commit | 55ffe163c8b4e2aa0a083000e02ec26efd71ea63 (patch) | |
tree | f0135662556a2b259654b9837d7ffd7ec8268d8e | |
parent | f0d3d821db4ffa63de344347587429b940086e25 (diff) |
ARM: OMAP3+: dpll: optimize noncore dpll locking logic
If the dpll is already locked, code can be optimized
to return much earlier than doing redundent set of lock mode
and wait on idlest.
Cc: Tony Lindgren <[email protected]>
Cc: Jon Hunter <[email protected]>
Cc: Paul Walmsley <[email protected]>
Cc: Mike Turquette <[email protected]>
Signed-off-by: Vikram Pandita <[email protected]>
Signed-off-by: Nishanth Menon <[email protected]>
Signed-off-by: Paul Walmsley <[email protected]>
-rw-r--r-- | arch/arm/mach-omap2/dpll3xxx.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/dpll3xxx.c b/arch/arm/mach-omap2/dpll3xxx.c index f0f10beeffe8..c310dc0d40b4 100644 --- a/arch/arm/mach-omap2/dpll3xxx.c +++ b/arch/arm/mach-omap2/dpll3xxx.c @@ -135,11 +135,20 @@ static u16 _omap3_dpll_compute_freqsel(struct clk *clk, u8 n) */ static int _omap3_noncore_dpll_lock(struct clk *clk) { + const struct dpll_data *dd; u8 ai; - int r; + u8 state = 1; + int r = 0; pr_debug("clock: locking DPLL %s\n", clk->name); + dd = clk->dpll_data; + state <<= __ffs(dd->idlest_mask); + + /* Check if already locked */ + if ((__raw_readl(dd->idlest_reg) & dd->idlest_mask) == state) + goto done; + ai = omap3_dpll_autoidle_read(clk); if (ai) @@ -152,6 +161,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk) if (ai) omap3_dpll_allow_idle(clk); +done: return r; } |