diff options
author | Jonas Aaberg <jonas.aberg@stericsson.com> | 2011-02-18 09:51:37 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@stericsson.com> | 2011-09-19 15:15:07 +0200 |
commit | 86c3d6751ace6bbc7992557477ecaabcf628cf15 (patch) | |
tree | e5275bb542c996144019d3890196569208369873 /arch/arm | |
parent | e7cb12aba0c14e422b632f480f7732b5a4544ec4 (diff) |
ARM: ux500: cpuidle: Code clean-up I
ST-Ericsson Linux next: Not tested, ask SSM for ER
ST-Ericsson ID: ER332789
ST-Ericsson FOSS-OUT ID: Trivial
Change-Id: I763ca2c11e9827c03540b8bb6e494525c00f20cb
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/16348
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ux500/pm/cpuidle.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/arch/arm/mach-ux500/pm/cpuidle.c b/arch/arm/mach-ux500/pm/cpuidle.c index 930543267d2..8d6a5c93b88 100644 --- a/arch/arm/mach-ux500/pm/cpuidle.c +++ b/arch/arm/mach-ux500/pm/cpuidle.c @@ -444,8 +444,10 @@ static int enter_sleep(struct cpuidle_device *dev, if (cstates[target].ARM == ARM_ON) { - if (cstates[gov_cstate].ARM == ARM_OFF) { + switch(cstates[gov_cstate].ARM) { + + case ARM_OFF: ux500_ci_dbg_msg("WFI_prep"); /* @@ -476,9 +478,8 @@ static int enter_sleep(struct cpuidle_device *dev, smp_wmb(); context_restore_cpu_registers(); - - } else if (cstates[gov_cstate].ARM != ARM_ON) { - + break; + case ARM_RET: /* * Can not go ApIdle or deeper now, but it * might be possible later, so prepare for it @@ -489,19 +490,16 @@ static int enter_sleep(struct cpuidle_device *dev, * ARM off mode. Use always-on-timer instead. */ migrate_to_always_on_timer(state); - - ux500_ci_dbg_msg("WFI_prep2"); - ux500_ci_dbg_log(CI_WFI, smp_processor_id()); - __asm__ __volatile__ - ("dsb\n\t" "wfi\n\t" : : : "memory"); - - - } else { /* Just WFI */ - + /* Fall through */ + case ARM_ON: ux500_ci_dbg_msg("WFI"); ux500_ci_dbg_log(CI_WFI, smp_processor_id()); __asm__ __volatile__ ("dsb\n\t" "wfi\n\t" : : : "memory"); + break; + default: + /* Cannot happen */ + break; } restore_sequence(state); |