diff options
author | Tero Kristo <tero.kristo@nokia.com> | 2008-12-01 06:17:29 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-11-11 17:42:28 -0500 |
commit | ecf157d0b38953cdefa2c8fb7ccb5a62db242aef (patch) | |
tree | eaffb96276d8e7443dcc76ef1ec7d9b383b8e82f /arch/arm/mach-omap2/pm34xx.c | |
parent | 658ce97ef57f4c0737bfcb76050400b53389ed6b (diff) |
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.c | 19 |
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) | |||
308 | int core_next_state = PWRDM_POWER_ON; | 308 | int core_next_state = PWRDM_POWER_ON; |
309 | int core_prev_state, per_prev_state; | 309 | int core_prev_state, per_prev_state; |
310 | u32 sdrc_pwr = 0; | 310 | u32 sdrc_pwr = 0; |
311 | int per_state_modified = 0; | ||
311 | 312 | ||
312 | if (!_omap_sram_idle) | 313 | if (!_omap_sram_idle) |
313 | return; | 314 | return; |
@@ -340,15 +341,21 @@ static void omap_sram_idle(void) | |||
340 | 341 | ||
341 | /* PER */ | 342 | /* PER */ |
342 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); | 343 | per_next_state = pwrdm_read_next_pwrst(per_pwrdm); |
344 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | ||
343 | if (per_next_state < PWRDM_POWER_ON) { | 345 | if (per_next_state < PWRDM_POWER_ON) { |
344 | omap2_gpio_prepare_for_retention(); | ||
345 | omap_uart_prepare_idle(2); | 346 | omap_uart_prepare_idle(2); |
346 | if (per_next_state == PWRDM_POWER_OFF) | 347 | omap2_gpio_prepare_for_retention(); |
347 | omap3_per_save_context(); | 348 | if (per_next_state == PWRDM_POWER_OFF) { |
349 | if (core_next_state == PWRDM_POWER_ON) { | ||
350 | per_next_state = PWRDM_POWER_RET; | ||
351 | pwrdm_set_next_pwrst(per_pwrdm, per_next_state); | ||
352 | per_state_modified = 1; | ||
353 | } else | ||
354 | omap3_per_save_context(); | ||
355 | } | ||
348 | } | 356 | } |
349 | 357 | ||
350 | /* CORE */ | 358 | /* CORE */ |
351 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | ||
352 | if (core_next_state < PWRDM_POWER_ON) { | 359 | if (core_next_state < PWRDM_POWER_ON) { |
353 | omap_uart_prepare_idle(0); | 360 | omap_uart_prepare_idle(0); |
354 | omap_uart_prepare_idle(1); | 361 | omap_uart_prepare_idle(1); |
@@ -413,10 +420,12 @@ static void omap_sram_idle(void) | |||
413 | /* PER */ | 420 | /* PER */ |
414 | if (per_next_state < PWRDM_POWER_ON) { | 421 | if (per_next_state < PWRDM_POWER_ON) { |
415 | per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); | 422 | per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); |
416 | omap_uart_resume_idle(2); | ||
417 | if (per_prev_state == PWRDM_POWER_OFF) | 423 | if (per_prev_state == PWRDM_POWER_OFF) |
418 | omap3_per_restore_context(); | 424 | omap3_per_restore_context(); |
419 | omap2_gpio_resume_after_retention(); | 425 | omap2_gpio_resume_after_retention(); |
426 | omap_uart_resume_idle(2); | ||
427 | if (per_state_modified) | ||
428 | pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF); | ||
420 | } | 429 | } |
421 | 430 | ||
422 | /* Disable IO-PAD wakeup */ | 431 | /* Disable IO-PAD wakeup */ |