diff options
author | Kevin Hilman <khilman@deeprootsystems.com> | 2009-01-27 14:09:24 -0500 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-05-12 12:39:16 -0400 |
commit | 43ffcd9a042858a9e9f9fe014bb073e55db34c67 (patch) | |
tree | e6e2ecc3d9af3c398e97ecd8c3007d5db1228a79 /arch/arm/mach-omap2/pm34xx.c | |
parent | 699117a69f53efbdf8fddbd6d991575c0a22fd74 (diff) |
OMAP2/3: GPIO: generalize prepare for idle
Currently, the GPIO 'prepare' hook is only called when going to
off-mode, while the function is called 'prepare_for_retention.' This
patch renames the function to 'prepare_for_idle' and calls it for any
powersate != PWRDM_POWER_ON passing in the powerstate.
The hook itself is then responsible for doing various preparation
based on the powerstate.
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 | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 5de07db636bd..468e1e3321e0 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -376,15 +376,14 @@ void omap_sram_idle(void) | |||
376 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); | 376 | core_next_state = pwrdm_read_next_pwrst(core_pwrdm); |
377 | if (per_next_state < PWRDM_POWER_ON) { | 377 | if (per_next_state < PWRDM_POWER_ON) { |
378 | omap_uart_prepare_idle(2); | 378 | omap_uart_prepare_idle(2); |
379 | omap2_gpio_prepare_for_idle(per_next_state); | ||
379 | if (per_next_state == PWRDM_POWER_OFF) { | 380 | if (per_next_state == PWRDM_POWER_OFF) { |
380 | if (core_next_state == PWRDM_POWER_ON) { | 381 | if (core_next_state == PWRDM_POWER_ON) { |
381 | per_next_state = PWRDM_POWER_RET; | 382 | per_next_state = PWRDM_POWER_RET; |
382 | pwrdm_set_next_pwrst(per_pwrdm, per_next_state); | 383 | pwrdm_set_next_pwrst(per_pwrdm, per_next_state); |
383 | per_state_modified = 1; | 384 | per_state_modified = 1; |
384 | } else { | 385 | } else |
385 | omap2_gpio_prepare_for_retention(); | ||
386 | omap3_per_save_context(); | 386 | omap3_per_save_context(); |
387 | } | ||
388 | } | 387 | } |
389 | } | 388 | } |
390 | 389 | ||
@@ -455,10 +454,9 @@ void omap_sram_idle(void) | |||
455 | /* PER */ | 454 | /* PER */ |
456 | if (per_next_state < PWRDM_POWER_ON) { | 455 | if (per_next_state < PWRDM_POWER_ON) { |
457 | per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); | 456 | per_prev_state = pwrdm_read_prev_pwrst(per_pwrdm); |
458 | if (per_prev_state == PWRDM_POWER_OFF) { | 457 | omap2_gpio_resume_after_idle(); |
458 | if (per_prev_state == PWRDM_POWER_OFF) | ||
459 | omap3_per_restore_context(); | 459 | omap3_per_restore_context(); |
460 | omap2_gpio_resume_after_retention(); | ||
461 | } | ||
462 | omap_uart_resume_idle(2); | 460 | omap_uart_resume_idle(2); |
463 | if (per_state_modified) | 461 | if (per_state_modified) |
464 | pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF); | 462 | pwrdm_set_next_pwrst(per_pwrdm, PWRDM_POWER_OFF); |