]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-omap2/pm34xx.c
OMAP3: PM: Emu_pwrdm is switched off by hardware even when sdti is in use
[linux-2.6-omap-h63xx.git] / arch / arm / mach-omap2 / pm34xx.c
index 8b4b8623f8d224f24dfbabbe21188f54708a9445..43aac5f6031983f6129064caca3cc32f774feecd 100644 (file)
@@ -424,6 +424,12 @@ static void __init omap3_iva_idle(void)
 
 static void __init prcm_setup_regs(void)
 {
+       /* reset modem */
+       prm_write_mod_reg(OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RSTPWRON |
+                         OMAP3430_RM_RSTCTRL_CORE_MODEM_SW_RST,
+                         CORE_MOD, RM_RSTCTRL);
+       prm_write_mod_reg(0, CORE_MOD, RM_RSTCTRL);
+
        /* XXX Reset all wkdeps. This should be done when initializing
         * powerdomains */
        prm_write_mod_reg(0, OMAP3430_IVA2_MOD, PM_WKDEP);
@@ -599,9 +605,18 @@ static int __init pwrdms_setup(struct powerdomain *pwrdm)
        return set_pwrdm_state(pwrst->pwrdm, pwrst->next_state);
 }
 
+/*
+ * Enable hw supervised mode for all clockdomains if it's
+ * supported. Initiate sleep transition for other clockdomains, if
+ * they are not used
+ */
 static int __init clkdms_setup(struct clockdomain *clkdm)
 {
-       omap2_clkdm_allow_idle(clkdm);
+       if (clkdm->flags & CLKDM_CAN_ENABLE_AUTO)
+               omap2_clkdm_allow_idle(clkdm);
+       else if (clkdm->flags & CLKDM_CAN_FORCE_SLEEP &&
+                atomic_read(&clkdm->usecount) == 0)
+               omap2_clkdm_sleep(clkdm);
        return 0;
 }