aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2010-12-22 00:37:27 -0500
committerPaul Walmsley <paul@pwsan.com>2010-12-22 00:37:27 -0500
commit71a488dbcc4acbc9b845491a368b30ecd7484089 (patch)
tree2361a5f47e82226dd8e88edcb11f9709e8217af6 /arch/arm/mach-omap2/pm.c
parent6081dc348f122cdb76093b2fc6cf5742c968cb69 (diff)
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: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Benoit Cousson <b-cousson@ti.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm/mach-omap2/pm.c')
-rw-r--r--arch/arm/mach-omap2/pm.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index 227a211921c3..a2b826cdfbf6 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -89,6 +89,10 @@ static void omap2_init_processor_devices(void)
89 } 89 }
90} 90}
91 91
92/* Types of sleep_switch used in omap_set_pwrdm_state */
93#define FORCEWAKEUP_SWITCH 0
94#define LOWPOWERSTATE_SWITCH 1
95
92/* 96/*
93 * This sets pwrdm state (other than mpu & core. Currently only ON & 97 * This sets pwrdm state (other than mpu & core. Currently only ON &
94 * RET are supported. Function is assuming that clkdm doesn't have 98 * 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 return ret; 118 return ret;
115 119
116 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) { 120 if (pwrdm_read_pwrst(pwrdm) < PWRDM_POWER_ON) {
117 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 121 if ((pwrdm_read_pwrst(pwrdm) > state) &&
118 sleep_switch = 1; 122 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
119 pwrdm_wait_transition(pwrdm); 123 sleep_switch = LOWPOWERSTATE_SWITCH;
124 } else {
125 omap2_clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
126 pwrdm_wait_transition(pwrdm);
127 sleep_switch = FORCEWAKEUP_SWITCH;
128 }
120 } 129 }
121 130
122 ret = pwrdm_set_next_pwrst(pwrdm, state); 131 ret = pwrdm_set_next_pwrst(pwrdm, state);
@@ -126,12 +135,19 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
126 goto err; 135 goto err;
127 } 136 }
128 137
129 if (sleep_switch) { 138 switch (sleep_switch) {
139 case FORCEWAKEUP_SWITCH:
130 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 140 omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
131 pwrdm_wait_transition(pwrdm); 141 break;
132 pwrdm_state_switch(pwrdm); 142 case LOWPOWERSTATE_SWITCH:
143 pwrdm_set_lowpwrstchange(pwrdm);
144 break;
145 default:
146 return ret;
133 } 147 }
134 148
149 pwrdm_wait_transition(pwrdm);
150 pwrdm_state_switch(pwrdm);
135err: 151err:
136 return ret; 152 return ret;
137} 153}