power: qpnp-charger: Introduce vddmax adjustments

The charger peripheral's vdd regulation loop attempts to keep the
battery terminal voltage constant during the constant voltage
charging phase (CV charging). However, the analog regulation circuits
has a 30 millivolt accuracy rating. This can lead to over or under
charging of the battery.

Fix this by adjusting the vddmax based on VADC reads of the vbat_sns
line. Keep the vddmax within 5 millivolts of the set max voltage.

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