Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b544f57a authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar Committed by Stephen Boyd
Browse files

power: pm8921-bms: use background work to calculate soc



The soc (state of charge) calculation algorithms and the associated
adjusting algorithms were coded assuming that the soc will be queried
at distant intervals (more than 20 seconds).

However this assumption is bad and soc can be queried at sub second
intervals. These soc queries in quick succession causes the adjusting
algorithm to over correct the battery voltage.

Separate the soc calculation from the soc reporting - calculate soc
at specific intervals, while the reporting uses the values resulting
from the latest calculation. This way the adjusting algorithms run
at specified intervals and are not perturbed by the sub second querying
for soc.

Change-Id: I240bfdbd3ae3b2e37ae16cc3757a25f5a918e972
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent 455be960
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment