aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/clock.c
diff options
context:
space:
mode:
authorCyril Chemparathy <cyril@ti.com>2010-05-07 17:06:36 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2010-05-13 13:05:27 -0400
commite4c822c7e98cdda78b10a696b030fc20b22dcab4 (patch)
tree95a1ec13b404369fbc5104aed64adf29a8f78709 /arch/arm/mach-davinci/clock.c
parent1bcd38ad2de4c1cd30387c588dfb28d637d4111d (diff)
Davinci: psc - use ioremap()
This patch modifies the psc and clock control code to use ioremap()ed registers. Signed-off-by: Cyril Chemparathy <cyril@ti.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/clock.c')
-rw-r--r--arch/arm/mach-davinci/clock.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c
index 868cb7693499..054c303caead 100644
--- a/arch/arm/mach-davinci/clock.c
+++ b/arch/arm/mach-davinci/clock.c
@@ -302,7 +302,6 @@ static unsigned long clk_pllclk_recalc(struct clk *clk)
302 struct pll_data *pll = clk->pll_data; 302 struct pll_data *pll = clk->pll_data;
303 unsigned long rate = clk->rate; 303 unsigned long rate = clk->rate;
304 304
305 pll->base = IO_ADDRESS(pll->phys_base);
306 ctrl = __raw_readl(pll->base + PLLCTL); 305 ctrl = __raw_readl(pll->base + PLLCTL);
307 rate = pll->input_rate = clk->parent->rate; 306 rate = pll->input_rate = clk->parent->rate;
308 307
@@ -458,8 +457,17 @@ int __init davinci_clk_init(struct clk_lookup *clocks)
458 clk->recalc = clk_leafclk_recalc; 457 clk->recalc = clk_leafclk_recalc;
459 } 458 }
460 459
461 if (clk->pll_data && !clk->pll_data->div_ratio_mask) 460 if (clk->pll_data) {
462 clk->pll_data->div_ratio_mask = PLLDIV_RATIO_MASK; 461 struct pll_data *pll = clk->pll_data;
462
463 if (!pll->div_ratio_mask)
464 pll->div_ratio_mask = PLLDIV_RATIO_MASK;
465
466 if (pll->phys_base && !pll->base) {
467 pll->base = ioremap(pll->phys_base, SZ_4K);
468 WARN_ON(!pll->base);
469 }
470 }
463 471
464 if (clk->recalc) 472 if (clk->recalc)
465 clk->rate = clk->recalc(clk); 473 clk->rate = clk->recalc(clk);