summaryrefslogtreecommitdiff
path: root/common/power_button_x86.c
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-04-26 16:27:51 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-04-27 12:22:41 -0700
commit84e486e8e85c16be7acedb08311d1758f078da70 (patch)
tree5fa145c56fb965125164fe989ce135b9f17a0efb /common/power_button_x86.c
parent9dd10a768521918d96af8d831f7b840ae6cb68bb (diff)
downloadchrome-ec-84e486e8e85c16be7acedb08311d1758f078da70.tar.gz
power button: Ignore lid open in PWRBTN_STATE_INIT_ON
Normally on lid open, if chipset is off, we pulse the power button to wake the AP. If we are in PWRBTN_STATE_INIT_ON, then we are already waiting to power on the AP so ignore the lid open to avoid turning on the AP too soon. BUG=b:77455171 BRANCH=none TEST=Plug power into Grunt with no battery. Change-Id: Ie57e998725af0ace525f9f2102a0f5a282382a57 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1031565 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'common/power_button_x86.c')
-rw-r--r--common/power_button_x86.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index 4876ee12c4..5c9093095f 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -441,7 +441,8 @@ DECLARE_HOOK(HOOK_INIT, powerbtn_x86_init, HOOK_PRIO_DEFAULT);
static void powerbtn_x86_lid_change(void)
{
/* If chipset is off, pulse the power button on lid open to wake it. */
- if (lid_is_open() && chipset_in_state(CHIPSET_STATE_ANY_OFF))
+ if (lid_is_open() && chipset_in_state(CHIPSET_STATE_ANY_OFF)
+ && pwrbtn_state != PWRBTN_STATE_INIT_ON)
power_button_pch_pulse();
}
DECLARE_HOOK(HOOK_LID_CHANGE, powerbtn_x86_lid_change, HOOK_PRIO_DEFAULT);