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

Commit b6091b34 authored by Subbaraman Narayanamurthy's avatar Subbaraman Narayanamurthy
Browse files

power: qpnp-fg-gen4: Fix debug battery id reporting



Currently, for getting debug battery id thresholds, only lower
threshold register is read twice. Fix this by reading higher
threshold register.

Change-Id: I9dee9f79bd0ccd1f73694e30e399f757815e139f
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent 5485c33a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -446,7 +446,7 @@ static int fg_gen4_get_debug_batt_id(struct fg_dev *fg, int *batt_id)

	batt_id[0] = (30000 * tmp) / (MAX_BIAS_CODE - tmp);

	rc = fg_read(fg, ADC_RR_FAKE_BATT_LOW_LSB(fg), (u8 *)&tmp, 2);
	rc = fg_read(fg, ADC_RR_FAKE_BATT_HIGH_LSB(fg), (u8 *)&tmp, 2);
	if (rc < 0) {
		pr_err("failed to read addr=0x%04x, rc=%d\n",
			ADC_RR_FAKE_BATT_HIGH_LSB(fg), rc);