summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/pm24xx.c
diff options
context:
space:
mode:
authorPaul Walmsley <paul@pwsan.com>2012-02-02 02:30:50 -0700
committerKevin Hilman <khilman@ti.com>2012-03-05 16:01:19 -0800
commit1416408d31236dc2a80d269aa23ffa93aa01e833 (patch)
treefb77d8bad2e21597ed5d0b34fdd040044999e2c2 /arch/arm/mach-omap2/pm24xx.c
parentb7c39a3f59ae55aa49ebf670e9329bc7da6d3c65 (diff)
ARM: OMAP2+: PM: share some suspend-related functions across OMAP2, 3, 4
The platform_suspend_ops can be shared across OMAP2, 3, and 4, along with all of the functions referenced in that structure. This patch shares them. It also removes the suspend_state file-scoped variable in the OMAP2 and 3 PM code; it does not appear to be actually needed by anything. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com> Cc: Rajendra Nayak <rnayak@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> [khilman@ti.com: minor rework needed due to rebase/merge with conflicting changes] Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm24xx.c')
-rw-r--r--arch/arm/mach-omap2/pm24xx.c62
1 files changed, 7 insertions, 55 deletions
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c
index c4fdde477421..5ca45ca76946 100644
--- a/arch/arm/mach-omap2/pm24xx.c
+++ b/arch/arm/mach-omap2/pm24xx.c
@@ -52,19 +52,6 @@
#include "powerdomain.h"
#include "clockdomain.h"
-#ifdef CONFIG_SUSPEND
-static suspend_state_t suspend_state = PM_SUSPEND_ON;
-static inline bool is_suspending(void)
-{
- return (suspend_state != PM_SUSPEND_ON);
-}
-#else
-static inline bool is_suspending(void)
-{
- return false;
-}
-#endif
-
static void (*omap2_sram_idle)(void);
static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl,
void __iomem *sdrc_power);
@@ -84,7 +71,7 @@ static int omap2_fclks_active(void)
return (f1 | f2) ? 1 : 0;
}
-static void omap2_enter_full_retention(void)
+static int omap2_enter_full_retention(void)
{
u32 l;
@@ -147,6 +134,8 @@ no_sleep:
/* Mask future PRCM-to-MPU interrupts */
omap2_prm_write_mod_reg(0x0, OCP_MOD, OMAP2_PRCM_IRQSTATUS_MPU_OFFSET);
+
+ return 0;
}
static int omap2_i2c_active(void)
@@ -243,46 +232,6 @@ out:
local_fiq_enable();
}
-#ifdef CONFIG_SUSPEND
-static int omap2_pm_begin(suspend_state_t state)
-{
- disable_hlt();
- suspend_state = state;
- return 0;
-}
-
-static int omap2_pm_enter(suspend_state_t state)
-{
- int ret = 0;
-
- switch (state) {
- case PM_SUSPEND_STANDBY:
- case PM_SUSPEND_MEM:
- omap2_enter_full_retention();
- break;
- default:
- ret = -EINVAL;
- }
-
- return ret;
-}
-
-static void omap2_pm_end(void)
-{
- suspend_state = PM_SUSPEND_ON;
- enable_hlt();
-}
-
-static const struct platform_suspend_ops omap_pm_ops = {
- .begin = omap2_pm_begin,
- .enter = omap2_pm_enter,
- .end = omap2_pm_end,
- .valid = suspend_valid_only_mem,
-};
-#else
-static const struct platform_suspend_ops __initdata omap_pm_ops;
-#endif /* CONFIG_SUSPEND */
-
static void __init prcm_setup_regs(void)
{
int i, num_mem_banks;
@@ -327,6 +276,10 @@ static void __init prcm_setup_regs(void)
clkdm_for_each(omap_pm_clkdms_setup, NULL);
clkdm_add_wkdep(mpu_clkdm, wkup_clkdm);
+#ifdef CONFIG_SUSPEND
+ omap_pm_suspend = omap2_enter_full_retention;
+#endif
+
/* REVISIT: Configure number of 32 kHz clock cycles for sys_clk
* stabilisation */
omap2_prm_write_mod_reg(15 << OMAP_SETUP_TIME_SHIFT, OMAP24XX_GR_MOD,
@@ -427,7 +380,6 @@ static int __init omap2_pm_init(void)
omap24xx_cpu_suspend_sz);
}
- suspend_set_ops(&omap_pm_ops);
arm_pm_idle = omap2_pm_idle;
return 0;