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

Commit 760c7eda authored by Xiaozhe Shi's avatar Xiaozhe Shi
Browse files

power: qpnp-fg: turn on current termination qualification



Sometimes when the batfet is open, a negative current could be read.
This can mess up fuel gauge based charge termination. Turn on the
current termination qualification bit to zero out the negative currents.

Change-Id: I3f3244d0ab634a822758efe6c6845c4d4ab11f0f
Signed-off-by: default avatarXiaozhe Shi <xiaozhes@codeaurora.org>
parent 9dcf8291
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2576,6 +2576,7 @@ static int soc_to_setpoint(int soc)
#define DELTA_SOC_PERCENT	1
#define THERMAL_COEFF_ADDR	0x444
#define THERMAL_COEFF_OFFSET	0x2
#define I_TERM_QUAL_BIT		BIT(1)
static int fg_hw_init(struct fg_chip *chip)
{
	u8 resume_soc;
@@ -2627,6 +2628,9 @@ static int fg_hw_init(struct fg_chip *chip)
			THERMAL_COEFF_OFFSET, 0);
	}

	fg_mem_masked_write(chip, FG_ALG_SYSCTL_1, I_TERM_QUAL_BIT,
			I_TERM_QUAL_BIT, 0);

	return 0;
}