power: pm8921-charger: adjust vdd max earlier

The charger hardware decides Constant Current VS Constant Voltage based
on the VPH_PWR voltage and not on battery voltage (vbatt) as it should.

The problem is, becuase of IR drop between VPH_PWR and VBATT,  VPH_PWR
reaches the voltage programmed in vdd_max earlier while the VBATT stays
lower causing the charger hardware switch to constant voltage mode
prematurely.

To fix this issue adjust the vdd_max early.

Change-Id: I07638e127e17da9feeb96f316329b8334e7ea031
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
1 file changed