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

Commit 89636500 authored by Nicholas Troast's avatar Nicholas Troast
Browse files

qcom-charger: qpnp-smb2: End charge cycle while battery is OV



Currently the charge cycle continues while the battery is OV. Configure
the charger to end the charge cycle while battery is OV.

Change-Id: I6fc333e15c5f0410c6b560b2a7005a1752f5f936
Signed-off-by: default avatarNicholas Troast <ntroast@codeaurora.org>
parent 7ebe256e
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -510,12 +510,16 @@ static int smb2_init_hw(struct smb2 *chip)
	vote(chg->dc_icl_votable,
		DEFAULT_VOTER, true, chip->dt.dc_icl_ua);

	/* configure charge enable for software control; active high */
	/*
	 * Configure charge enable for software control; active high, and end
	 * the charge cycle while the battery is OV.
	 */
	rc = smblib_masked_write(chg, CHGR_CFG2_REG,
				 CHG_EN_POLARITY_BIT | CHG_EN_SRC_BIT, 0);
				 CHG_EN_POLARITY_BIT |
				 CHG_EN_SRC_BIT |
				 BAT_OV_ECC_BIT, BAT_OV_ECC_BIT);
	if (rc < 0) {
		dev_err(chg->dev,
			"Couldn't configure charge enable source rc=%d\n", rc);
		dev_err(chg->dev, "Couldn't configure charger rc=%d\n", rc);
		return rc;
	}