diff options
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index ea3f565ba1a4..961ac8f7e13d 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -22,14 +22,16 @@ | |||
22 | #include <linux/clk.h> | 22 | #include <linux/clk.h> |
23 | #include <linux/io.h> | 23 | #include <linux/io.h> |
24 | #include <linux/bitops.h> | 24 | #include <linux/bitops.h> |
25 | #include <trace/events/power.h> | ||
26 | 25 | ||
27 | #include <asm/cpu.h> | 26 | #include <asm/cpu.h> |
27 | |||
28 | #include <plat/clock.h> | 28 | #include <plat/clock.h> |
29 | #include "clockdomain.h" | ||
30 | #include <plat/cpu.h> | ||
31 | #include <plat/prcm.h> | 29 | #include <plat/prcm.h> |
32 | 30 | ||
31 | #include <trace/events/power.h> | ||
32 | |||
33 | #include "soc.h" | ||
34 | #include "clockdomain.h" | ||
33 | #include "clock.h" | 35 | #include "clock.h" |
34 | #include "cm2xxx_3xxx.h" | 36 | #include "cm2xxx_3xxx.h" |
35 | #include "cm-regbits-24xx.h" | 37 | #include "cm-regbits-24xx.h" |
@@ -76,7 +78,7 @@ static void _omap2_module_wait_ready(struct clk *clk) | |||
76 | clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); | 78 | clk->ops->find_idlest(clk, &idlest_reg, &idlest_bit, &idlest_val); |
77 | 79 | ||
78 | omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, | 80 | omap2_cm_wait_idlest(idlest_reg, (1 << idlest_bit), idlest_val, |
79 | clk->name); | 81 | __clk_get_name(clk)); |
80 | } | 82 | } |
81 | 83 | ||
82 | /* Public functions */ | 84 | /* Public functions */ |
@@ -92,18 +94,21 @@ static void _omap2_module_wait_ready(struct clk *clk) | |||
92 | void omap2_init_clk_clkdm(struct clk *clk) | 94 | void omap2_init_clk_clkdm(struct clk *clk) |
93 | { | 95 | { |
94 | struct clockdomain *clkdm; | 96 | struct clockdomain *clkdm; |
97 | const char *clk_name; | ||
95 | 98 | ||
96 | if (!clk->clkdm_name) | 99 | if (!clk->clkdm_name) |
97 | return; | 100 | return; |
98 | 101 | ||
102 | clk_name = __clk_get_name(clk); | ||
103 | |||
99 | clkdm = clkdm_lookup(clk->clkdm_name); | 104 | clkdm = clkdm_lookup(clk->clkdm_name); |
100 | if (clkdm) { | 105 | if (clkdm) { |
101 | pr_debug("clock: associated clk %s to clkdm %s\n", | 106 | pr_debug("clock: associated clk %s to clkdm %s\n", |
102 | clk->name, clk->clkdm_name); | 107 | clk_name, clk->clkdm_name); |
103 | clk->clkdm = clkdm; | 108 | clk->clkdm = clkdm; |
104 | } else { | 109 | } else { |
105 | pr_debug("clock: could not associate clk %s to " | 110 | pr_debug("clock: could not associate clk %s to clkdm %s\n", |
106 | "clkdm %s\n", clk->name, clk->clkdm_name); | 111 | clk_name, clk->clkdm_name); |
107 | } | 112 | } |
108 | } | 113 | } |
109 | 114 | ||
@@ -226,8 +231,7 @@ void omap2_dflt_clk_disable(struct clk *clk) | |||
226 | * 'Independent' here refers to a clock which is not | 231 | * 'Independent' here refers to a clock which is not |
227 | * controlled by its parent. | 232 | * controlled by its parent. |
228 | */ | 233 | */ |
229 | printk(KERN_ERR "clock: clk_disable called on independent " | 234 | pr_err("clock: clk_disable called on independent clock %s which has no enable_reg\n", clk->name); |
230 | "clock %s which has no enable_reg\n", clk->name); | ||
231 | return; | 235 | return; |
232 | } | 236 | } |
233 | 237 | ||
@@ -270,8 +274,7 @@ const struct clkops clkops_omap2_dflt = { | |||
270 | void omap2_clk_disable(struct clk *clk) | 274 | void omap2_clk_disable(struct clk *clk) |
271 | { | 275 | { |
272 | if (clk->usecount == 0) { | 276 | if (clk->usecount == 0) { |
273 | WARN(1, "clock: %s: omap2_clk_disable() called, but usecount " | 277 | WARN(1, "clock: %s: omap2_clk_disable() called, but usecount already 0?", clk->name); |
274 | "already 0?", clk->name); | ||
275 | return; | 278 | return; |
276 | } | 279 | } |
277 | 280 | ||
@@ -332,8 +335,8 @@ int omap2_clk_enable(struct clk *clk) | |||
332 | if (clkdm_control && clk->clkdm) { | 335 | if (clkdm_control && clk->clkdm) { |
333 | ret = clkdm_clk_enable(clk->clkdm, clk); | 336 | ret = clkdm_clk_enable(clk->clkdm, clk); |
334 | if (ret) { | 337 | if (ret) { |
335 | WARN(1, "clock: %s: could not enable clockdomain %s: " | 338 | WARN(1, "clock: %s: could not enable clockdomain %s: %d\n", |
336 | "%d\n", clk->name, clk->clkdm->name, ret); | 339 | clk->name, clk->clkdm->name, ret); |
337 | goto oce_err2; | 340 | goto oce_err2; |
338 | } | 341 | } |
339 | } | 342 | } |
@@ -501,10 +504,8 @@ void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name, | |||
501 | 504 | ||
502 | hfclkin_rate = clk_get_rate(hfclkin_ck); | 505 | hfclkin_rate = clk_get_rate(hfclkin_ck); |
503 | 506 | ||
504 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): " | 507 | pr_info("Switched to new clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n", |
505 | "%ld.%01ld/%ld/%ld MHz\n", | 508 | (hfclkin_rate / 1000000), ((hfclkin_rate / 100000) % 10), |
506 | (hfclkin_rate / 1000000), | ||
507 | ((hfclkin_rate / 100000) % 10), | ||
508 | (clk_get_rate(core_ck) / 1000000), | 509 | (clk_get_rate(core_ck) / 1000000), |
509 | (clk_get_rate(mpu_ck) / 1000000)); | 510 | (clk_get_rate(mpu_ck) / 1000000)); |
510 | } | 511 | } |