summaryrefslogtreecommitdiff
path: root/arch/arm/mach-omap2/pm34xx.c
diff options
context:
space:
mode:
authorTero Kristo <tero.kristo@nokia.com>2008-12-01 14:17:29 +0300
committerKevin Hilman <khilman@deeprootsystems.com>2009-11-12 01:42:28 +0300
commitecf157d0b38953cdefa2c8fb7ccb5a62db242aef (patch)
treeeaffb96276d8e7443dcc76ef1ec7d9b383b8e82f /arch/arm/mach-omap2/pm34xx.c
parent658ce97ef57f4c0737bfcb76050400b53389ed6b (diff)
downloadlinux-ecf157d0b38953cdefa2c8fb7ccb5a62db242aef.tar.xz
OMAP3: PM: Prevent PER from going OFF when CORE is going INA
OMAP3 can't generate wakeups in this state, thus it is not permitted. Signed-off-by: Tero Kristo <tero.kristo@nokia.com> Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm34xx.c')
-rw-r--r--arch/arm/mach-omap2/pm34xx.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index d8a6e10ac315..55567bf5ccbf 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -308,6 +308,7 @@ static void omap_sram_idle(void)
int core_next_state = PWRDM_POWER_ON;
int core_prev_state, per_prev_state;
u32 sdrc_pwr = 0;
+ int per_state_modified = 0;
if (!_omap_sram_idle)
return;
@@ -340,15 +341,21 @@ static void omap_sram_idle(void)
/* PER */
per_next_state = pwrdm_read_next_pwrst(per_pwrdm);
+ core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
if (per_next_state < PWRDM_POWER_ON) {
- omap2_gpio_prepare_for_retention();
omap_uart_prepare_idle(2);
- if (per_next_state == PWRDM_POWER_OFF)
- omap3_per_save_context();
+ omap2_gpio_prepare_for_retention();
+ if (per_next_state == PWRDM_POWER_OFF) {
+ if (core_next_state == PWRDM_POWER_ON) {
+ per_next_state = PWRDM_POWER_RET;
+ pwrdm_set_next_pwrst(per_pwrdm, per_next_state);
+ per_state_modified = 1;
+ } else
+ omap3_per_save_context();
+ }
}
/* CORE */
- core_next_state = pwrdm_read_next_pwrst(core_pwrdm);
if (core_next_state < PWRDM_POWER_ON) {
omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1);
@@ -413,10 +420,12 @@ static void omap_sram_idle(void)
/* PER */
if (per_next_state < PWRDM_POWER_ON) {
per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm);
- omap_uart_resume_idle(2);
if (per_prev_state == PWRDM_POWER_OFF)
omap3_per_restore_context();
omap2_gpio_resume_after_retention();
+ omap_uart_resume_idle(2);
+ if (per_state_modified)
+ pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF);
}
/* Disable IO-PAD wakeup */