diff options
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 2a2f15213add..180299e4a838 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -22,7 +22,9 @@ | |||
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> | ||
25 | 26 | ||
27 | #include <asm/cpu.h> | ||
26 | #include <plat/clock.h> | 28 | #include <plat/clock.h> |
27 | #include "clockdomain.h" | 29 | #include "clockdomain.h" |
28 | #include <plat/cpu.h> | 30 | #include <plat/cpu.h> |
@@ -261,10 +263,13 @@ void omap2_clk_disable(struct clk *clk) | |||
261 | 263 | ||
262 | pr_debug("clock: %s: disabling in hardware\n", clk->name); | 264 | pr_debug("clock: %s: disabling in hardware\n", clk->name); |
263 | 265 | ||
264 | clk->ops->disable(clk); | 266 | if (clk->ops && clk->ops->disable) { |
267 | trace_clock_disable(clk->name, 0, smp_processor_id()); | ||
268 | clk->ops->disable(clk); | ||
269 | } | ||
265 | 270 | ||
266 | if (clk->clkdm) | 271 | if (clk->clkdm) |
267 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 272 | clkdm_clk_disable(clk->clkdm, clk); |
268 | 273 | ||
269 | if (clk->parent) | 274 | if (clk->parent) |
270 | omap2_clk_disable(clk->parent); | 275 | omap2_clk_disable(clk->parent); |
@@ -304,7 +309,7 @@ int omap2_clk_enable(struct clk *clk) | |||
304 | } | 309 | } |
305 | 310 | ||
306 | if (clk->clkdm) { | 311 | if (clk->clkdm) { |
307 | ret = omap2_clkdm_clk_enable(clk->clkdm, clk); | 312 | ret = clkdm_clk_enable(clk->clkdm, clk); |
308 | if (ret) { | 313 | if (ret) { |
309 | WARN(1, "clock: %s: could not enable clockdomain %s: " | 314 | WARN(1, "clock: %s: could not enable clockdomain %s: " |
310 | "%d\n", clk->name, clk->clkdm->name, ret); | 315 | "%d\n", clk->name, clk->clkdm->name, ret); |
@@ -312,17 +317,21 @@ int omap2_clk_enable(struct clk *clk) | |||
312 | } | 317 | } |
313 | } | 318 | } |
314 | 319 | ||
315 | ret = clk->ops->enable(clk); | 320 | if (clk->ops && clk->ops->enable) { |
316 | if (ret) { | 321 | trace_clock_enable(clk->name, 1, smp_processor_id()); |
317 | WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); | 322 | ret = clk->ops->enable(clk); |
318 | goto oce_err3; | 323 | if (ret) { |
324 | WARN(1, "clock: %s: could not enable: %d\n", | ||
325 | clk->name, ret); | ||
326 | goto oce_err3; | ||
327 | } | ||
319 | } | 328 | } |
320 | 329 | ||
321 | return 0; | 330 | return 0; |
322 | 331 | ||
323 | oce_err3: | 332 | oce_err3: |
324 | if (clk->clkdm) | 333 | if (clk->clkdm) |
325 | omap2_clkdm_clk_disable(clk->clkdm, clk); | 334 | clkdm_clk_disable(clk->clkdm, clk); |
326 | oce_err2: | 335 | oce_err2: |
327 | if (clk->parent) | 336 | if (clk->parent) |
328 | omap2_clk_disable(clk->parent); | 337 | omap2_clk_disable(clk->parent); |
@@ -349,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate) | |||
349 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); | 358 | pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); |
350 | 359 | ||
351 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ | 360 | /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ |
352 | if (clk->set_rate) | 361 | if (clk->set_rate) { |
362 | trace_clock_set_rate(clk->name, rate, smp_processor_id()); | ||
353 | ret = clk->set_rate(clk, rate); | 363 | ret = clk->set_rate(clk, rate); |
364 | } | ||
354 | 365 | ||
355 | return ret; | 366 | return ret; |
356 | } | 367 | } |
@@ -373,10 +384,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent) | |||
373 | const struct clkops clkops_omap3_noncore_dpll_ops = { | 384 | const struct clkops clkops_omap3_noncore_dpll_ops = { |
374 | .enable = omap3_noncore_dpll_enable, | 385 | .enable = omap3_noncore_dpll_enable, |
375 | .disable = omap3_noncore_dpll_disable, | 386 | .disable = omap3_noncore_dpll_disable, |
387 | .allow_idle = omap3_dpll_allow_idle, | ||
388 | .deny_idle = omap3_dpll_deny_idle, | ||
376 | }; | 389 | }; |
377 | 390 | ||
378 | #endif | 391 | const struct clkops clkops_omap3_core_dpll_ops = { |
392 | .allow_idle = omap3_dpll_allow_idle, | ||
393 | .deny_idle = omap3_dpll_deny_idle, | ||
394 | }; | ||
379 | 395 | ||
396 | #endif | ||
380 | 397 | ||
381 | /* | 398 | /* |
382 | * OMAP2+ clock reset and init functions | 399 | * OMAP2+ clock reset and init functions |