power: qpnp-bms: store an invalid SoC if below 5 degC
Previously, the BMS driver did not store a shutdown SoC when the battery
was below 5 degC. The reasoning was that if the battery was cold, most
of the SoC would be unusuable charge and this can rapidly change when
rebooting the device in different temperature conditions.
However, this creates a problem because the old SoC before the battery
enters the sub 5 degC range is still stored. Upon a reboot, this stale
SoC will be forced, which often causes errors. For example, if the
battery was full before getting cooled to -20 degC, the stored SoC will
be 100. Even when the battery is discharged to 0 and rebooted, the SoC
upon reboot will be 100%.
Fix this by storing an invalid SoC if the battery temperature is below
5 degC. This allows the device to acquire a new SoC upon rebooting based
on the PON OCV.
Change-Id: I330403c9bc8476ad068d54b95dbb333cb6472286
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment