aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-02-18 09:51:37 +0100
committerJonas ABERG <jonas.aberg@stericsson.com>2011-04-19 18:06:09 +0200
commit14f4f398dd2e81707f7568c904ff815337f7c392 (patch)
treec96ca79b277dfe694f67e60765e074493cbd0f42 /arch
parentab6920c7ffea69cb75e93fc64d88ec5111cb3cfb (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')
-rw-r--r--arch/arm/mach-ux500/pm/cpuidle.c24
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 564990d8803..75e8a5765ff 100644
--- a/arch/arm/mach-ux500/pm/cpuidle.c
+++ b/arch/arm/mach-ux500/pm/cpuidle.c
@@ -464,8 +464,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");
/*
@@ -496,9 +498,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
@@ -509,19 +510,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);