aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cm33xx.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2012-11-05 13:52:03 -0500
committerOlof Johansson <olof@lixom.net>2012-11-05 13:52:03 -0500
commit976669971ff7d2d668ee3d9e92d0d9db5aae847c (patch)
treee696fcf3eb3b9c6311fc4fa51aa8c89a29aad9c2 /arch/arm/mach-omap2/cm33xx.c
parent9237b5aa447dce55913b61f435c5140410bf5310 (diff)
parent7fc54fd3084457c7f11b9e2e1e3fcd19a3badc33 (diff)
Merge tag 'omap-for-v3.8/cleanup-prcm-part1-take2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/headers
From Paul Walmsley <paul@pwsan.com> via Tony Lindgren: The first set of OMAP PRM/CM-related cleanup patches for 3.8. Prepares for the future move of the PRM/CM code to drivers/. Also includes some prcm.[ch] cleanup patches from the WDTIMER cleanup series that don't need external acks. * tag 'omap-for-v3.8/cleanup-prcm-part1-take2-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP2+: PRM: create PRM reset source API for the watchdog timer driver ARM: OMAP1: create read_reset_sources() function (for initial use by watchdog) ARM: OMAP2+: CM: prepare for use of cm_ll_data function pointers ARM: OMAP2+: PRM: prepare for use of prm_ll_data function pointers ARM: OMAP2/3: clockdomain/PRM/CM: move the low-level clockdomain functions into PRM/CM ARM: OMAP2+: CM/hwmod: split CM functions into OMAP2, OMAP3-specific files ARM: OMAP2+: powerdomain/PRM: move the low-level powerdomain functions into PRM ARM: OMAP2+: PRM: split PRM functions into OMAP2, OMAP3-specific files ARM: OMAP2+: PRM: remove PRM weak functions
Diffstat (limited to 'arch/arm/mach-omap2/cm33xx.c')
-rw-r--r--arch/arm/mach-omap2/cm33xx.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c
index b4938abf28cc..b2dfcd777194 100644
--- a/arch/arm/mach-omap2/cm33xx.c
+++ b/arch/arm/mach-omap2/cm33xx.c
@@ -24,6 +24,7 @@
24 24
25#include "../plat-omap/common.h" 25#include "../plat-omap/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
320static 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
326static 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
332static void am33xx_clkdm_allow_idle(struct clockdomain *clkdm)
333{
334 am33xx_cm_clkdm_enable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
335}
336
337static void am33xx_clkdm_deny_idle(struct clockdomain *clkdm)
338{
339 am33xx_cm_clkdm_disable_hwsup(clkdm->cm_inst, clkdm->clkdm_offs);
340}
341
342static 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
350static 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
362struct 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};