diff options
author | Kevin K Wong <kevin.k.wong@intel.com> | 2016-10-27 19:25:51 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2016-11-04 17:13:28 +0000 |
commit | 74517e4b11670ba2ea25751dc0a147f17a2e2d39 (patch) | |
tree | 200bc11e0c07d15eb5486a9df650b9007cbbd9d8 | |
parent | eb4e3c97221d4304a976a51a14a1a35aa18801aa (diff) | |
download | chrome-ec-74517e4b11670ba2ea25751dc0a147f17a2e2d39.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/408001
Commit-Queue: Mohammed Habibulla <moch@google.com>
Tested-by: Mohammed Habibulla <moch@google.com>
-rw-r--r-- | common/power_button_x86.c | 13 |
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); |