From d8037661fe704ae0b7d4b0f6175f4d8a42eeec0c Mon Sep 17 00:00:00 2001 From: Lei Chen Date: Wed, 14 Jun 2023 17:25:18 +0800 Subject: [PATCH] mmi_charger:init thermal parameter at high temp PD charger hard reset as the thermal request current is 0. Init the thermal parameter at the highest thermal level. Pick from https://gerrit.mot.com/#/c/2006952/ Change-Id: If07718fa3d7f8e51ce8df7ad05ff740519c4aab3 Signed-off-by: Lei Chen Reviewed-on: https://gerrit.mot.com/2643326 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Huosheng Liao Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key Reviewed-by: Wei Xu --- .../mmi_parallel_charger_iio/mmi_charger_pump_policy.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/power/mmi_parallel_charger_iio/mmi_charger_pump_policy.c b/drivers/power/mmi_parallel_charger_iio/mmi_charger_pump_policy.c index 5ccf71affcc7..a8608415c853 100644 --- a/drivers/power/mmi_parallel_charger_iio/mmi_charger_pump_policy.c +++ b/drivers/power/mmi_parallel_charger_iio/mmi_charger_pump_policy.c @@ -1289,6 +1289,14 @@ schedule: mmi_chrg_info(chip, "Thermal is the highest, level %d, " "Force enter into single pmic charging !\n", chip->system_thermal_level); + if(chip->pd_sys_therm_volt == 0) + chip->pd_sys_therm_volt = SWITCH_CHARGER_PPS_VOLT; + if(chip->pd_sys_therm_curr == 0) + chip->pd_sys_therm_curr = TYPEC_HIGH_CURRENT_UA; + if(chip->pd_batt_therm_volt == 0) + chip->pd_batt_therm_volt = SWITCH_CHARGER_PPS_VOLT; + if(chip->pd_batt_therm_curr == 0) + chip->pd_batt_therm_curr = TYPEC_HIGH_CURRENT_UA; } else if (chip->system_thermal_level > 0 && (sm_state == PM_STATE_CP_CC_LOOP ||