power: pm8921-bms: fix SOC jumps while entering suspend/resume
The last_soc is being set to -EINVAL when entering suspend. This causes SOC to jump while coming out of resume. Instead remember If we are reporting for the first time after suspend. The calculated_soc at the time we went to suspend. Soc should not increase because we cannot suspend while charging. If the calculated_soc has increased continue reporting the lower last_soc. If the calculated soc has dropped check if it has dropped since suspend. If so decrease the reported soc by the amount it dropped since suspend. If the calculated soc has dropped but it has increased since suspend continue to report the last_soc. Change-Id: I9040feceaa3e829d11bec0b21e61951f2ed1180b Signed-off-by:Abhijeet Dharmapurikar <adharmap@codeaurora.org> Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment