power: qpnp-bms: Allow SOC Storage register to be configured
Currently the BMS driver stores the shutdown state of charge (SoC) in
BMS data register 0 (0x40B0). This register is DVDD backed, which is
reset upon battery removal.
However in some cases, the BMS driver needs to be able to keep the
shutdown SoC data through a battery replacement that resets the DVDD
backed registers. In these cases, a spare XVDD coincell backed
register should be used.
Add the capability to configure the BMS driver to use different
registers via the device tree. If a node is provided with a custom
SOC storage register address, that register will used instead of the
BMS data register 0.
Additionally, change how shutdown SoC is stored so that both 0x00
and 0xFF register reset states are considered invalid SoCs to
accomodate this change.
Change-Id: I3b11db734227c50c71bcfc824d6d26670e99d23f
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment