aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cpuidle34xx.c
diff options
context:
space:
mode:
authorSantosh Shilimkar <santosh.shilimkar@ti.com>2011-09-03 13:08:27 -0400
committerKevin Hilman <khilman@ti.com>2011-12-08 14:29:02 -0500
commitff819da44258ca12b9f60dfd589884106e5a3129 (patch)
treed0c60e673e527085aaddd76fb512311aa6159e40 /arch/arm/mach-omap2/cpuidle34xx.c
parent98be0dde1957a1e47d42cf2c220bf52bacf81d6e (diff)
ARM: OMAP3: CPUidle: Make use of CPU PM notifiers
Save VFP CPU context using CPU PM notifier chain. VFP context is lost when CPU hits OFF state. Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Kevin Hilman <khilman@ti.com> Tested-by: Vishwanath BS <vishwanath.bs@ti.com> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle34xx.c')
-rw-r--r--arch/arm/mach-omap2/cpuidle34xx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index e20332f4abdc..1f71ebb6c12c 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -25,6 +25,7 @@
25#include <linux/sched.h> 25#include <linux/sched.h>
26#include <linux/cpuidle.h> 26#include <linux/cpuidle.h>
27#include <linux/export.h> 27#include <linux/export.h>
28#include <linux/cpu_pm.h>
28 29
29#include <plat/prcm.h> 30#include <plat/prcm.h>
30#include <plat/irqs.h> 31#include <plat/irqs.h>
@@ -124,9 +125,23 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
124 pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle); 125 pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
125 } 126 }
126 127
128 /*
129 * Call idle CPU PM enter notifier chain so that
130 * VFP context is saved.
131 */
132 if (mpu_state == PWRDM_POWER_OFF)
133 cpu_pm_enter();
134
127 /* Execute ARM wfi */ 135 /* Execute ARM wfi */
128 omap_sram_idle(); 136 omap_sram_idle();
129 137
138 /*
139 * Call idle CPU PM enter notifier chain to restore
140 * VFP context.
141 */
142 if (pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
143 cpu_pm_exit();
144
130 /* Re-allow idle for C1 */ 145 /* Re-allow idle for C1 */
131 if (index == 0) { 146 if (index == 0) {
132 pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle); 147 pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);