power: qpnp-fg-gen3: Adjust recharge SOC after early termination

Currently, recharge SOC is adjusted based on the SOC at which
charge termination occurs. However, it gets reset back to the
original threshold only if input is removed. This does not work
well if charging resumes again once the battery is out of JEITA
as the recharge SOC threshold stays configured at a lower value.
Fix it by adjusting recharge SOC to the original threshold once
charging begins.

CRs-Fixed: 2163058
Change-Id: I07c714d32ba0005d3b0ff61142928eda58f049d0
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
Subbaraman Narayanamurthy 2017-12-21 17:39:07 -08:00
parent de111ce20e
commit 371c451d08

View file

@ -2093,8 +2093,12 @@ static int fg_adjust_recharge_soc(struct fg_chip *chip)
return 0; return 0;
} }
} else { } else {
/* Charging, do nothing */ if (!chip->recharge_soc_adjusted)
return 0; return 0;
/* Restore the default value */
new_recharge_soc = recharge_soc;
chip->recharge_soc_adjusted = false;
} }
} else { } else {
/* Restore the default value */ /* Restore the default value */