summaryrefslogtreecommitdiff
path: root/util/export_taskinfo.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2017-11-16 22:27:07 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-11-20 12:21:15 -0800
commitd90300b6e57a8908f304c28a79991ad6ed35e9da (patch)
tree07598e9eb24355825ce5f4fc3ca63917989e14ed /util/export_taskinfo.c
parent4cb524de67477df6a1a55daaf7ffbf3c60276242 (diff)
downloadchrome-ec-d90300b6e57a8908f304c28a79991ad6ed35e9da.tar.gz
poppy/soraka: Fix battery_is_present detection
It was recently identified that when we do a software based battery cutoff and leave the system in cutoff state for > 25-30 seconds, then both FG and battery enter shutdown/ship mode. In order to get the battery out of this state, charger needs to provide VBAT > Vstartup. However, with the current implementation of battery_is_present, if EC is unable to talk to the battery i.e. i2c commands to read battery status fails, then battery_is_present returns BP_NO indicating that the battery is not present. This results in charger state machine setting 0V and 0A to the battery, thus causing the BGATE to be switched off. In order to wake the battery from such condition, it is necessary to provide pre-charge current and minimum voltage to ensure that BGATE is switched on and VBAT > Vstartup is provided. This change updates the battery_is_present algorithm to: 1. Check if battery is physically present. If not, return BP_NO. 2. If battery is present now and was present before when we checked, then return BP_YES. 3. If battery just changed status to BP_YES, then check its disconnect status. If EC is unable to read disconnect status, then return BP_NOT_SURE. This allows the charger state machine to provide precharge current and minimum voltage. 4. If EC is able to read disconnect status, try reviving it if necessary. 5. Return BP_NO if battery is still disconnected or is cutoff or not initialized. 6. Else return BP_YES. BUG=b:69329874 BRANCH=None TEST=Factory verified following: 1. Recovery from software based cutoff : Pass 10/10 2. Recovery from hardware based cutoff : Pass 10/10 3. Recovery from hibernate : Pass 10/10 4. Recovery from critical battery condition : Pass 10/10 5. Boot-up in case of no battery : Pass 10/10 Change-Id: I248705f87469a8d6604da1b1919492766499dd73 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/776024 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'util/export_taskinfo.c')
0 files changed, 0 insertions, 0 deletions