From d69fdb2a675b781dd626fe1a93f88048957bf54a Mon Sep 17 00:00:00 2001 From: Kenny Kessler Date: Wed, 5 Jun 2019 14:20:55 -0500 Subject: [PATCH] power: qpnp-smbcharger-mmi: Also Add AICL Rerun to Dual Dual Battery slgorithm also needs the same AICL rerun. Otherwise the ICL can drop and stay too low to recharge. Change-Id: I97236a1342f24c46d14047dd0c1f6cdacd994ddb Signed-off-by: Kenny Kessler Reviewed-on: https://gerrit.mot.com/1366736 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Ryan Lattrel Reviewed-by: Kenneth Kessler Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 239d0ea5a06e..ef687960800a 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -1962,6 +1962,7 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg, struct mmi_sm_params *main_p = &chg->sm_param[MAIN_BATT]; struct mmi_sm_params *flip_p = &chg->sm_param[FLIP_BATT]; static int demo_full_soc = 100; + bool is_chg_dis = get_effective_result(chg->chg_dis_votable); chg_stat_main.charger_present = stat->charger_present; chg_stat_flip.charger_present = stat->charger_present; @@ -2187,6 +2188,13 @@ vote_now: vote(chg->fcc_votable, MMI_HB_VOTER, true, (target_fcc >= 0) ? (target_fcc * 1000) : 0); + /* Rerun AICL to recover USB ICL from recharge */ + if (is_chg_dis != get_effective_result(chg->chg_dis_votable)) { + power_supply_set_property(chg->qcom_psy, + POWER_SUPPLY_PROP_RERUN_AICL, + NULL); + } + if (!stat->charger_present && (chg_stat_main.batt_mv <= LOW_BATT_MV) && (chg_stat_flip.batt_mv <= LOW_BATT_MV)) {