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

Commit 540de540 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb1355: Lower P2F charge threshold to 2.6V



Currently, SMB1355's pre-to-fast charge threshold is 3.6V. Set 2.6V
before enabling parallel charging, to allow parallel charging
to be enabled when VBAT < 3.6V.

CRs-Fixed: 2127501
Change-Id: I308c6fffbf50e5219128ea0bc47eb77f57f73e46
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 3fafba6f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@
#define CHGR_BATTOV_CFG_REG			(CHGR_BASE + 0x70)
#define BATTOV_SETTING_MASK			GENMASK(7, 0)

#define CHGR_PRE_TO_FAST_THRESHOLD_CFG_REG	(CHGR_BASE + 0x74)
#define PRE_TO_FAST_CHARGE_THRESHOLD_MASK	GENMASK(2, 0)

#define POWER_MODE_HICCUP_CFG			(BATIF_BASE + 0x72)
#define MAX_HICCUP_DUETO_BATDIS_MASK		GENMASK(5, 2)
#define HICCUP_TIMEOUT_CFG_MASK			GENMASK(1, 0)
@@ -619,6 +622,15 @@ static int smb1355_init_hw(struct smb1355 *chip)
		return rc;
	}

	/* set Pre-to-Fast Charging Threshold 2.6V */
	rc = smb1355_masked_write(chip, CHGR_PRE_TO_FAST_THRESHOLD_CFG_REG,
				 PRE_TO_FAST_CHARGE_THRESHOLD_MASK, 0);
	if (rc < 0) {
		pr_err("Couldn't set PRE_TO_FAST_CHARGE_THRESHOLD rc=%d\n",
			rc);
		return rc;
	}

	return 0;
}