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

Commit b5b58e6d authored by Guru Das Srinagesh's avatar Guru Das Srinagesh
Browse files

power: smb5: Turn off charging if wdog is not petted



In the event of a catastrophic software freeze, the watchdog does not
get petted when it barks. As per design, in such a scenario, it waits
for a pre-configured period of time and then bites, turning off battery
charging.

Currently, battery charging is not turned off. Enable turning off of
battery charging when the watchdog bites.

Change-Id: I26f76b2d82955bf36af7dabc1bc584432b4954fd
Signed-off-by: default avatarGuru Das Srinagesh <gurus@codeaurora.org>
parent 0a40fdf3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2444,7 +2444,7 @@ static int smb5_init_hw(struct smb5 *chip)

	val = (ilog2(chip->dt.wd_bark_time / 16) << BARK_WDOG_TIMEOUT_SHIFT)
			& BARK_WDOG_TIMEOUT_MASK;
	val |= BITE_WDOG_TIMEOUT_8S;
	val |= (BITE_WDOG_TIMEOUT_8S | BITE_WDOG_DISABLE_CHARGING_CFG_BIT);
	rc = smblib_masked_write(chg, SNARL_BARK_BITE_WD_CFG_REG,
			BITE_WDOG_DISABLE_CHARGING_CFG_BIT |
			BARK_WDOG_TIMEOUT_MASK | BITE_WDOG_TIMEOUT_MASK,