power: qpnp-bms: use IAVG for charging adjustments
When the BMS detects that the charger is in constant voltage (CV)
charging, it will start SoC based on average current. This can cause
issues however, if the charging current suddenly spikes low when the BMS
is reading it from the IADC. There has been instances where current is
reduced by 100mA while charging without any drop in battery voltage when
SoC calculations are being done. When this happens, the charging
adjustment algorithm will make SoC jump high.
Fix this by using iavg, the average current over the last calculation
period calculated from the coulomb counter. This value is a much better
representation of the actual charging current and is less prone to
sudden drops.
Change-Id: I75adfffedfa19370e9c3e4355bd03fa1f59c4f50
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment