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

Commit 9f859f3c authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy Committed by Gerrit - the friendly Code Review server
Browse files

power: fg-alg: Use iterm_delta only during CC mode



Currently, iterm_delta is used in both CC/CV charging mode. To
reduce the error in calculations, use iterm_delta only during
CC mode and use the actual iterm alone in CV mode.

Change-Id: Ic9883e64a984881d82ab780c7501924292c36f0d
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent f0a7a7c1
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1172,7 +1172,11 @@ static int get_time_to_full_locked(struct ttf *ttf, int *val)
cv_estimate:
	pr_debug("TTF: t_predicted_cc=%d\n", t_predicted);

	if (charge_type == POWER_SUPPLY_CHARGE_TYPE_TAPER)
		iterm = max(100, abs(iterm));
	else
		iterm = max(100, abs(iterm) + ttf->iterm_delta);

	pr_debug("TTF: iterm=%d\n", iterm);

	if (charge_type == POWER_SUPPLY_CHARGE_TYPE_TAPER)