power: qpnp-bms: fake a more accurate OCV at end of charge

When the bms is notified of end of charge, it fakes a high OCV in order
to report 100%. The high OCV used is the max voltage design for the
battery. However, that is not what should be used as the high OCV, since
the max voltage design corresponds to an over charged battery if used as
an OCV.

This can cause an issue with the correcting algorithm. When the BMS
driver finds that it needs to correct SOC downwards, it must do so by
lowering the OCV to correspond with a lower remaining charge. However,
since the battery profile does not start at max voltage design for 100%,
the BMS driver must correct about 25-30mV before it even starts
affecting SoC. This can create issues with meeting the cutoff voltage at
low SoCs.

Instead, look up the OCV for 100% charge and use that for the faked OCV.

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