Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff819da4 authored by Santosh Shilimkar's avatar Santosh Shilimkar Committed by Kevin Hilman
Browse files

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: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
Tested-by: default avatarVishwanath BS <vishwanath.bs@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent 98be0dde
Loading
Loading
Loading
Loading
+15 −0
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/cpuidle.h>
#include <linux/cpuidle.h>
#include <linux/export.h>
#include <linux/export.h>
#include <linux/cpu_pm.h>


#include <plat/prcm.h>
#include <plat/prcm.h>
#include <plat/irqs.h>
#include <plat/irqs.h>
@@ -124,9 +125,23 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
		pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
		pwrdm_for_each_clkdm(core_pd, _cpuidle_deny_idle);
	}
	}


	/*
	 * Call idle CPU PM enter notifier chain so that
	 * VFP context is saved.
	 */
	if (mpu_state == PWRDM_POWER_OFF)
		cpu_pm_enter();

	/* Execute ARM wfi */
	/* Execute ARM wfi */
	omap_sram_idle();
	omap_sram_idle();


	/*
	 * Call idle CPU PM enter notifier chain to restore
	 * VFP context.
	 */
	if (pwrdm_read_prev_pwrst(mpu_pd) == PWRDM_POWER_OFF)
		cpu_pm_exit();

	/* Re-allow idle for C1 */
	/* Re-allow idle for C1 */
	if (index == 0) {
	if (index == 0) {
		pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);
		pwrdm_for_each_clkdm(mpu_pd, _cpuidle_allow_idle);