diff options
author | Paul Walmsley <paul@pwsan.com> | 2008-03-18 04:35:15 -0400 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-04-14 13:29:38 -0400 |
commit | 6b8858a972a0eff1dc1ab77b0fd9fc25387c217c (patch) | |
tree | a34e94f4d372670c5125e8f490c85e9364d222df /arch/arm/plat-omap | |
parent | 543d93781a3c744017594d0721c4c1814a26bcce (diff) |
ARM: OMAP2: Change 24xx to use shared clock code and new reg access
This patch changes 24xx to use shared clock code and new register
access.
Note that patch adds some temporary OLD_CK defines to keep patch
more readable. These temporary defines will be removed in the next
patch. Also not all clocks are changed in this patch to limit the
size.
Also, the patch fixes few incorrect clock defines in clock24xx.h.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r-- | arch/arm/plat-omap/clock.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/plat-omap/clock.c b/arch/arm/plat-omap/clock.c index 0a603242f367..32a533ba9ada 100644 --- a/arch/arm/plat-omap/clock.c +++ b/arch/arm/plat-omap/clock.c | |||
@@ -304,6 +304,23 @@ void propagate_rate(struct clk * tclk) | |||
304 | } | 304 | } |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | ||
308 | * recalculate_root_clocks - recalculate and propagate all root clocks | ||
309 | * | ||
310 | * Recalculates all root clocks (clocks with no parent), which if the | ||
311 | * clock's .recalc is set correctly, should also propagate their rates. | ||
312 | * Called at init. | ||
313 | */ | ||
314 | void recalculate_root_clocks(void) | ||
315 | { | ||
316 | struct clk *clkp; | ||
317 | |||
318 | list_for_each_entry(clkp, &clocks, node) { | ||
319 | if (unlikely(!clkp->parent) && likely((u32)clkp->recalc)) | ||
320 | clkp->recalc(clkp); | ||
321 | } | ||
322 | } | ||
323 | |||
307 | int clk_register(struct clk *clk) | 324 | int clk_register(struct clk *clk) |
308 | { | 325 | { |
309 | if (clk == NULL || IS_ERR(clk)) | 326 | if (clk == NULL || IS_ERR(clk)) |
@@ -358,6 +375,30 @@ void clk_allow_idle(struct clk *clk) | |||
358 | } | 375 | } |
359 | EXPORT_SYMBOL(clk_allow_idle); | 376 | EXPORT_SYMBOL(clk_allow_idle); |
360 | 377 | ||
378 | void clk_enable_init_clocks(void) | ||
379 | { | ||
380 | struct clk *clkp; | ||
381 | |||
382 | list_for_each_entry(clkp, &clocks, node) { | ||
383 | if (clkp->flags & ENABLE_ON_INIT) | ||
384 | clk_enable(clkp); | ||
385 | } | ||
386 | } | ||
387 | EXPORT_SYMBOL(clk_enable_init_clocks); | ||
388 | |||
389 | #ifdef CONFIG_CPU_FREQ | ||
390 | void clk_init_cpufreq_table(struct cpufreq_frequency_table **table) | ||
391 | { | ||
392 | unsigned long flags; | ||
393 | |||
394 | spin_lock_irqsave(&clockfw_lock, flags); | ||
395 | if (arch_clock->clk_init_cpufreq_table) | ||
396 | arch_clock->clk_init_cpufreq_table(table); | ||
397 | spin_unlock_irqrestore(&clockfw_lock, flags); | ||
398 | } | ||
399 | EXPORT_SYMBOL(clk_init_cpufreq_table); | ||
400 | #endif | ||
401 | |||
361 | /*-------------------------------------------------------------------------*/ | 402 | /*-------------------------------------------------------------------------*/ |
362 | 403 | ||
363 | #ifdef CONFIG_OMAP_RESET_CLOCKS | 404 | #ifdef CONFIG_OMAP_RESET_CLOCKS |
@@ -396,3 +437,4 @@ int __init clk_init(struct clk_functions * custom_clocks) | |||
396 | 437 | ||
397 | return 0; | 438 | return 0; |
398 | } | 439 | } |
440 | |||