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

Commit 1174ee1f authored by Abhijeet Dharmapurikar's avatar Abhijeet Dharmapurikar
Browse files

power: qpnp-smbcharger: fix the argument order while using is_between()



The is_between() function expects the value to be the third argument, the
first and the second arguments define the range.

Currently the value to be checked is passed as the first argument which
leads to selecting wrong voltage thresholds for Wipower dynamic
impedance limiting feature which in turn causes an ADC interrupt storm.

Fix this by passing arguments in the right order.

Change-Id: I525615ca2a2f4a4e3a0db15eb3e15ec965853552
Signed-off-by: default avatarAbhijeet Dharmapurikar <adharmap@codeaurora.org>
parent c84f1f0f
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1842,8 +1842,8 @@ static struct ilim_entry *smbchg_wipower_find_entry(struct smbchg_chip *chip,
	struct ilim_entry *ret = &(chip->wipower_default.entries[0]);

	for (i = 0; i < map->num; i++) {
		if (is_between(uv,
			map->entries[i].vmin_uv, map->entries[i].vmax_uv))
		if (is_between(map->entries[i].vmin_uv, map->entries[i].vmax_uv,
			uv))
			ret = &map->entries[i];
	}
	return ret;