summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVic Yang <victoryang@chromium.org>2014-11-04 16:11:30 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-11 23:07:10 +0000
commit4af2679f664b01a456840997ca56e8d32bf009e3 (patch)
tree9ebd8658e9c7366ea5281181f86df48cc7b28fa8
parent72da63a5f378d56b00696872f3f28f40436f637e (diff)
downloadchrome-ec-4af2679f664b01a456840997ca56e8d32bf009e3.tar.gz
CHERRY-PICK: Do not try to wake the battery after battery cut-off
When the battery cut-off command is issued with external power present, the battery can end up in one of the following two states: 1. The battery stays responsive but is waiting for the external power to go away. 2. The battery decides to cut itself off right away. In case 1, we are already avoiding charging the battery again, so we're good. However, in case 2, the charge state machine mistakenly thinks the battery is dead and tries to revive it. Fix this by checking if the battery is cut off before starting to revive it. BRANCH=None BUG=chrome-os-partner:33372 TEST=Cut off the battery with external power connected. Wait for a while and then disconnect external power. Check the battery is sure cut off. Repeat for several times. Change-Id: I9d0194446a87a47ef5c0024607a267aee3566268 Original-Change-Id: Icf343b168a556a490bc1786802a8a6e230863a28 Signed-off-by: Vic Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/227521 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/229161 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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/charge_state_v2.c b/common/charge_state_v2.c
index a5d421c45b..b0e604a1b5 100644
--- a/common/charge_state_v2.c
+++ b/common/charge_state_v2.c
@@ -586,7 +586,7 @@ void charger_task(void)
/* If the battery is not responsive, try to wake it up. */
if (!(curr.batt.flags & BATT_FLAG_RESPONSIVE)) {
- if (battery_seems_to_be_dead) {
+ if (battery_seems_to_be_dead || battery_is_cut_off()) {
/* It's dead, do nothing */
curr.state = ST_IDLE;
curr.requested_voltage = 0;