power: pm8921-bms: clamp charging soc
During constant voltage charging, the BMS reports a SoC calculated
by linearly interpolating battery current. However, sometimes the
charger does not immediately stop at -100 mA, and sometimes dips a bit
lower. This causes the BMS to report > 100% SoC and may cause a bad
user experience.
Fix this by clamping the linearly interpolated SoC to [0, 100].
CRs-Fixed: 430456
Change-Id: I3621a0a204360343ba684e2217a68a6ef51a7850
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed