charger:optimize the qc3p request voltage

The qc3p request voltage is too high while the vbat
is float. Optimize the qc3p request voltage when
charger pump entry.

Change-Id: I206e23f6f21519cf59725ce5d0874e11582325c9
Signed-off-by: Lei Chen <chenlei18@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2603252
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Lei Chen <chenl18@motorola.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Lei Chen 2023-05-10 18:36:32 +08:00 • committed by Lei Chen
commit 2d22cb6ebb
2 changed files with 18 additions and 0 deletions

View file

@ -675,6 +675,15 @@ void mmi_chrg_sm_work_func(struct work_struct *work)
}
}
if (batt_soc >= 80) {
//Read the vbat aggin after the soc above 80%
msleep(20);
rc = power_supply_get_property(chrg_list->chrg_dev[CP_MASTER]->chrg_psy,
POWER_SUPPLY_PROP_VOLTAGE_NOW, &prop);
if (!rc)
vbatt_volt = prop.intval*1000;
}
/*Initial setup pps request power by the battery voltage*/
chip->pd_request_volt = (2 * vbatt_volt) % 20000;
chip->pd_request_volt = 2 * vbatt_volt - chip->pd_request_volt

View file

@ -603,6 +603,15 @@ void mmi_qc3p_chrg_sm_work_func(struct work_struct *work)
chrg_list->chrg_dev[PMIC_SW]->charger_limited = true;
}
if (batt_soc >= 80) {
//Read the vbat aggin after the soc above 80%
msleep(20);
rc = power_supply_get_property(chrg_list->chrg_dev[CP_MASTER]->chrg_psy,
POWER_SUPPLY_PROP_VOLTAGE_NOW, &prop);
if (!rc)
vbatt_volt = prop.intval*1000;
}
/*Initial setup qc3p request power by the battery voltage*/
chip->qc3p_request_volt = (2 * vbatt_volt) % 20000;
chip->qc3p_request_volt = 2 * vbatt_volt - chip->qc3p_request_volt