From fbe4f1ca4632f79380233f2078db28f5feaf2a25 Mon Sep 17 00:00:00 2001 From: Bernie Moreno-BERNIEM Date: Thu, 23 Jul 2020 14:19:52 -0500 Subject: [PATCH] power: Charge curr over adjustment- check both batts Check for charge current over-adjust to the low side ignores the flip battery condition. So add a check that the flip is not in over current when deciding to bump the target charge_fcc to main target This affects mainly h/w test case where main batt thermistor is set to 25C but Flip batt thermistor is set to cold temp below 0C. NO_PROP_NEEDED: dual charge control affects both Smith and Olson This change applies to both products. Change-Id: I2db7c568852d698951efb3a45e99db17e9b62de3 Signed-off-by: Bernie Moreno-BERNIEM Reviewed-on: https://gerrit.mot.com/1704030 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Ling Jin Submit-Approved: Jira Key --- drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c index 963fefb9e7ec..0f3be50ae7d9 100644 --- a/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c +++ b/drivers/power/qpnp-smbcharger-mmi/qpnp-smbcharger-mmi.c @@ -2718,7 +2718,8 @@ static int mmi_dual_charge_control(struct smb_mmi_charger *chg, target_fcc = main_p->target_fcc + flip_p->target_fcc; target_fcc -= main_p->ocp[main_p->pres_temp_zone]; target_fcc -= flip_p->ocp[flip_p->pres_temp_zone]; - if (target_fcc < main_p->target_fcc) { + if ( (target_fcc < main_p->target_fcc) && + (chg_stat_flip.batt_ma < flip_p->target_fcc) ) { mmi_info(chg, "Target FCC adjust too much\n"); target_fcc = main_p->target_fcc; }