use the battery voltage of fuel guage in charging logic.

use the battery voltage estimated by the fuel gauge in charging logic,
not the adc value of the charge pump.

Change-Id: Ia001e41dc909ce3ec57ddbcfe888a7b566ad358a
Reviewed-on: https://gerrit.mot.com/2599627
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Wentao Xu <xuwt2@motorola.com>
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2023-05-08 16:10:41 +08:00 • committed by litong
commit aca130a133

View file

@ -1580,11 +1580,11 @@ static int sc760x_charger_config_charge(void *data, struct mmi_charger_cfg *conf
chg->chg_cfg.target_fv = config->target_fv;
}
if (chg->chg_cfg.target_fv > 0 && (state.vbat_adc > chg->chg_cfg.target_fv * 1000)) {
if (chg->chg_cfg.target_fv > 0 && (chg->batt_info.batt_mv > chg->chg_cfg.target_fv)) {
sc760x_ibat_limit_set -= IBAT_CHG_LIM_BASE;
sc760x_set_ibat_limit(chg->sc, sc760x_ibat_limit_set);
pr_info("update new sc760x_ibat_limit_set %d, state.vbat_adc %d > chg->chg_cfg.target_fv %d\n",
sc760x_ibat_limit_set, state.vbat_adc, chg->chg_cfg.target_fv * 1000);
pr_info("update new sc760x_ibat_limit_set %d, state.vbat_adc %d, batt_mv %d > chg->chg_cfg.target_fv %d\n",
sc760x_ibat_limit_set, state.vbat_adc / 1000, chg->batt_info.batt_mv, chg->chg_cfg.target_fv);
} else {
ibat_limit_vote = MIN_VAL(chg->chg_cfg.target_fcc, chg->sc->thermal_fcc_ua / 1000);