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

Commit 8269be0b authored by Xiaozhe Shi's avatar Xiaozhe Shi Committed by Gerrit - the friendly Code Review server
Browse files

power: qpnp-fg: fix constant fuel gauge restarts at boot



The fuel gauge driver is overwriting the battery profile's charge
termination and cc_to_cv set point during probe. The fuel gauge
driver checks whether the profile loaded in SRAM is the same as
the one that it loads from device tree in order to decide whether
a fuel gauge restart is needed.

With the current driver overwriting the charge termination and
CC to CV setpoint, the profile will always differ from the one
loaded from device tree. Thus, the driver will restart the
fuel gauge every single time it probes.

This can cause large fuel gauge accuracy drops at power-on because
instead of using the old converged SOC, it has to estimate a new one
based on voltage.

Fix this issue by only comparing the first 32 bytes of the battery
profile, which should be dynamically set, to determine whether a new
profile needs to be loaded.

CRs-Fixed: 821074
Change-Id: I809a70f4ef8411ebbab71539316f1e5a0c128f27
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent f8072e94
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