power: qpnp-bms: maintain a software coulomb counter

The ADC can introduce a lot of error when the temperature fluctuates.
The BMS's coulomb counter is fed from the IADC, and over time the
accumulated error can create large inaccuracies in the BMS.

Provide a software workaround by maintaining a software coulomb
counter that resets, error compensates, and accumulates the hardware
coulomb counter in the BMS driver.

CRs-Fixed: 477720
CRs-Fixed: 477717
CRs-Fixed: 433840
Change-Id: I303fc919b054e7917d9625c580297a4b305506f7
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>
1 file changed