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

Commit 7bc98a1f authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: smb1360: Enable temperature and charger-error blinking



In the pulsed IRQ configuration, SMB1360 can generate
pulses on the SMB_INT pin to indicate error conditions such
as charger-timeouts/temperature faults. Enable this configuration.

Change-Id: I4cd17257652c6a3fb9520dea0293d2d05fff6923
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 135d6c3f
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@

#define CFG_STAT_CTRL_REG		0x09
#define CHG_STAT_IRQ_ONLY_BIT		BIT(4)
#define CHG_TEMP_CHG_ERR_BLINK_BIT	BIT(3)
#define CHG_STAT_ACTIVE_HIGH_BIT	BIT(1)
#define CHG_STAT_DISABLE_BIT		BIT(0)

@@ -2376,12 +2377,15 @@ static int smb1360_hw_init(struct smb1360_chip *chip)

	/* interrupt enabling - active low */
	if (chip->client->irq) {
		mask = CHG_STAT_IRQ_ONLY_BIT | CHG_STAT_ACTIVE_HIGH_BIT
						| CHG_STAT_DISABLE_BIT;
		mask = CHG_STAT_IRQ_ONLY_BIT
			| CHG_STAT_ACTIVE_HIGH_BIT
			| CHG_STAT_DISABLE_BIT
			| CHG_TEMP_CHG_ERR_BLINK_BIT;

		if (!chip->pulsed_irq)
			reg = CHG_STAT_IRQ_ONLY_BIT;
		else
			reg = 0;
			reg = CHG_TEMP_CHG_ERR_BLINK_BIT;
		rc = smb1360_masked_write(chip, CFG_STAT_CTRL_REG, mask, reg);
		if (rc < 0) {
			dev_err(chip->dev, "Couldn't set irq config rc = %d\n",