summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin K Wong <kevin.k.wong@intel.com>2016-10-27 19:25:51 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2016-11-04 17:11:17 +0000
commit070b7099b5a61207ec75ed830835433cf7a74f74 (patch)
tree983d1f996379a7fe2efa54d5b89e920b80187660
parent18615ede715fb1da6b3e82dd0f2dbb129b039ded (diff)
downloadchrome-ec-070b7099b5a61207ec75ed830835433cf7a74f74.tar.gz
power_button_x86: avoid chipset force shutdown from off state
This is to avoid system from shutting down asynchronously if the power button is pressed and held for more than 4 seconds since x86 chipset will force itself to shutdown based on its own hardware timer on 4 seconds timeout. The current code has already accounted for the case when Refresh + Power Button is pressed and held to not shutdown by not continue to pass through the power button signal after the 200ms pulse is sent. This change is follownig the same behavior. The lid open execution path from off state is also similar. BUG=chrome-os-partner:58513 BRANCH=firmware-terra-7287.154.B TEST=System does not shut itself off if the power button is pressed and held from S5. The power button is behaving as expected in S0 or S3. Change-Id: I52536749ad6f4d1a3fcf6ba4c5b3bb6f953da6a5 Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com> Reviewed-on: https://chromium-review.googlesource.com/404711 Reviewed-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: BoChao Jhan <james_chao@asus.com> Commit-Queue: BoChao Jhan <james_chao@asus.com> Tested-by: BoChao Jhan <james_chao@asus.com> (cherry picked from commit bce3965c51a928bc5264c341618285be649a7ddf) Reviewed-on: https://chromium-review.googlesource.com/407999 Commit-Queue: Mohammed Habibulla <moch@google.com> Tested-by: Mohammed Habibulla <moch@google.com>
-rw-r--r--common/power_button_x86.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index 9ae2be1ff5..830bf8ec99 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -336,11 +336,16 @@ static void state_machine(uint64_t tnow)
pwrbtn_state = PWRBTN_STATE_IDLE;
break;
case PWRBTN_STATE_WAS_OFF:
- /* Done stretching initial power button signal, so show the
- * true power button state to the PCH. */
+ /*
+ * Done stretching initial power button signal, so stop
+ * asserting PCH_PWRBTN_L to avoid chipset shut down if
+ * the physical power button continues to be held down
+ * for an extended period.
+ */
if (power_button_is_pressed()) {
- /* User is still holding the power button */
- pwrbtn_state = PWRBTN_STATE_HELD;
+ /* Ignore the power button hold until release */
+ set_pwrbtn_to_pch(1);
+ pwrbtn_state = PWRBTN_STATE_EAT_RELEASE;
} else {
/* Stop stretching the power button press */
power_button_released(tnow);