aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/clock.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/arm/mach-omap2/clock.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/arm/mach-omap2/clock.c')
-rw-r--r--arch/arm/mach-omap2/clock.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 605f531783a8..180299e4a838 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,16 +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>
25 26
27#include <asm/cpu.h>
26#include <plat/clock.h> 28#include <plat/clock.h>
27#include <plat/clockdomain.h> 29#include "clockdomain.h"
28#include <plat/cpu.h> 30#include <plat/cpu.h>
29#include <plat/prcm.h> 31#include <plat/prcm.h>
30 32
31#include "clock.h" 33#include "clock.h"
32#include "prm.h" 34#include "cm2xxx_3xxx.h"
33#include "prm-regbits-24xx.h"
34#include "cm.h"
35#include "cm-regbits-24xx.h" 35#include "cm-regbits-24xx.h"
36#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
37 37
@@ -263,10 +263,13 @@ void omap2_clk_disable(struct clk *clk)
263 263
264 pr_debug("clock: %s: disabling in hardware\n", clk->name); 264 pr_debug("clock: %s: disabling in hardware\n", clk->name);
265 265
266 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 }
267 270
268 if (clk->clkdm) 271 if (clk->clkdm)
269 omap2_clkdm_clk_disable(clk->clkdm, clk); 272 clkdm_clk_disable(clk->clkdm, clk);
270 273
271 if (clk->parent) 274 if (clk->parent)
272 omap2_clk_disable(clk->parent); 275 omap2_clk_disable(clk->parent);
@@ -306,7 +309,7 @@ int omap2_clk_enable(struct clk *clk)
306 } 309 }
307 310
308 if (clk->clkdm) { 311 if (clk->clkdm) {
309 ret = omap2_clkdm_clk_enable(clk->clkdm, clk); 312 ret = clkdm_clk_enable(clk->clkdm, clk);
310 if (ret) { 313 if (ret) {
311 WARN(1, "clock: %s: could not enable clockdomain %s: " 314 WARN(1, "clock: %s: could not enable clockdomain %s: "
312 "%d\n", clk->name, clk->clkdm->name, ret); 315 "%d\n", clk->name, clk->clkdm->name, ret);
@@ -314,17 +317,21 @@ int omap2_clk_enable(struct clk *clk)
314 } 317 }
315 } 318 }
316 319
317 ret = clk->ops->enable(clk); 320 if (clk->ops && clk->ops->enable) {
318 if (ret) { 321 trace_clock_enable(clk->name, 1, smp_processor_id());
319 WARN(1, "clock: %s: could not enable: %d\n", clk->name, ret); 322 ret = clk->ops->enable(clk);
320 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 }
321 } 328 }
322 329
323 return 0; 330 return 0;
324 331
325oce_err3: 332oce_err3:
326 if (clk->clkdm) 333 if (clk->clkdm)
327 omap2_clkdm_clk_disable(clk->clkdm, clk); 334 clkdm_clk_disable(clk->clkdm, clk);
328oce_err2: 335oce_err2:
329 if (clk->parent) 336 if (clk->parent)
330 omap2_clk_disable(clk->parent); 337 omap2_clk_disable(clk->parent);
@@ -351,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
351 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);
352 359
353 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ 360 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
354 if (clk->set_rate) 361 if (clk->set_rate) {
362 trace_clock_set_rate(clk->name, rate, smp_processor_id());
355 ret = clk->set_rate(clk, rate); 363 ret = clk->set_rate(clk, rate);
364 }
356 365
357 return ret; 366 return ret;
358} 367}
@@ -375,10 +384,16 @@ int omap2_clk_set_parent(struct clk *clk, struct clk *new_parent)
375const struct clkops clkops_omap3_noncore_dpll_ops = { 384const struct clkops clkops_omap3_noncore_dpll_ops = {
376 .enable = omap3_noncore_dpll_enable, 385 .enable = omap3_noncore_dpll_enable,
377 .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,
378}; 389};
379 390
380#endif 391const struct clkops clkops_omap3_core_dpll_ops = {
392 .allow_idle = omap3_dpll_allow_idle,
393 .deny_idle = omap3_dpll_deny_idle,
394};
381 395
396#endif
382 397
383/* 398/*
384 * OMAP2+ clock reset and init functions 399 * OMAP2+ clock reset and init functions
@@ -395,7 +410,7 @@ void omap2_clk_disable_unused(struct clk *clk)
395 if ((regval32 & (1 << clk->enable_bit)) == v) 410 if ((regval32 & (1 << clk->enable_bit)) == v)
396 return; 411 return;
397 412
398 printk(KERN_DEBUG "Disabling unused clock \"%s\"\n", clk->name); 413 pr_debug("Disabling unused clock \"%s\"\n", clk->name);
399 if (cpu_is_omap34xx()) { 414 if (cpu_is_omap34xx()) {
400 omap2_clk_enable(clk); 415 omap2_clk_enable(clk);
401 omap2_clk_disable(clk); 416 omap2_clk_disable(clk);