OMAP4: PM: Do not assume clkdm supports hw transitions
authorRajendra Nayak <rnayak@ti.com>
Wed, 22 Dec 2010 05:37:28 +0000 (22:37 -0700)
committerPaul Walmsley <paul@pwsan.com>
Wed, 22 Dec 2010 05:37:28 +0000 (22:37 -0700)
omap_set_pwrdm_state today assumes a clkdm supports hw_auto
transitions and hence leaves some which do not support this
in sw wkup state preventing low power transitions.

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>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Paul Walmsley <paul@pwsan.com>
arch/arm/mach-omap2/pm.c

index a2b826cdfbf68da632920bfd7d12660ae413e6ad..9b1db592759f4ec84bbad572d06a4f6767ae5eb3 100644 (file)
@@ -95,8 +95,7 @@ static void omap2_init_processor_devices(void)
 
 /*
  * This sets pwrdm state (other than mpu & core. Currently only ON &
- * RET are supported. Function is assuming that clkdm doesn't have
- * hw_sup mode enabled.
+ * RET are supported.
  */
 int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
 {
@@ -137,7 +136,10 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u32 state)
 
        switch (sleep_switch) {
        case FORCEWAKEUP_SWITCH:
-               omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
+               if (pwrdm->pwrdm_clkdms[0]->flags & CLKDM_CAN_ENABLE_AUTO)
+                       omap2_clkdm_allow_idle(pwrdm->pwrdm_clkdms[0]);
+               else
+                       omap2_clkdm_sleep(pwrdm->pwrdm_clkdms[0]);
                break;
        case LOWPOWERSTATE_SWITCH:
                pwrdm_set_lowpwrstchange(pwrdm);