power: qpnp-bms: Prevent SOC jumps while charging
The BMS driver scales the SOC while charging based on the charge
current. It does not scale when it sees that the battery voltage at
terminals have fallen 10mV below the max current, the reason being a
current spike that causes the voltage to droop.
However there is a corner case when the voltage could droop but not by
10mV. In this case the BMS will report a higher SOC value, since the
charge current most likely has reduced. This is incorrect.
Fix this behavior by showing the previous SOC value under severe system
load while charging. Note that when the vdd max adjusting algorithm in
charger reduces the vdd max value, the battery terminal voltage reduces
causing this scheme to treat it as a current spike. This is fine as it
will scale SOC correctly the next time it does a calculation.
Change-Id: I7b7e2c07a1acee7a4af0309ebd5d7968cbf5a774
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment