power: qpnp-bms: fix batterydata reverse interpolation
The BMS driver needs to look up open circuit voltages for a given
SoC. However, the current algorithm is a bit flawed. If the battery
profile is not monotonic, there is a risk of going to an infinite
loop.
Fix this by modifying the reverse lookup loop to be bounded, and to
modify the step size so that the OCV will converge instead of
oscillating.
Change-Id: I25ba92de9796c4b89b476a0eff39a542407205f0
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>
Loading
Please register or sign in to comment