Skip to content

Commit

Permalink
davinci: use divide ratio limits from pll_data
Browse files Browse the repository at this point in the history
This patch modifies the sysclk rate setting code to use the divider mask
specified in pll_data.  Without this, devices with different divider ranges
(e.g. tnetv107x) fail.

Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
  • Loading branch information
Cyril Chemparathy authored and Kevin Hilman committed Dec 10, 2010
1 parent 6d1c57c commit b1d05be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm/mach-davinci/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,15 +336,15 @@ int davinci_set_sysclk_rate(struct clk *clk, unsigned long rate)
ratio--;
}

if (ratio > PLLDIV_RATIO_MASK)
if (ratio > pll->div_ratio_mask)
return -EINVAL;

do {
v = __raw_readl(pll->base + PLLSTAT);
} while (v & PLLSTAT_GOSTAT);

v = __raw_readl(pll->base + clk->div_reg);
v &= ~PLLDIV_RATIO_MASK;
v &= ~pll->div_ratio_mask;
v |= ratio | PLLDIV_EN;
__raw_writel(v, pll->base + clk->div_reg);

Expand Down

0 comments on commit b1d05be

Please sign in to comment.