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

Commit 4d275514 authored by Harry Yang's avatar Harry Yang
Browse files

power: smb5: set fast charge safety timer to 768 mins



Currently, fast charge safety timer expires if fast charging mode lasts
longer than 384 mins. For this length of time, battery may not get fully
charged if connected to USB/PC.

Fix it by extending fast charge safety timer to 768 mins.

CRs-Fixed: 2296089
Change-Id: I5e6f1a4ecd9b9296a0d074245024393ed11fc93c
Signed-off-by: default avatarHarry Yang <harryy@codeaurora.org>
parent 47cb4b24
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1982,6 +1982,14 @@ static int smb5_init_hw(struct smb5 *chip)
		return rc;
	}

	rc = smblib_write(chg, CHGR_FAST_CHARGE_SAFETY_TIMER_CFG_REG,
					FAST_CHARGE_SAFETY_TIMER_768_MIN);
	if (rc < 0) {
		dev_err(chg->dev, "Couldn't set CHGR_FAST_CHARGE_SAFETY_TIMER_CFG_REG rc=%d\n",
			rc);
		return rc;
	}

	rc = smblib_masked_write(chg, CHGR_CFG2_REG, RECHG_MASK,
				(chip->dt.auto_recharge_vbat_mv != -EINVAL) ?
				VBAT_BASED_RECHG_BIT : 0);
+6 −0
Original line number Diff line number Diff line
@@ -108,6 +108,12 @@ enum {

#define CHGR_JEITA_THRESHOLD_BASE_REG(i)	(CHGR_BASE + 0x94 + (i * 4))

#define CHGR_FAST_CHARGE_SAFETY_TIMER_CFG_REG	(CHGR_BASE + 0xA2)
#define FAST_CHARGE_SAFETY_TIMER_192_MIN	0x0
#define FAST_CHARGE_SAFETY_TIMER_384_MIN	0x1
#define FAST_CHARGE_SAFETY_TIMER_768_MIN	0x2
#define FAST_CHARGE_SAFETY_TIMER_1536_MIN	0x3

#define CHGR_ENG_CHARGING_CFG_REG		(CHGR_BASE + 0xC0)
#define CHGR_ITERM_USE_ANALOG_BIT		BIT(3)