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

Commit 2db62f71 authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-charger: save open circuit voltage upon battery insertion



The BMS driver relies on having accurate open circuit voltage (OCV)
readings to estimate the state of charge of a battery. Usually the
BMS hardware takes an OCV reading of the battery upon power-on
because the load on the battery is small so there is very little
voltage drop across the battery.

However when a battery is hotswapped, it is difficult to obtain an
accurate OCV reading. This is because the hardware does not take a
OCV when the battery is inserted in a hotswap.

Work around this issue by forcing the BATFET open when a battery is
removed, and only let it close once a new battery is inserted and
the driver has taken a voltage reading when the BATFET is open.
Report this value through the power supply framework.

Change-Id: I5ee87c795be7ff32e21598f1103a4237283c9dc8
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 11092acd
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