summaryrefslogtreecommitdiff
path: root/common/power_button_x86.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2017-05-24 08:49:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-06-28 21:50:51 -0700
commit3a4298ef4835b1f75046ede8cace149e05089d1a (patch)
tree24d4174c733236a43e0a7a3ee72b4bd09207ae74 /common/power_button_x86.c
parent9eca99983175784a0cc5e17a65e67498b9cfc8b1 (diff)
downloadchrome-ec-3a4298ef4835b1f75046ede8cace149e05089d1a.tar.gz
npcx: Make system stay off after clean shutdown
This patch sets/clears RESET_FLAG_AP_OFF on S5<->S3 transitions. It's set when the system gracefully shuts down and cleared when the system boots up. The result is EC tries to go back to the previous state upon AC plug-in on battery-less systems. This is required for digital signage and kiosk. This also reverts: CL 514209, 486946, and 486945. BUG=b:37536389 BRANCH=none TEST=Tested as follows: A. Boot to S0 A.1. Unplug AC while system is in S0 then plug in - PASS A.2. Unplug AC while system is in S3 then plug in - PASS A.3. Press recovery+power in S0 - PASS A.4. Press recovery+power in G3 - FAIL (To be fixed) A.5. Execute reboot console command - PASS A.6. Execute reboot OS command - PASS A.7. Execute reboot console command in G3 - PASS B. Boot to G3 B.1 Unplug AC while system is in G3 then plug in - PASS B.2 Unplug AC after B.1 then plug in - PASS B.3 Shutdown by power button on recovery screen then unplug plug in AC - PASS B.4 Execute reboot ap-off console command - PASS B.5 Execute shutdown command from OS then plug in AC - PASS Change-Id: Iaa6f930585050fdd3511c711b449dff47525066d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/517287 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'common/power_button_x86.c')
-rw-r--r--common/power_button_x86.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index e6bdde38bc..8cfb8e685b 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -231,12 +231,10 @@ static void set_initial_pwrbtn_state(void)
return;
}
+#ifdef CONFIG_BRINGUP
+ pwrbtn_state = PWRBTN_STATE_IDLE;
+#else
pwrbtn_state = PWRBTN_STATE_INIT_ON;
-
-#if defined(CONFIG_BRINGUP) || defined(CONFIG_POWER_BUTTON_INIT_IDLE)
- if (!power_button_is_pressed() &&
- !host_is_event_set(EC_HOST_EVENT_KEYBOARD_RECOVERY))
- pwrbtn_state = PWRBTN_STATE_IDLE;
#endif
CPRINTS("PB %s",
pwrbtn_state == PWRBTN_STATE_INIT_ON ? "init-on" : "idle");