Commit 0dc38118 authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Abhijeet Dharmapurikar
Browse files

power: pm8921-bms: Prevent SoC from rising during discharge



In a previous patch, scale_soc_while_chg was made to not be called when
catch_up_sec equals zero to prevent a kernel divide by zero bug.

However, this caused SoC to increase at times with multiple calls to
calculate_state_of_charge in quick succession.

Fix this by always calling scale_soc_while_chg and skip calculations only
when catch_up_sec is equal to zero.

Change-Id: Ic8c459aea41fde7f7b8762c51c3da71274bed16e
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent d0302d55
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment