power: qpnp-bms: detect warm resets

During warm PMIC resets, the BMS will not take a new OCV. This may
cause the SOC upon reboot to be completely wrong if no recent OCVs
have been taken.

Fix this by checking for invalid OCVs and warm resets. If either
occur, estimate a new OCV based on vbat and use that instead.

Change-Id: I2e72cfc3dfc99bac7d440da403cf64847795992e
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed