aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorFrieder Schrempf <frieder.schrempf@kontron.de>2021-02-11 11:55:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-25 09:04:14 +0100
commitcfbff8bd9efcb8e2584c7082431723f4864b30dd (patch)
tree4aac2269fb8bd140da420e044f650bfc527d6935 /drivers
parent775691b94ce74e02297b9165c7df99c589374b2d (diff)
downloadkernel_replicant_linux-cfbff8bd9efcb8e2584c7082431723f4864b30dd.tar.gz
kernel_replicant_linux-cfbff8bd9efcb8e2584c7082431723f4864b30dd.tar.bz2
kernel_replicant_linux-cfbff8bd9efcb8e2584c7082431723f4864b30dd.zip
regulator: pca9450: Enable system reset on WDOG_B assertion
[ Upstream commit f7684f5a048febd2a7bc98ee81d6dce52f7268b8 ] By default the PCA9450 doesn't handle the assertion of the WDOG_B signal, but this is required to guarantee that things like software resets triggered by the watchdog work reliably. As we don't want to rely on the bootloader to enable this, we tell the PMIC to issue a cold reset in case the WDOG_B signal is asserted (WDOG_B_CFG = 10), just as the NXP U-Boot code does. Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de> Link: https://lore.kernel.org/r/20210211105534.38972-3-frieder.schrempf@kontron.de Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/regulator/pca9450-regulator.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index 1bba8fdcb7b7..833d398c6aa2 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -797,6 +797,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
return ret;
}
+ /* Set reset behavior on assertion of WDOG_B signal */
+ ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL,
+ WDOG_B_CFG_MASK, WDOG_B_CFG_COLD_LDO12);
+ if (ret) {
+ dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n");
+ return ret;
+ }
+
/*
* The driver uses the LDO5CTRL_H register to control the LDO5 regulator.
* This is only valid if the SD_VSEL input of the PMIC is high. Let's