diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2015-10-01 15:51:58 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-02 17:49:16 -0700 |
commit | 939d07fc4e5e7eee8e493c5edbae6053ee05668e (patch) | |
tree | c1eae3ad8c6c039cbbf9893e10ca6647f998bf55 /common | |
parent | 229094b2455e093c95d07251a0021f3b637e813c (diff) | |
download | chrome-ec-939d07fc4e5e7eee8e493c5edbae6053ee05668e.tar.gz |
charge_state_v2: add option to cut-off battery when level is critical
Add a build option CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF to perform a
battery cut-off when we reach the battery critical low level.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=smaug
BUG=none
TEST=Discharge a Ryu device down to the critical level, see the message
and verify we cannot restart with the power button. Also check that
plugging the charger revives the device and starts charging.
Change-Id: Ic132a658de5c5131a6a1dd1ce343196b68d480f6
Reviewed-on: https://chromium-review.googlesource.com/303549
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 80b3c99319771312d5733b126b6b3eb839addde9)
Reviewed-on: https://chromium-review.googlesource.com/303812
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/charge_state_v2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 0ca0974739..630ee06d74 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -499,6 +499,10 @@ static void shutdown_on_critical_battery(void) CPRINTS( "charge force EC hibernate due to critical battery"); system_hibernate(0, 0); +#elif defined(CONFIG_BATTERY_CRITICAL_SHUTDOWN_CUT_OFF) + CPRINTS( + "charge force battery cut-off due to critical level"); + board_cut_off_battery(); #endif } else { /* Timeout waiting for AP to shut down, so kill it */ |