Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99041e20 authored by Umang Agrawal's avatar Umang Agrawal Committed by Guru Das Srinagesh
Browse files

power: smb1390-psy: Fix taper charge handling



Currently, if taper charging is initiated prior to reduction in float
voltage by external control parameters like JEITA, QNOVO, etc., then
secondary charger termination will happen due to reduction in float
voltage but won't get captured in the SW flow as because the taper-entry
float voltage in only captured during the initiation of taper routine.

Fix this by updating the taper condition float voltage on every iteration
of the taper routine.

Change-Id: Ic437175e150ac18edde30d00afc4146f7516e547
Signed-off-by: default avatarUmang Agrawal <uagrawal@codeaurora.org>
parent fb0db790
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -635,6 +635,15 @@ static void smb1390_taper_work(struct work_struct *work)
			goto out;
		}

		if (get_effective_result(chip->fv_votable) >
						chip->taper_entry_fv) {
			pr_debug("Float voltage increased. Exiting taper\n");
			goto out;
		} else {
			chip->taper_entry_fv =
					get_effective_result(chip->fv_votable);
		}

		if (pval.intval == POWER_SUPPLY_CHARGE_TYPE_TAPER) {
			fcc_uA = get_effective_result(chip->fcc_votable)
								- 100000;
@@ -646,10 +655,6 @@ static void smb1390_taper_work(struct work_struct *work)
								true, 0);
				goto out;
			}
		} else if (get_effective_result(chip->fv_votable) >
						chip->taper_entry_fv) {
			pr_debug("Float voltage increased. Exiting taper\n");
			goto out;
		} else {
			pr_debug("In fast charging. Wait for next taper\n");
		}