@@ -125,14 +125,16 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
current_cx_state = *cx;
- /* Used to keep track of the total time in idle */
- getnstimeofday(&ts_preidle);
+ pwrdm_set_next_pwrst(mpu_pd, mpu_state);
+ pwrdm_set_next_pwrst(core_pd, core_state);
+
+ omap3_device_idle();
local_irq_disable();
local_fiq_disable();
- pwrdm_set_next_pwrst(mpu_pd, mpu_state);
- pwrdm_set_next_pwrst(core_pd, core_state);
+ /* Used to keep track of the total time in idle */
+ getnstimeofday(&ts_preidle);
if (omap_irq_pending() || need_resched())
goto return_sleep_time;
@@ -157,6 +159,8 @@ return_sleep_time:
local_irq_enable();
local_fiq_enable();
+ omap3_device_resume();
+
return ts_idle.tv_nsec / NSEC_PER_USEC + ts_idle.tv_sec * USEC_PER_SEC;
}