diff options
Diffstat (limited to 'arch/arm/mach-omap2')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock24xx.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock24xx.h | 10 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock34xx.h | 4 |
6 files changed, 35 insertions, 32 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 1b40d757500d..5020cb1f2e7e 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -239,11 +239,11 @@ u32 omap2_get_dpll_rate(struct clk *clk) | |||
239 | * Used for clocks that have the same value as the parent clock, | 239 | * Used for clocks that have the same value as the parent clock, |
240 | * divided by some factor | 240 | * divided by some factor |
241 | */ | 241 | */ |
242 | void omap2_fixed_divisor_recalc(struct clk *clk) | 242 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk) |
243 | { | 243 | { |
244 | WARN_ON(!clk->fixed_div); | 244 | WARN_ON(!clk->fixed_div); |
245 | 245 | ||
246 | clk->rate = clk->parent->rate / clk->fixed_div; | 246 | return clk->parent->rate / clk->fixed_div; |
247 | } | 247 | } |
248 | 248 | ||
249 | /** | 249 | /** |
@@ -449,21 +449,22 @@ err: | |||
449 | * Used for clocks that are part of CLKSEL_xyz governed clocks. | 449 | * Used for clocks that are part of CLKSEL_xyz governed clocks. |
450 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? | 450 | * REVISIT: Maybe change to use clk->enable() functions like on omap1? |
451 | */ | 451 | */ |
452 | void omap2_clksel_recalc(struct clk *clk) | 452 | unsigned long omap2_clksel_recalc(struct clk *clk) |
453 | { | 453 | { |
454 | unsigned long rate; | ||
454 | u32 div = 0; | 455 | u32 div = 0; |
455 | 456 | ||
456 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); | 457 | pr_debug("clock: recalc'ing clksel clk %s\n", clk->name); |
457 | 458 | ||
458 | div = omap2_clksel_get_divisor(clk); | 459 | div = omap2_clksel_get_divisor(clk); |
459 | if (div == 0) | 460 | if (div == 0) |
460 | return; | 461 | return clk->rate; |
461 | 462 | ||
462 | if (clk->rate == (clk->parent->rate / div)) | 463 | rate = clk->parent->rate / div; |
463 | return; | 464 | |
464 | clk->rate = clk->parent->rate / div; | 465 | pr_debug("clock: new clock rate is %ld (div %d)\n", rate, div); |
465 | 466 | ||
466 | pr_debug("clock: new clock rate is %ld (div %d)\n", clk->rate, div); | 467 | return rate; |
467 | } | 468 | } |
468 | 469 | ||
469 | /** | 470 | /** |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 90077f0df78d..ca6bf226859e 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -36,7 +36,7 @@ void omap2_clk_disable_unused(struct clk *clk); | |||
36 | #define omap2_clk_disable_unused NULL | 36 | #define omap2_clk_disable_unused NULL |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | void omap2_clksel_recalc(struct clk *clk); | 39 | unsigned long omap2_clksel_recalc(struct clk *clk); |
40 | void omap2_init_clk_clkdm(struct clk *clk); | 40 | void omap2_init_clk_clkdm(struct clk *clk); |
41 | void omap2_init_clksel_parent(struct clk *clk); | 41 | void omap2_init_clksel_parent(struct clk *clk); |
42 | u32 omap2_clksel_get_divisor(struct clk *clk); | 42 | u32 omap2_clksel_get_divisor(struct clk *clk); |
@@ -44,7 +44,7 @@ u32 omap2_clksel_round_rate_div(struct clk *clk, unsigned long target_rate, | |||
44 | u32 *new_div); | 44 | u32 *new_div); |
45 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); | 45 | u32 omap2_clksel_to_divisor(struct clk *clk, u32 field_val); |
46 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); | 46 | u32 omap2_divisor_to_clksel(struct clk *clk, u32 div); |
47 | void omap2_fixed_divisor_recalc(struct clk *clk); | 47 | unsigned long omap2_fixed_divisor_recalc(struct clk *clk); |
48 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); | 48 | long omap2_clksel_round_rate(struct clk *clk, unsigned long target_rate); |
49 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); | 49 | int omap2_clksel_set_rate(struct clk *clk, unsigned long rate); |
50 | u32 omap2_get_dpll_rate(struct clk *clk); | 50 | u32 omap2_get_dpll_rate(struct clk *clk); |
diff --git a/arch/arm/mach-omap2/clock24xx.c b/arch/arm/mach-omap2/clock24xx.c index 069f3e1827a6..f2b74e9b7d8d 100644 --- a/arch/arm/mach-omap2/clock24xx.c +++ b/arch/arm/mach-omap2/clock24xx.c | |||
@@ -369,9 +369,9 @@ static long omap2_dpllcore_round_rate(unsigned long target_rate) | |||
369 | 369 | ||
370 | } | 370 | } |
371 | 371 | ||
372 | static void omap2_dpllcore_recalc(struct clk *clk) | 372 | static unsigned long omap2_dpllcore_recalc(struct clk *clk) |
373 | { | 373 | { |
374 | clk->rate = omap2_get_dpll_rate_24xx(clk); | 374 | return omap2_get_dpll_rate_24xx(clk); |
375 | } | 375 | } |
376 | 376 | ||
377 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | 377 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) |
@@ -448,9 +448,9 @@ static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate) | |||
448 | * | 448 | * |
449 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. | 449 | * Set virt_prcm_set's rate to the mpu_speed field of the current PRCM set. |
450 | */ | 450 | */ |
451 | static void omap2_table_mpu_recalc(struct clk *clk) | 451 | static unsigned long omap2_table_mpu_recalc(struct clk *clk) |
452 | { | 452 | { |
453 | clk->rate = curr_prcm_set->mpu_speed; | 453 | return curr_prcm_set->mpu_speed; |
454 | } | 454 | } |
455 | 455 | ||
456 | /* | 456 | /* |
@@ -647,14 +647,14 @@ static u32 omap2_get_sysclkdiv(void) | |||
647 | return div; | 647 | return div; |
648 | } | 648 | } |
649 | 649 | ||
650 | static void omap2_osc_clk_recalc(struct clk *clk) | 650 | static unsigned long omap2_osc_clk_recalc(struct clk *clk) |
651 | { | 651 | { |
652 | clk->rate = omap2_get_apll_clkin() * omap2_get_sysclkdiv(); | 652 | return omap2_get_apll_clkin() * omap2_get_sysclkdiv(); |
653 | } | 653 | } |
654 | 654 | ||
655 | static void omap2_sys_clk_recalc(struct clk *clk) | 655 | static unsigned long omap2_sys_clk_recalc(struct clk *clk) |
656 | { | 656 | { |
657 | clk->rate = clk->parent->rate / omap2_get_sysclkdiv(); | 657 | return clk->parent->rate / omap2_get_sysclkdiv(); |
658 | } | 658 | } |
659 | 659 | ||
660 | /* | 660 | /* |
@@ -707,9 +707,9 @@ int __init omap2_clk_init(void) | |||
707 | 707 | ||
708 | clk_init(&omap2_clk_functions); | 708 | clk_init(&omap2_clk_functions); |
709 | 709 | ||
710 | omap2_osc_clk_recalc(&osc_ck); | 710 | osc_ck.rate = omap2_osc_clk_recalc(&osc_ck); |
711 | propagate_rate(&osc_ck); | 711 | propagate_rate(&osc_ck); |
712 | omap2_sys_clk_recalc(&sys_ck); | 712 | sys_ck.rate = omap2_sys_clk_recalc(&sys_ck); |
713 | propagate_rate(&sys_ck); | 713 | propagate_rate(&sys_ck); |
714 | 714 | ||
715 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) | 715 | for (c = omap24xx_clks; c < omap24xx_clks + ARRAY_SIZE(omap24xx_clks); c++) |
diff --git a/arch/arm/mach-omap2/clock24xx.h b/arch/arm/mach-omap2/clock24xx.h index 759489822ee9..11da6215392b 100644 --- a/arch/arm/mach-omap2/clock24xx.h +++ b/arch/arm/mach-omap2/clock24xx.h | |||
@@ -24,13 +24,13 @@ | |||
24 | #include "cm-regbits-24xx.h" | 24 | #include "cm-regbits-24xx.h" |
25 | #include "sdrc.h" | 25 | #include "sdrc.h" |
26 | 26 | ||
27 | static void omap2_table_mpu_recalc(struct clk *clk); | 27 | static unsigned long omap2_table_mpu_recalc(struct clk *clk); |
28 | static int omap2_select_table_rate(struct clk *clk, unsigned long rate); | 28 | static int omap2_select_table_rate(struct clk *clk, unsigned long rate); |
29 | static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); | 29 | static long omap2_round_to_table_rate(struct clk *clk, unsigned long rate); |
30 | static void omap2_sys_clk_recalc(struct clk *clk); | 30 | static unsigned long omap2_sys_clk_recalc(struct clk *clk); |
31 | static void omap2_osc_clk_recalc(struct clk *clk); | 31 | static unsigned long omap2_osc_clk_recalc(struct clk *clk); |
32 | static void omap2_sys_clk_recalc(struct clk *clk); | 32 | static unsigned long omap2_sys_clk_recalc(struct clk *clk); |
33 | static void omap2_dpllcore_recalc(struct clk *clk); | 33 | static unsigned long omap2_dpllcore_recalc(struct clk *clk); |
34 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); | 34 | static int omap2_reprogram_dpllcore(struct clk *clk, unsigned long rate); |
35 | 35 | ||
36 | /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. | 36 | /* Key dividers which make up a PRCM set. Ratio's for a PRCM are mandated. |
diff --git a/arch/arm/mach-omap2/clock34xx.c b/arch/arm/mach-omap2/clock34xx.c index 3b6e27bc9fe3..fb0f53b96811 100644 --- a/arch/arm/mach-omap2/clock34xx.c +++ b/arch/arm/mach-omap2/clock34xx.c | |||
@@ -289,9 +289,9 @@ static struct omap_clk omap34xx_clks[] = { | |||
289 | * | 289 | * |
290 | * Recalculate and propagate the DPLL rate. | 290 | * Recalculate and propagate the DPLL rate. |
291 | */ | 291 | */ |
292 | static void omap3_dpll_recalc(struct clk *clk) | 292 | static unsigned long omap3_dpll_recalc(struct clk *clk) |
293 | { | 293 | { |
294 | clk->rate = omap2_get_dpll_rate(clk); | 294 | return omap2_get_dpll_rate(clk); |
295 | } | 295 | } |
296 | 296 | ||
297 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ | 297 | /* _omap3_dpll_write_clken - write clken_bits arg to a DPLL's enable bits */ |
@@ -787,9 +787,10 @@ static void omap3_dpll_deny_idle(struct clk *clk) | |||
787 | * Using parent clock DPLL data, look up DPLL state. If locked, set our | 787 | * Using parent clock DPLL data, look up DPLL state. If locked, set our |
788 | * rate to the dpll_clk * 2; otherwise, just use dpll_clk. | 788 | * rate to the dpll_clk * 2; otherwise, just use dpll_clk. |
789 | */ | 789 | */ |
790 | static void omap3_clkoutx2_recalc(struct clk *clk) | 790 | static unsigned long omap3_clkoutx2_recalc(struct clk *clk) |
791 | { | 791 | { |
792 | const struct dpll_data *dd; | 792 | const struct dpll_data *dd; |
793 | unsigned long rate; | ||
793 | u32 v; | 794 | u32 v; |
794 | struct clk *pclk; | 795 | struct clk *pclk; |
795 | 796 | ||
@@ -808,9 +809,10 @@ static void omap3_clkoutx2_recalc(struct clk *clk) | |||
808 | v = __raw_readl(dd->control_reg) & dd->enable_mask; | 809 | v = __raw_readl(dd->control_reg) & dd->enable_mask; |
809 | v >>= __ffs(dd->enable_mask); | 810 | v >>= __ffs(dd->enable_mask); |
810 | if (v != DPLL_LOCKED) | 811 | if (v != DPLL_LOCKED) |
811 | clk->rate = clk->parent->rate; | 812 | rate = clk->parent->rate; |
812 | else | 813 | else |
813 | clk->rate = clk->parent->rate * 2; | 814 | rate = clk->parent->rate * 2; |
815 | return rate; | ||
814 | } | 816 | } |
815 | 817 | ||
816 | /* Common clock code */ | 818 | /* Common clock code */ |
diff --git a/arch/arm/mach-omap2/clock34xx.h b/arch/arm/mach-omap2/clock34xx.h index 2138a58f6346..764c7cd9fd84 100644 --- a/arch/arm/mach-omap2/clock34xx.h +++ b/arch/arm/mach-omap2/clock34xx.h | |||
@@ -27,8 +27,8 @@ | |||
27 | #include "prm.h" | 27 | #include "prm.h" |
28 | #include "prm-regbits-34xx.h" | 28 | #include "prm-regbits-34xx.h" |
29 | 29 | ||
30 | static void omap3_dpll_recalc(struct clk *clk); | 30 | static unsigned long omap3_dpll_recalc(struct clk *clk); |
31 | static void omap3_clkoutx2_recalc(struct clk *clk); | 31 | static unsigned long omap3_clkoutx2_recalc(struct clk *clk); |
32 | static void omap3_dpll_allow_idle(struct clk *clk); | 32 | static void omap3_dpll_allow_idle(struct clk *clk); |
33 | static void omap3_dpll_deny_idle(struct clk *clk); | 33 | static void omap3_dpll_deny_idle(struct clk *clk); |
34 | static u32 omap3_dpll_autoidle_read(struct clk *clk); | 34 | static u32 omap3_dpll_autoidle_read(struct clk *clk); |