aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pm.c
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2011-07-10 07:56:54 -0400
committerPaul Walmsley <paul@pwsan.com>2011-07-10 07:56:54 -0400
commitb86cfb52a145d8ddad66b98c39c6764f3883cd5a (patch)
tree1f3a173277058c22673505338af6a3675fc32c93 /arch/arm/mach-omap2/pm.c
parent32a363c0f5b44cb4e9adfe238dfc4efa9270f7ae (diff)
OMAP2+: PM: idle clkdms only if already in idle
The omap_set_pwrdm_state function forces clockdomains to idle, without checking the existing idle state programmed, instead based solely on the HW capability of the clockdomain to support idle. This is wrong and the clockdomains should be idled post a state_switch *only* if idle transitions on the clockdomain were already enabled. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Cc: Paul Walmsley <paul@pwsan.com> Acked-by: Kevin Hilman <khilman@ti.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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index d48813fd62de..3feb35911a32 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -108,6 +108,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
108 u32 cur_state; 108 u32 cur_state;
109 int sleep_switch = -1; 109 int sleep_switch = -1;
110 int ret = 0; 110 int ret = 0;
111 int hwsup = 0;
111 112
112 if (pwrdm == NULL || IS_ERR(pwrdm)) 113 if (pwrdm == NULL || IS_ERR(pwrdm))
113 return -EINVAL; 114 return -EINVAL;
@@ -127,6 +128,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
127 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) { 128 (pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE)) {
128 sleep_switch = LOWPOWERSTATE_SWITCH; 129 sleep_switch = LOWPOWERSTATE_SWITCH;
129 } else { 130 } else {
131 hwsup = clkdm_in_hwsup(pwrdm->pwrdm_clkdms[0]);
130 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]); 132 clkdm_wakeup(pwrdm->pwrdm_clkdms[0]);
131 pwrdm_wait_transition(pwrdm); 133 pwrdm_wait_transition(pwrdm);
132 sleep_switch = FORCEWAKEUP_SWITCH; 134 sleep_switch = FORCEWAKEUP_SWITCH;
@@ -142,7 +144,7 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
142 144
143 switch (sleep_switch) { 145 switch (sleep_switch) {
144 case FORCEWAKEUP_SWITCH: 146 case FORCEWAKEUP_SWITCH:
145 if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO) 147 if (hwsup)
146 clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]); 148 clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
147 else 149 else
148 clkdm_sleep(pwrdm->pwrdm_clkdms[0]); 150 clkdm_sleep(pwrdm->pwrdm_clkdms[0]);