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

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

qpnp-fg-gen3: fix the error in showing battery temperature



Battery temperature can take negative values. FG driver reads it
as an unsigned value and hence the negative reading is treated as
a huge integer value. Fix it.

CRs-Fixed: 1081146
Change-Id: I63e8863efb91af891dbcbfc070dfdcd833ea3ad4
Signed-off-by: default avatarSubbaraman Narayanamurthy <subbaram@codeaurora.org>
parent a53c420c
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -504,8 +504,7 @@ static int fg_get_cc_soc_sw(struct fg_chip *chip, int *val)
#define BATT_TEMP_DENR		1
static int fg_get_battery_temp(struct fg_chip *chip, int *val)
{
	int rc = 0;
	u16 temp = 0;
	int rc = 0, temp;
	u8 buf[2];

	rc = fg_read(chip, BATT_INFO_BATT_TEMP_LSB(chip), buf, 2);