diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap1/clock.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-omap1/clock.h | 10 | ||||
-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 | ||||
-rw-r--r-- | arch/arm/plat-omap/clock.c | 15 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/clock.h | 4 |
10 files changed, 60 insertions, 68 deletions
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c index ccf989f4aa7d..dafe4f71d15f 100644 --- a/arch/arm/mach-omap1/clock.c +++ b/arch/arm/mach-omap1/clock.c | |||
@@ -156,27 +156,25 @@ __u32 arm_idlect1_mask; | |||
156 | * Omap1 specific clock functions | 156 | * Omap1 specific clock functions |
157 | *-------------------------------------------------------------------------*/ | 157 | *-------------------------------------------------------------------------*/ |
158 | 158 | ||
159 | static void omap1_watchdog_recalc(struct clk * clk) | 159 | static unsigned long omap1_watchdog_recalc(struct clk *clk) |
160 | { | 160 | { |
161 | clk->rate = clk->parent->rate / 14; | 161 | return clk->parent->rate / 14; |
162 | } | 162 | } |
163 | 163 | ||
164 | static void omap1_uart_recalc(struct clk * clk) | 164 | static unsigned long omap1_uart_recalc(struct clk *clk) |
165 | { | 165 | { |
166 | unsigned int val = __raw_readl(clk->enable_reg); | 166 | unsigned int val = __raw_readl(clk->enable_reg); |
167 | if (val & clk->enable_bit) | 167 | return val & clk->enable_bit ? 48000000 : 12000000; |
168 | clk->rate = 48000000; | ||
169 | else | ||
170 | clk->rate = 12000000; | ||
171 | } | 168 | } |
172 | 169 | ||
173 | static void omap1_sossi_recalc(struct clk *clk) | 170 | static unsigned long omap1_sossi_recalc(struct clk *clk) |
174 | { | 171 | { |
175 | u32 div = omap_readl(MOD_CONF_CTRL_1); | 172 | u32 div = omap_readl(MOD_CONF_CTRL_1); |
176 | 173 | ||
177 | div = (div >> 17) & 0x7; | 174 | div = (div >> 17) & 0x7; |
178 | div++; | 175 | div++; |
179 | clk->rate = clk->parent->rate / div; | 176 | |
177 | return clk->parent->rate / div; | ||
180 | } | 178 | } |
181 | 179 | ||
182 | static int omap1_clk_enable_dsp_domain(struct clk *clk) | 180 | static int omap1_clk_enable_dsp_domain(struct clk *clk) |
@@ -344,19 +342,15 @@ static int calc_dsor_exp(struct clk *clk, unsigned long rate) | |||
344 | return dsor_exp; | 342 | return dsor_exp; |
345 | } | 343 | } |
346 | 344 | ||
347 | static void omap1_ckctl_recalc(struct clk * clk) | 345 | static unsigned long omap1_ckctl_recalc(struct clk *clk) |
348 | { | 346 | { |
349 | int dsor; | ||
350 | |||
351 | /* Calculate divisor encoded as 2-bit exponent */ | 347 | /* Calculate divisor encoded as 2-bit exponent */ |
352 | dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); | 348 | int dsor = 1 << (3 & (omap_readw(ARM_CKCTL) >> clk->rate_offset)); |
353 | 349 | ||
354 | if (unlikely(clk->rate == clk->parent->rate / dsor)) | 350 | return clk->parent->rate / dsor; |
355 | return; /* No change, quick exit */ | ||
356 | clk->rate = clk->parent->rate / dsor; | ||
357 | } | 351 | } |
358 | 352 | ||
359 | static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) | 353 | static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk) |
360 | { | 354 | { |
361 | int dsor; | 355 | int dsor; |
362 | 356 | ||
@@ -371,9 +365,7 @@ static void omap1_ckctl_recalc_dsp_domain(struct clk * clk) | |||
371 | dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); | 365 | dsor = 1 << (3 & (__raw_readw(DSP_CKCTL) >> clk->rate_offset)); |
372 | omap1_clk_disable(&api_ck.clk); | 366 | omap1_clk_disable(&api_ck.clk); |
373 | 367 | ||
374 | if (unlikely(clk->rate == clk->parent->rate / dsor)) | 368 | return clk->parent->rate / dsor; |
375 | return; /* No change, quick exit */ | ||
376 | clk->rate = clk->parent->rate / dsor; | ||
377 | } | 369 | } |
378 | 370 | ||
379 | /* MPU virtual clock functions */ | 371 | /* MPU virtual clock functions */ |
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h index 28bc74e93e8d..17f874271255 100644 --- a/arch/arm/mach-omap1/clock.h +++ b/arch/arm/mach-omap1/clock.h | |||
@@ -13,14 +13,14 @@ | |||
13 | #ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H | 13 | #ifndef __ARCH_ARM_MACH_OMAP1_CLOCK_H |
14 | #define __ARCH_ARM_MACH_OMAP1_CLOCK_H | 14 | #define __ARCH_ARM_MACH_OMAP1_CLOCK_H |
15 | 15 | ||
16 | static void omap1_ckctl_recalc(struct clk * clk); | 16 | static unsigned long omap1_ckctl_recalc(struct clk *clk); |
17 | static void omap1_watchdog_recalc(struct clk * clk); | 17 | static unsigned long omap1_watchdog_recalc(struct clk *clk); |
18 | static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); | 18 | static int omap1_set_sossi_rate(struct clk *clk, unsigned long rate); |
19 | static void omap1_sossi_recalc(struct clk *clk); | 19 | static unsigned long omap1_sossi_recalc(struct clk *clk); |
20 | static void omap1_ckctl_recalc_dsp_domain(struct clk * clk); | 20 | static unsigned long omap1_ckctl_recalc_dsp_domain(struct clk *clk); |
21 | static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); | 21 | static int omap1_clk_set_rate_dsp_domain(struct clk * clk, unsigned long rate); |
22 | static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); | 22 | static int omap1_set_uart_rate(struct clk * clk, unsigned long rate); |
23 | static void omap1_uart_recalc(struct clk * clk); | 23 | static unsigned long omap1_uart_recalc(struct clk *clk); |
24 | static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); | 24 | static int omap1_set_ext_clk_rate(struct clk * clk, unsigned long rate); |
25 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); | 25 | static long omap1_round_ext_clk_rate(struct clk * clk, unsigned long rate); |
26 | static void omap1_init_ext_clk(struct clk * clk); | 26 | static void omap1_init_ext_clk(struct clk * clk); |
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); |
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 9833d73511a1..08baa18497b2 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -126,7 +126,7 @@ int clk_set_rate(struct clk *clk, unsigned long rate) | |||
126 | ret = arch_clock->clk_set_rate(clk, rate); | 126 | ret = arch_clock->clk_set_rate(clk, rate); |
127 | if (ret == 0) { | 127 | if (ret == 0) { |
128 | if (clk->recalc) | 128 | if (clk->recalc) |
129 | clk->recalc(clk); | 129 | clk->rate = clk->recalc(clk); |
130 | propagate_rate(clk); | 130 | propagate_rate(clk); |
131 | } | 131 | } |
132 | spin_unlock_irqrestore(&clockfw_lock, flags); | 132 | spin_unlock_irqrestore(&clockfw_lock, flags); |
@@ -148,7 +148,7 @@ int clk_set_parent(struct clk *clk, struct clk *parent) | |||
148 | ret = arch_clock->clk_set_parent(clk, parent); | 148 | ret = arch_clock->clk_set_parent(clk, parent); |
149 | if (ret == 0) { | 149 | if (ret == 0) { |
150 | if (clk->recalc) | 150 | if (clk->recalc) |
151 | clk->recalc(clk); | 151 | clk->rate = clk->recalc(clk); |
152 | propagate_rate(clk); | 152 | propagate_rate(clk); |
153 | } | 153 | } |
154 | spin_unlock_irqrestore(&clockfw_lock, flags); | 154 | spin_unlock_irqrestore(&clockfw_lock, flags); |
@@ -188,12 +188,9 @@ static int __init omap_clk_setup(char *str) | |||
188 | __setup("mpurate=", omap_clk_setup); | 188 | __setup("mpurate=", omap_clk_setup); |
189 | 189 | ||
190 | /* Used for clocks that always have same value as the parent clock */ | 190 | /* Used for clocks that always have same value as the parent clock */ |
191 | void followparent_recalc(struct clk *clk) | 191 | unsigned long followparent_recalc(struct clk *clk) |
192 | { | 192 | { |
193 | if (clk == NULL || IS_ERR(clk)) | 193 | return clk->parent->rate; |
194 | return; | ||
195 | |||
196 | clk->rate = clk->parent->rate; | ||
197 | } | 194 | } |
198 | 195 | ||
199 | void clk_reparent(struct clk *child, struct clk *parent) | 196 | void clk_reparent(struct clk *child, struct clk *parent) |
@@ -214,7 +211,7 @@ void propagate_rate(struct clk * tclk) | |||
214 | 211 | ||
215 | list_for_each_entry(clkp, &tclk->children, sibling) { | 212 | list_for_each_entry(clkp, &tclk->children, sibling) { |
216 | if (clkp->recalc) | 213 | if (clkp->recalc) |
217 | clkp->recalc(clkp); | 214 | clkp->rate = clkp->recalc(clkp); |
218 | propagate_rate(clkp); | 215 | propagate_rate(clkp); |
219 | } | 216 | } |
220 | } | 217 | } |
@@ -234,7 +231,7 @@ void recalculate_root_clocks(void) | |||
234 | 231 | ||
235 | list_for_each_entry(clkp, &root_clks, sibling) { | 232 | list_for_each_entry(clkp, &root_clks, sibling) { |
236 | if (clkp->recalc) | 233 | if (clkp->recalc) |
237 | clkp->recalc(clkp); | 234 | clkp->rate = clkp->recalc(clkp); |
238 | propagate_rate(clkp); | 235 | propagate_rate(clkp); |
239 | } | 236 | } |
240 | } | 237 | } |
diff --git a/arch/arm/plat-omap/include/mach/clock.h b/arch/arm/plat-omap/include/mach/clock.h index 0ba28462a497..7b6f6bcbff94 100644 --- a/arch/arm/plat-omap/include/mach/clock.h +++ b/arch/arm/plat-omap/include/mach/clock.h | |||
@@ -75,7 +75,7 @@ struct clk { | |||
75 | unsigned long rate; | 75 | unsigned long rate; |
76 | __u32 flags; | 76 | __u32 flags; |
77 | void __iomem *enable_reg; | 77 | void __iomem *enable_reg; |
78 | void (*recalc)(struct clk *); | 78 | unsigned long (*recalc)(struct clk *); |
79 | int (*set_rate)(struct clk *, unsigned long); | 79 | int (*set_rate)(struct clk *, unsigned long); |
80 | long (*round_rate)(struct clk *, unsigned long); | 80 | long (*round_rate)(struct clk *, unsigned long); |
81 | void (*init)(struct clk *); | 81 | void (*init)(struct clk *); |
@@ -123,7 +123,7 @@ extern void clk_reparent(struct clk *child, struct clk *parent); | |||
123 | extern void clk_unregister(struct clk *clk); | 123 | extern void clk_unregister(struct clk *clk); |
124 | extern void propagate_rate(struct clk *clk); | 124 | extern void propagate_rate(struct clk *clk); |
125 | extern void recalculate_root_clocks(void); | 125 | extern void recalculate_root_clocks(void); |
126 | extern void followparent_recalc(struct clk *clk); | 126 | extern unsigned long followparent_recalc(struct clk *clk); |
127 | extern void clk_enable_init_clocks(void); | 127 | extern void clk_enable_init_clocks(void); |
128 | #ifdef CONFIG_CPU_FREQ | 128 | #ifdef CONFIG_CPU_FREQ |
129 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); | 129 | extern void clk_init_cpufreq_table(struct cpufreq_frequency_table **table); |