power: qpnp-bms: add core bms algorithm

Add most of the core bms algorithm from the pm8921 driver into
qpnp-bms. report_state_of_charge should now report a rudimentary unadjusted
state of charge.

Unimplemented things in the current patch includes adc calibration,
adjusting SoC for the high and low ends of the battery curve, adjusting SoC
for charging and discharging.

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