diff options
author | Yilun Lin <yllin@google.com> | 2018-11-07 14:23:05 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-08 00:48:14 -0800 |
commit | c088357d819bdc36fabce85037c9085693e17fd0 (patch) | |
tree | 3a3cbe1ff9cd4a706d437345df9c807d2c37fe68 /power/mt8183.c | |
parent | 3f487a8882fc4095b98b10d8ce9e6b71254d27c2 (diff) | |
download | chrome-ec-c088357d819bdc36fabce85037c9085693e17fd0.tar.gz |
power/mt8183: Fix power transition from S3 to S0.
AP_IN_S3_L asserted should equal to IN_SUSPEND_ASSERTED rather than
IN_SUSPEND_DEASSERTED.
BRANCH=None
BUG=b:113367227
TEST=See AP booted into kernel; and test in EC console:
/* booted */
> powerinfo
[22.104134 power state 3 = S0, in 0x0002]
> gpioget AP_IN_SLEEP_L
1* AP_IN_SLEEP_L
/* shutdown */
> aps
> powerinfo
[94.526641 power state 0 = G3, in 0x0001]
> gpioget AP_IN_SLEEP_L
0* AP_IN_SLEEP_L
/* boot again */
> powerb
> powerinfo
[42.273465 power state 3 = S0, in 0x0002]
> gpioget AP_IN_SLEEP_L
1 AP_IN_SLEEP_L
Change-Id: I13f32505dd0be82ab30a9b48b296918be688d464
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1322183
Commit-Ready: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'power/mt8183.c')
-rw-r--r-- | power/mt8183.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/power/mt8183.c b/power/mt8183.c index 7fce482e95..dde78c84ab 100644 --- a/power/mt8183.c +++ b/power/mt8183.c @@ -26,14 +26,14 @@ /* Input state flags */ #define IN_PGOOD_PMIC POWER_SIGNAL_MASK(PMIC_PWR_GOOD) -#define IN_SUSPEND_DEASSERTED POWER_SIGNAL_MASK(AP_IN_S3_L) +#define IN_SUSPEND_ASSERTED POWER_SIGNAL_MASK(AP_IN_S3_L) /* Rails required for S3 and S0 */ #define IN_PGOOD_S0 (IN_PGOOD_PMIC) #define IN_PGOOD_S3 (IN_PGOOD_PMIC) /* All inputs in the right state for S0 */ -#define IN_ALL_S0 (IN_PGOOD_S0 | IN_SUSPEND_DEASSERTED) +#define IN_ALL_S0 (IN_PGOOD_S0 & ~IN_SUSPEND_ASSERTED) /* Long power key press to force shutdown in S0. go/crosdebug */ #define FORCED_SHUTDOWN_DELAY (10 * SECOND) @@ -247,14 +247,14 @@ enum power_state power_handle_state(enum power_state state) case POWER_S3: if (!power_has_signals(IN_PGOOD_S3) || forcing_shutdown) return POWER_S3S5; - else if (power_get_signals() & IN_SUSPEND_DEASSERTED) + else if (!(power_get_signals() & IN_SUSPEND_ASSERTED)) return POWER_S3S0; break; case POWER_S0: if (!power_has_signals(IN_PGOOD_S0) || forcing_shutdown || - !(power_get_signals() & IN_SUSPEND_DEASSERTED)) + power_get_signals() & IN_SUSPEND_ASSERTED) return POWER_S0S3; break; |