Commit 71a488db authored by Rajendra Nayak's avatar Rajendra Nayak Committed by Paul Walmsley

OMAP4: PM: Use the low-power state change feature on OMAP4

For pwrdm's which support LOWPOWERSTATECHANGE, do not try waking
up the domain to put it back to deeper sleep state.
Signed-off-by: default avatarRajendra Nayak <rnayak@ti.com>
Signed-off-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarBenoit Cousson <b-cousson@ti.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent 6081dc34
...@@ -89,6 +89,10 @@ static void omap2_init_processor_devices(void) ...@@ -89,6 +89,10 @@ static void omap2_init_processor_devices(void)
} }
} }
/* Types of sleep_switch used in omap_set_pwrdm_state */
#define FORCEWAKEUP_SWITCH 0
#define LOWPOWERSTATE_SWITCH 1
/* /*
* This sets pwrdm state (other than mpu & core. Currently only ON & * This sets pwrdm state (other than mpu & core. Currently only ON &
* RET are supported. Function is assuming that clkdm doesn't have * RET are supported. Function is assuming that clkdm doesn't have
...@@ -114,9 +118,14 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) ...@@ -114,9 +118,14 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
return ret; return ret;
if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) { if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) {
omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); if ((pwrdm_read_pwrst(pwrdm) > state) &&
sleep_switch = 1; (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
pwrdm_wait_transition(pwrdm); sleep_switch = LOWPOWERSTATE_SWITCH;
} else {
omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
pwrdm_wait_transition(pwrdm);
sleep_switch = FORCEWAKEUP_SWITCH;
}
} }
ret = pwrdm_set_next_pwrst(pwrdm, state); ret = pwrdm_set_next_pwrst(pwrdm, state);
...@@ -126,12 +135,19 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state) ...@@ -126,12 +135,19 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
goto err; goto err;
} }
if (sleep_switch) { switch (sleep_switch) {
case FORCEWAKEUP_SWITCH:
omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
pwrdm_wait_transition(pwrdm); break;
pwrdm_state_switch(pwrdm); case LOWPOWERSTATE_SWITCH:
pwrdm_set_lowpwrstchange(pwrdm);
break;
default:
return ret;
} }
pwrdm_wait_transition(pwrdm);
pwrdm_state_switch(pwrdm);
err: err:
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment