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

Commit b4587465 authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: smb1360: Fix the delta_soc calculation



The delta_soc events fires when the actual SOC goes
higher than the configured delta-threshold. Fix the
register value calculation accordingly.

Change-Id: Ieeff7080152da2a533347824173325b4e4394332
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 808ccbb5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3032,7 +3032,7 @@ disable_fg_reset:
	 */
	if (!(chip->workaround_flags & WRKRND_FG_CONFIG_FAIL)) {
		if (chip->delta_soc != -EINVAL) {
			reg = DIV_ROUND_UP(chip->delta_soc * MAX_8_BITS, 100);
			reg = abs(((chip->delta_soc * MAX_8_BITS) / 100) - 1);
			pr_debug("delta_soc=%d reg=%x\n", chip->delta_soc, reg);
			rc = smb1360_write(chip, SOC_DELTA_REG, reg);
			if (rc) {