Skip to content

Commit

Permalink
ARM: OMAP3+: dpll: optimize noncore dpll locking logic
Browse files Browse the repository at this point in the history
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 <tony@atomide.com>
Cc: Jon Hunter <jon-hunter@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Mike Turquette <mturquette@ti.com>
Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
  • Loading branch information
Vikram Pandita authored and Paul Walmsley committed Jul 4, 2012
1 parent f0d3d82 commit 55ffe16
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion arch/arm/mach-omap2/dpll3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -152,6 +161,7 @@ static int _omap3_noncore_dpll_lock(struct clk *clk)
if (ai)
omap3_dpll_allow_idle(clk);

done:
return r;
}

Expand Down

0 comments on commit 55ffe16

Please sign in to comment.