ARM:OMAP3: Smartreflex disable/enable fix
authorKalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Fri, 29 Aug 2008 10:05:44 +0000 (13:05 +0300)
committerTony Lindgren <tony@atomide.com>
Thu, 11 Sep 2008 00:35:14 +0000 (17:35 -0700)
Smartreflex modules have to be disabled when device enters WFI.
Previously only suspend idle path had these calls. By moving the
disable/enable calls to omap_sram_idle, all idle paths will be covered.

Signed-off-by: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/pm34xx.c

index a16eb33..e2d1119 100644 (file)
@@ -166,12 +166,19 @@ static void omap_sram_idle(void)
                printk(KERN_ERR "Invalid mpu state in sram_idle\n");
                return;
        }
+       /* Disable smartreflex before entering WFI */
+       disable_smartreflex(SR1);
+       disable_smartreflex(SR2);
 
        omap2_gpio_prepare_for_retention();
 
        _omap_sram_idle(NULL, save_state);
 
        omap2_gpio_resume_after_retention();
+
+       /* Enable smartreflex after WFI */
+       enable_smartreflex(SR1);
+       enable_smartreflex(SR2);
 }
 
 /*
@@ -297,10 +304,6 @@ static int omap3_pm_suspend(void)
        struct power_state *pwrst;
        int state, ret = 0;
 
-       /* XXX Disable smartreflex before entering suspend */
-       disable_smartreflex(SR1);
-       disable_smartreflex(SR2);
-
        /* Read current next_pwrsts */
        list_for_each_entry(pwrst, &pwrst_list, node)
                pwrst->saved_state = pwrdm_read_next_pwrst(pwrst->pwrdm);
@@ -332,10 +335,6 @@ restore:
                printk(KERN_INFO "Successfully put all powerdomains "
                       "to target state\n");
 
-       /* XXX Enable smartreflex after suspend */
-       enable_smartreflex(SR1);
-       enable_smartreflex(SR2);
-
        return ret;
 }