diff options
author | Vic Yang <victoryang@chromium.org> | 2014-10-08 08:57:24 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-10 18:48:25 +0000 |
commit | 70b657b81646728d5204ad3ac044697b6571a603 (patch) | |
tree | 31c3defb6e216613641e807c0655eb71373f0318 | |
parent | 430eea334a2ad2050ebfd3348f91d760b171a6b3 (diff) | |
download | chrome-ec-70b657b81646728d5204ad3ac044697b6571a603.tar.gz |
CHERRY-PICK: Don't hibernate on low battery if hiberante is not supported
If CONFIG_HIBERNATE is explicitly undefined for a board, the EC
shouldn't hibernate when the battery is running low. Otherwise, the EC
reboots because of the lack of hibernate support, and this actually
burns more power.
BUG=chrome-os-partner:32727, chrome-os-partner:32779
TEST=Drain the battery to 2% and verify the EC is behaving.
BRANCH=None
Change-Id: Ia614590a30bf27bf1a57870ffb430b909bd75ee8
Original-Change-Id: I2f9f5fd8fb4b5be4d8da113da4ef26c062869a07
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/222615
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/222859
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
Commit-Queue: Mohammed Habibulla <moch@chromium.org>
Tested-by: Mohammed Habibulla <moch@chromium.org>
-rw-r--r-- | common/charge_state_v2.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c index 2c17a838bf..a5d421c45b 100644 --- a/common/charge_state_v2.c +++ b/common/charge_state_v2.c @@ -418,9 +418,11 @@ static void prevent_deep_discharge(void) return; if (chipset_in_state(CHIPSET_STATE_ANY_OFF)) { +#ifdef CONFIG_HIBERNATE /* AP is off, so shut down the EC now */ CPRINTS("charge force EC hibernate due to low battery"); system_hibernate(0, 0); +#endif } else if (!shutdown_warning_time.val) { /* Warn AP battery level is so low we'll shut down */ CPRINTS("charge warn shutdown due to low battery"); |