diff options
author | Paul Walmsley <paul@pwsan.com> | 2012-10-21 03:01:11 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2012-10-21 03:01:11 -0400 |
commit | 4bd5259e53accda0fe295d3b25da348f4d5f4b09 (patch) | |
tree | 6ddacb5a75a8eda93916eaa917775ac36b561b81 /arch/arm/mach-omap2/cm33xx.c | |
parent | ff4ae5d9319b86f940e410e92659c50f9879ff46 (diff) |
ARM: OMAP2/3: clockdomain/PRM/CM: move the low-level clockdomain functions into PRM/CM
Move the low-level SoC-specific clockdomain control functions into
cm*.c and prm*.c. For example, OMAP2xxx low-level clockdomain
functions go into cm2xxx.c. Then remove the unnecessary
clockdomain*xxx*.c files.
The objective is to centralize low-level CM and PRM register accesses
into the cm*.[ch] and prm*.[ch] files, and then to export an OMAP
SoC-independent API to higher-level OMAP power management code.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Cc: Rajendra Nayak <rnayak@ti.com>
Cc: Vaibhav Hiremath <hvaibhav@ti.com>
Acked-by: Rajendra Nayak <rnayak@ti.com>
Reviewed-by: Russ Dill <Russ.Dill@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/cm33xx.c')
-rw-r--r-- | arch/arm/mach-omap2/cm33xx.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index 13f56eafef03..9b3bcff127ff 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c | |||
@@ -24,6 +24,7 @@ | |||
24 | 24 | ||
25 | #include <plat/common.h> | 25 | #include <plat/common.h> |
26 | 26 | ||
27 | #include "clockdomain.h" | ||
27 | #include "cm.h" | 28 | #include "cm.h" |
28 | #include "cm33xx.h" | 29 | #include "cm33xx.h" |
29 | #include "cm-regbits-34xx.h" | 30 | #include "cm-regbits-34xx.h" |
@@ -311,3 +312,58 @@ void am33xx_cm_module_disable(u16 inst, s16 cdoffs, u16 clkctrl_offs) | |||
311 | v &= ~AM33XX_MODULEMODE_MASK; | 312 | v &= ~AM33XX_MODULEMODE_MASK; |
312 | am33xx_cm_write_reg(v, inst, clkctrl_offs); | 313 | am33xx_cm_write_reg(v, inst, clkctrl_offs); |
313 | } | 314 | } |
315 | |||
316 | /* | ||
317 | * Clockdomain low-level functions | ||
318 | */ | ||
319 | |||
320 | static int am33xx_clkdm_sleep(struct clockdomain *clkdm) | ||
321 | { | ||
322 | am33xx_cm_clkdm_force_sleep(clkdm->cm_inst, clkdm->clkdm_offs); | ||
323 | return 0; | ||
324 | } | ||
325 | |||
326 | static int am33xx_clkdm_wakeup(struct clockdomain *clkdm) | ||
327 | { | ||
328 | am33xx_cm_clkdm_force_wakeup(clkdm->cm_inst, clkdm->clkdm_offs); | ||
329 | return 0; | ||
330 | } | ||
331 | |||
332 | static void am33xx_clkdm_allow_idle(struct clockdomain *clkdm) | ||
333 | { | ||
334 | am33xx_cm_clkdm_enable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); | ||
335 | } | ||
336 | |||
337 | static void am33xx_clkdm_deny_idle(struct clockdomain *clkdm) | ||
338 | { | ||
339 | am33xx_cm_clkdm_disable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); | ||
340 | } | ||
341 | |||
342 | static int am33xx_clkdm_clk_enable(struct clockdomain *clkdm) | ||
343 | { | ||
344 | if (clkdm->flags & CLKDM_CAN_FORCE_WAKEUP) | ||
345 | return am33xx_clkdm_wakeup(clkdm); | ||
346 | |||
347 | return 0; | ||
348 | } | ||
349 | |||
350 | static int am33xx_clkdm_clk_disable(struct clockdomain *clkdm) | ||
351 | { | ||
352 | bool hwsup = false; | ||
353 | |||
354 | hwsup = am33xx_cm_is_clkdm_in_hwsup(clkdm->cm_inst, clkdm->clkdm_offs); | ||
355 | |||
356 | if (!hwsup && (clkdm->flags & CLKDM_CAN_FORCE_SLEEP)) | ||
357 | am33xx_clkdm_sleep(clkdm); | ||
358 | |||
359 | return 0; | ||
360 | } | ||
361 | |||
362 | struct clkdm_ops am33xx_clkdm_operations = { | ||
363 | .clkdm_sleep = am33xx_clkdm_sleep, | ||
364 | .clkdm_wakeup = am33xx_clkdm_wakeup, | ||
365 | .clkdm_allow_idle = am33xx_clkdm_allow_idle, | ||
366 | .clkdm_deny_idle = am33xx_clkdm_deny_idle, | ||
367 | .clkdm_clk_enable = am33xx_clkdm_clk_enable, | ||
368 | .clkdm_clk_disable = am33xx_clkdm_clk_disable, | ||
369 | }; | ||