diff options
author | Aseda Aboagye <aaboagye@google.com> | 2018-07-26 18:22:41 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-30 23:08:22 -0700 |
commit | 769c167ea5ea7bfd67d7629c795eca5e9f0bef85 (patch) | |
tree | b93a95c7a9c23e388a0b942d5d3fb3ba4bebfd93 /board/nocturne | |
parent | c23e697ae3989a8562e40b92e60ddb6cb27b05a9 (diff) | |
download | chrome-ec-769c167ea5ea7bfd67d7629c795eca5e9f0bef85.tar.gz |
nocturne: Tie batt disconnect state to DSG FET status.
battery_get_disconnect_state() and the way that it is used in the EC
code base essentially means "can the battery provide a charge?". This
can be tied to the battery's discharge FET status. If the discharge FET
is disabled, the battery cannot provide power to the system.
This commit changes the decision to report the battery as disconnected
to solely rely on the discharge FET status. Previously, we've seen
issues where the charge FET was enabled, but the discharge FET was
disabled due to a cell undervoltage issue. The EC would consider the
pack as not "disconnected". However, this would signal to the system
that the battery could provide charge, but in actuality it couldn't.
BUG=b:76121712
BRANCH=None
TEST=Flash nocturne; cutoff pack, apply AC, verify pack wakes up.
Change-Id: I394278828c1c96112579ac84544655c3a1818e3d
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1152553
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/nocturne')
-rw-r--r-- | board/nocturne/battery.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/board/nocturne/battery.c b/board/nocturne/battery.c index 3bfb6843aa..73feb6ecc3 100644 --- a/board/nocturne/battery.c +++ b/board/nocturne/battery.c @@ -62,20 +62,19 @@ enum battery_disconnect_state battery_get_disconnect_state(void) if (not_disconnected) return BATTERY_NOT_DISCONNECTED; - /* Check if battery charging + discharging is disabled. */ + /* Check if battery discharge FET is disabled. */ rv = sb_read_mfgacc(PARAM_OPERATION_STATUS, SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data)); if (rv) return BATTERY_DISCONNECT_ERROR; - if (~data[3] & (BATTERY_DISCHARGING_DISABLED | - BATTERY_CHARGING_DISABLED)) { + if (~data[3] & (BATTERY_DISCHARGING_DISABLED)) { not_disconnected = 1; return BATTERY_NOT_DISCONNECTED; } /* - * Battery is neither charging nor discharging. Verify that - * we didn't enter this state due to a safety fault. + * Battery discharge FET is disabled. Verify that we didn't enter this + * state due to a safety fault. */ rv = sb_read_mfgacc(PARAM_SAFETY_STATUS, SB_ALT_MANUFACTURER_ACCESS, data, sizeof(data)); |