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

Commit db45050e authored by David Keitel's avatar David Keitel
Browse files

power: qpnp-fg: fix fg_is_batt_id_valid



fg_is_batt_id_valid is currently checking the incorrect
bit when verifiying if the battery has been identified.

Fix this by adding a definition for the BATT_IDED bit 3.

Change-Id: I52423ac2bcb3887344cba41cce6118c8ed96c812
Signed-off-by: default avatarDavid Keitel <dkeitel@codeaurora.org>
parent 4ce2448c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -824,6 +824,7 @@ static int64_t float_decode(u16 reg)
	return final_val;
}

#define BATT_IDED	BIT(3)
static int fg_is_batt_id_valid(struct fg_chip *chip)
{
	u8 fg_batt_sts;
@@ -840,7 +841,7 @@ static int fg_is_batt_id_valid(struct fg_chip *chip)
	if (fg_debug_mask & FG_IRQS)
		pr_info("fg batt sts 0x%x\n", fg_batt_sts);

	return (fg_batt_sts & BATT_IDENTIFIED) ? 1 : 0;
	return (fg_batt_sts & BATT_IDED) ? 1 : 0;
}

#define LSB_16B		153