diff options
Diffstat (limited to 'arch/arm/mach-omap2/powerdomain.c')
-rw-r--r-- | arch/arm/mach-omap2/powerdomain.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c index 43ac20c15f4f..86babd740d41 100644 --- a/arch/arm/mach-omap2/powerdomain.c +++ b/arch/arm/mach-omap2/powerdomain.c | |||
@@ -52,7 +52,6 @@ enum { | |||
52 | #define ALREADYACTIVE_SWITCH 0 | 52 | #define ALREADYACTIVE_SWITCH 0 |
53 | #define FORCEWAKEUP_SWITCH 1 | 53 | #define FORCEWAKEUP_SWITCH 1 |
54 | #define LOWPOWERSTATE_SWITCH 2 | 54 | #define LOWPOWERSTATE_SWITCH 2 |
55 | #define ERROR_SWITCH 3 | ||
56 | 55 | ||
57 | /* pwrdm_list contains all registered struct powerdomains */ | 56 | /* pwrdm_list contains all registered struct powerdomains */ |
58 | static LIST_HEAD(pwrdm_list); | 57 | static LIST_HEAD(pwrdm_list); |
@@ -233,10 +232,7 @@ static u8 _pwrdm_save_clkdm_state_and_activate(struct powerdomain *pwrdm, | |||
233 | { | 232 | { |
234 | u8 sleep_switch; | 233 | u8 sleep_switch; |
235 | 234 | ||
236 | if (curr_pwrst < 0) { | 235 | if (curr_pwrst < PWRDM_POWER_ON) { |
237 | WARN_ON(1); | ||
238 | sleep_switch = ERROR_SWITCH; | ||
239 | } else if (curr_pwrst < PWRDM_POWER_ON) { | ||
240 | if (curr_pwrst > pwrst && | 236 | if (curr_pwrst > pwrst && |
241 | pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE && | 237 | pwrdm->flags & PWRDM_HAS_LOWPOWERSTATECHANGE && |
242 | arch_pwrdm->pwrdm_set_lowpwrstchange) { | 238 | arch_pwrdm->pwrdm_set_lowpwrstchange) { |
@@ -1091,7 +1087,8 @@ int pwrdm_post_transition(struct powerdomain *pwrdm) | |||
1091 | */ | 1087 | */ |
1092 | int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst) | 1088 | int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst) |
1093 | { | 1089 | { |
1094 | u8 curr_pwrst, next_pwrst, sleep_switch; | 1090 | u8 next_pwrst, sleep_switch; |
1091 | int curr_pwrst; | ||
1095 | int ret = 0; | 1092 | int ret = 0; |
1096 | bool hwsup = false; | 1093 | bool hwsup = false; |
1097 | 1094 | ||
@@ -1107,16 +1104,17 @@ int omap_set_pwrdm_state(struct powerdomain *pwrdm, u8 pwrst) | |||
1107 | pwrdm_lock(pwrdm); | 1104 | pwrdm_lock(pwrdm); |
1108 | 1105 | ||
1109 | curr_pwrst = pwrdm_read_pwrst(pwrdm); | 1106 | curr_pwrst = pwrdm_read_pwrst(pwrdm); |
1107 | if (curr_pwrst < 0) { | ||
1108 | ret = -EINVAL; | ||
1109 | goto osps_out; | ||
1110 | } | ||
1111 | |||
1110 | next_pwrst = pwrdm_read_next_pwrst(pwrdm); | 1112 | next_pwrst = pwrdm_read_next_pwrst(pwrdm); |
1111 | if (curr_pwrst == pwrst && next_pwrst == pwrst) | 1113 | if (curr_pwrst == pwrst && next_pwrst == pwrst) |
1112 | goto osps_out; | 1114 | goto osps_out; |
1113 | 1115 | ||
1114 | sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, curr_pwrst, | 1116 | sleep_switch = _pwrdm_save_clkdm_state_and_activate(pwrdm, curr_pwrst, |
1115 | pwrst, &hwsup); | 1117 | pwrst, &hwsup); |
1116 | if (sleep_switch == ERROR_SWITCH) { | ||
1117 | ret = -EINVAL; | ||
1118 | goto osps_out; | ||
1119 | } | ||
1120 | 1118 | ||
1121 | ret = pwrdm_set_next_pwrst(pwrdm, pwrst); | 1119 | ret = pwrdm_set_next_pwrst(pwrdm, pwrst); |
1122 | if (ret) | 1120 | if (ret) |