* [PATCH] OMAP3: PM: Prevent PER from going OFF when CORE is going INA
@ 2008-12-01 11:32 Tero Kristo
2008-12-01 15:53 ` Kevin Hilman
0 siblings, 1 reply; 2+ messages in thread
From: Tero Kristo @ 2008-12-01 11:32 UTC (permalink / raw)
To: linux-omap
OMAP3 can't generate wakeups in this state, thus it is not permitted.
Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
---
arch/arm/mach-omap2/pm34xx.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index 4a2837a..1186739 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -284,6 +284,7 @@ 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;
@@ -320,15 +321,21 @@ 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) {
omap_uart_prepare_idle(2);
omap2_gpio_prepare_for_retention();
- if (per_next_state == PWRDM_POWER_OFF)
- omap3_per_save_context();
+ 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);
@@ -405,6 +412,8 @@ void omap_sram_idle(void)
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 */
--
1.5.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] OMAP3: PM: Prevent PER from going OFF when CORE is going INA
2008-12-01 11:32 [PATCH] OMAP3: PM: Prevent PER from going OFF when CORE is going INA Tero Kristo
@ 2008-12-01 15:53 ` Kevin Hilman
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Hilman @ 2008-12-01 15:53 UTC (permalink / raw)
To: Tero Kristo; +Cc: linux-omap
Tero Kristo <tero.kristo@nokia.com> writes:
> OMAP3 can't generate wakeups in this state, thus it is not permitted.
>
> Signed-off-by: Tero Kristo <tero.kristo@nokia.com>
Thanks, pulling into PM branch.
Kevin
> ---
> arch/arm/mach-omap2/pm34xx.c | 15 ++++++++++++---
> 1 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
> index 4a2837a..1186739 100644
> --- a/arch/arm/mach-omap2/pm34xx.c
> +++ b/arch/arm/mach-omap2/pm34xx.c
> @@ -284,6 +284,7 @@ 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;
> @@ -320,15 +321,21 @@ 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) {
> omap_uart_prepare_idle(2);
> omap2_gpio_prepare_for_retention();
> - if (per_next_state == PWRDM_POWER_OFF)
> - omap3_per_save_context();
> + 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);
> @@ -405,6 +412,8 @@ void omap_sram_idle(void)
> 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 */
> --
> 1.5.4.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-12-01 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-01 11:32 [PATCH] OMAP3: PM: Prevent PER from going OFF when CORE is going INA Tero Kristo
2008-12-01 15:53 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox