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

Skip to content
Commit ce1b18b0 authored by Anirudh Ghayal's avatar Anirudh Ghayal Committed by Stephen Boyd
Browse files

power: qpnp-bms: Add FCC learning support



Full charge capacity(FCC) of the battery changes as it ages.
Failing to update the FCC will lead to SOC errors. Add the
following changes to support FCC learning -

1. Add configurable parameters to
	- enable/disable fcc learning
	- minimum soc to start FCC learning
	- minimum ocv (pc) to start FCC learning
	- minimum cycles to update fcc vs temp. table

2. New FCC is calculated using the cc count-
	FCC_NEW = (cc_end - cc_start) / (soc2 - soc1)
	cc_end = CC count when charing ends
	cc_start = CC count when charging starts
	soc1, soc2 = starting and ending SOC_rbatt value

3. Use the BMS data registers (0xB4 to 0xBF) to backup
   the generated FCC, temperature, charge cycles and
   charge increase. These backed-up values are restored
   during boot.

While at it, add the logic to readjust the FCC after a
new FCC is generated.

Change-Id: I604e4031061af2b94a90e2a3a9bc7b0b4f0144f3
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 18f9ebba
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