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

Commit 420fa83b authored by Nicholas Troast's avatar Nicholas Troast Committed by Harry Yang
Browse files

smb138x-charger: enable stacked diode



A part of the ADC circuit does not work as expected which causes die
temp inaccuracies. Enable the stacked diode circuit to bypass the
non-working circuit which fixes the die temp accuracy.

Change-Id: I2537ecd9190d3260396a847d3fd907634f874eb7
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent ec43bb42
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -39,6 +39,9 @@
#define DEAD_TIME_MASK			GENMASK(7, 4)
#define HIGH_DEAD_TIME_MASK		GENMASK(7, 4)

#define SMB2CHG_DC_TM_SREFGEN		(DCIN_BASE + 0xE2)
#define STACKED_DIODE_EN_BIT		BIT(2)

enum {
	OOB_COMP_WA_BIT = BIT(0),
};
@@ -1216,6 +1219,13 @@ static int smb138x_slave_probe(struct smb138x *chip)
		goto cleanup;
	}

	/* enable stacked diode */
	rc = smblib_write(chg, SMB2CHG_DC_TM_SREFGEN, STACKED_DIODE_EN_BIT);
	if (rc < 0) {
		pr_err("Couldn't enable stacked diode rc=%d\n", rc);
		return rc;
	}

	rc = smb138x_init_parallel_psy(chip);
	if (rc < 0) {
		pr_err("Couldn't initialize parallel psy rc=%d\n", rc);