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

Commit fbd678ad authored by Anirudh Ghayal's avatar Anirudh Ghayal
Browse files

power: smb1355-charger: Update the WD BITE timeout to 8secs



The default timeout of 1sec may not be enough time for SW
to PET the watchdog (after a bark). Update this to 8secs.

Change-Id: I65882067783100e7b9ecdc1e697b93948945b4eb
Signed-off-by: default avatarAnirudh Ghayal <aghayal@codeaurora.org>
parent 01852b94
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -1197,6 +1197,16 @@ static int smb1355_init_hw(struct smb1355 *chip)
		return rc;
	}

	/* disable charging when watchdog bites & set bite-timeout to 8secs */
	val = BITE_WDOG_DISABLE_CHARGING_CFG_BIT | 0x3;
	rc = smb1355_masked_write(chip, SNARL_BARK_BITE_WD_CFG_REG,
				BITE_WDOG_DISABLE_CHARGING_CFG_BIT |
				BITE_WDOG_TIMEOUT_MASK, val);
	if (rc < 0) {
		pr_err("Couldn't configure the watchdog bite rc=%d\n", rc);
		return rc;
	}

	/* enable watchdog bark and bite interrupts, and disable the watchdog */
	rc = smb1355_masked_write(chip, WD_CFG_REG, WDOG_TIMER_EN_BIT
			| WDOG_TIMER_EN_ON_PLUGIN_BIT | BITE_WDOG_INT_EN_BIT
@@ -1207,15 +1217,6 @@ static int smb1355_init_hw(struct smb1355 *chip)
		return rc;
	}

	/* disable charging when watchdog bites */
	rc = smb1355_masked_write(chip, SNARL_BARK_BITE_WD_CFG_REG,
				 BITE_WDOG_DISABLE_CHARGING_CFG_BIT,
				 BITE_WDOG_DISABLE_CHARGING_CFG_BIT);
	if (rc < 0) {
		pr_err("Couldn't configure the watchdog bite rc=%d\n", rc);
		return rc;
	}

	/*
	 * Disable command based SMB1355 enablement and disable parallel
	 * charging path by switching to command based mode.