@@ -531,11 +531,17 @@ void omap_sram_idle(void)
if (pwrdm_read_pwrst(cam_pwrdm) == PWRDM_POWER_ON)
omap2_clkdm_deny_idle(mpu_pwrdm->pwrdm_clkdms[0]);
- /* CORE */
- if (core_next_state < PWRDM_POWER_ON) {
- /* Disable smartreflex before entering WFI */
+ /*
+ * Disable smartreflex before entering WFI.
+ * Only needed if we are going to enter retention or off.
+ */
+ if (mpu_next_state <= PWRDM_POWER_RET)
disable_smartreflex(SR1);
+ if (core_next_state <= PWRDM_POWER_RET)
disable_smartreflex(SR2);
+
+ /* CORE */
+ if (core_next_state < PWRDM_POWER_ON) {
omap_uart_prepare_idle(0);
omap_uart_prepare_idle(1);
if (core_next_state == PWRDM_POWER_OFF) {
@@ -608,10 +614,17 @@ void omap_sram_idle(void)
prm_clear_mod_reg_bits(OMAP3430_AUTO_RET,
OMAP3430_GR_MOD,
OMAP3_PRM_VOLTCTRL_OFFSET);
- /* Enable smartreflex after WFI */
+ }
+
+ /*
+ * Enable smartreflex after WFI. Only needed if we
+ * entered retention or off.
+ */
+ if (mpu_next_state <= PWRDM_POWER_RET)
enable_smartreflex(SR1);
+ if (core_next_state <= PWRDM_POWER_RET)
enable_smartreflex(SR2);
- }
+
if (core_saved_state != core_next_state)
pwrdm_set_next_pwrst(core_pwrdm, core_saved_state);