diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2014-12-16 09:54:54 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-17 18:07:10 +0000 |
commit | a7bae3588cb976405b90677a324de06c71fa3f48 (patch) | |
tree | f758c61f021485acee7ee82e4ebfa51f3b0300a9 /common/power_button_x86.c | |
parent | 6c980a4dbf2e37b83e868c0eb12774190ea8c94d (diff) | |
download | chrome-ec-a7bae3588cb976405b90677a324de06c71fa3f48.tar.gz |
power_button_x86: Inhibit AP power-on if battery level is too low
Allow CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON to be defined at the board
level to be the minimum battery percentage required for power-on. If the
battery level is below the threshold, or if the battery is missing,
power button presses will be ignored.
BUG=chrome-os-partner:31127
TEST=Manual on Samus with subsequent commit. Verify that AP continues
to boot normally when charge level exceeds
CONFIG_CHARGER_MIN_BAT_PCT_FOR_POWER_ON. Verify that power button
presses are ignored when the charge level is below the threshold, and
we return to G3.
BRANCH=Samus
Change-Id: I0ff3f7ddabf38080332470e172c8b2e307bf1655
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/236021
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'common/power_button_x86.c')
-rw-r--r-- | common/power_button_x86.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c index 8b221b8e30..9570d9c3b3 100644 --- a/common/power_button_x86.c +++ b/common/power_button_x86.c @@ -116,10 +116,12 @@ static void set_pwrbtn_to_pch(int high) { /* * If the battery is discharging and low enough we'd shut down the - * system, don't press the power button. + * system, don't press the power button. Also, don't press the + * power button if the battery is charging but the battery level + * is too low. */ #ifdef CONFIG_CHARGER - if (!high && charge_want_shutdown()) { + if (!high && (charge_want_shutdown() || charge_prevent_power_on())) { CPRINTS("PB PCH pwrbtn ignored due to battery level"); high = 1; } |