summaryrefslogtreecommitdiff
path: root/power/mt8186.c
diff options
context:
space:
mode:
authorTing Shen <phoenixshen@google.com>2022-06-30 13:04:45 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-05 05:52:23 +0000
commit905412da08b88373f16be832b0d932d30402b13c (patch)
treeab40a3f22573c087872ef5571960eef96f414055 /power/mt8186.c
parentec3a9e5f02217419940492e5009ff5b8c4835a5f (diff)
downloadchrome-ec-905412da08b88373f16be832b0d932d30402b13c.tar.gz
power/mt8186: fix the init value of is_exiting_off
is_exiting_off means that EC wants to leave S5/G3. If EC is already in S0 during initialization, this flag should be false. BUG=b:237499922 TEST=1) `reboot ro` 2) wait until device reaches S0 3) `sysjump rw` 4) `apshutdown` make sure AP stays at G3 BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ibac81cd5d1b62d153fc9aa77d33e04754bb0db9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3735621 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'power/mt8186.c')
-rw-r--r--power/mt8186.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/power/mt8186.c b/power/mt8186.c
index fcbe94dcee..a9f871d3d6 100644
--- a/power/mt8186.c
+++ b/power/mt8186.c
@@ -298,9 +298,14 @@ enum power_state power_chipset_init(void)
*/
battery_wait_for_stable();
- if (exit_hard_off)
- /* Auto-power on */
- mt8186_exit_off();
+ if (exit_hard_off) {
+ if (init_state == POWER_S5 || init_state == POWER_G3) {
+ /* Auto-power on */
+ mt8186_exit_off();
+ } else {
+ is_exiting_off = false;
+ }
+ }
if (init_state != POWER_G3 && !exit_hard_off)
/* Force shutdown from S5 if the PMIC is already up. */