Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192098
b: refs/heads/master
c: d6961e6
h: refs/heads/master
v: v3
  • Loading branch information
Cyril Chemparathy authored and Kevin Hilman committed May 6, 2010
1 parent 8891dda commit f871143
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce100669d2ee202acac94d39f1a585c6b066cecc
refs/heads/master: d6961e6889a26de427aa6e0df823c789cf4a848f
9 changes: 6 additions & 3 deletions trunk/arch/arm/mach-davinci/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static unsigned long clk_sysclk_recalc(struct clk *clk)

v = __raw_readl(pll->base + clk->div_reg);
if (v & PLLDIV_EN) {
plldiv = (v & PLLDIV_RATIO_MASK) + 1;
plldiv = (v & pll->div_ratio_mask) + 1;
if (plldiv)
rate /= plldiv;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ static unsigned long clk_pllclk_recalc(struct clk *clk)
if (pll->flags & PLL_HAS_PREDIV) {
prediv = __raw_readl(pll->base + PREDIV);
if (prediv & PLLDIV_EN)
prediv = (prediv & PLLDIV_RATIO_MASK) + 1;
prediv = (prediv & pll->div_ratio_mask) + 1;
else
prediv = 1;
}
Expand All @@ -331,7 +331,7 @@ static unsigned long clk_pllclk_recalc(struct clk *clk)
if (pll->flags & PLL_HAS_POSTDIV) {
postdiv = __raw_readl(pll->base + POSTDIV);
if (postdiv & PLLDIV_EN)
postdiv = (postdiv & PLLDIV_RATIO_MASK) + 1;
postdiv = (postdiv & pll->div_ratio_mask) + 1;
else
postdiv = 1;
}
Expand Down Expand Up @@ -458,6 +458,9 @@ int __init davinci_clk_init(struct clk_lookup *clocks)
clk->recalc = clk_leafclk_recalc;
}

if (clk->pll_data && !clk->pll_data->div_ratio_mask)
clk->pll_data->div_ratio_mask = PLLDIV_RATIO_MASK;

if (clk->recalc)
clk->rate = clk->recalc(clk);

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/mach-davinci/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ struct pll_data {
u32 num;
u32 flags;
u32 input_rate;
u32 div_ratio_mask;
};
#define PLL_HAS_PREDIV 0x01
#define PLL_HAS_POSTDIV 0x02
Expand Down

0 comments on commit f871143

Please sign in to comment.