summary refs log tree commit diff
path: root/drivers/regulator/pca9450-regulator.c
diff options
context:
space:
mode:
authorRickard x Andersson <rickaran@axis.com>2022-04-29 09:22:10 +0200
committerMark Brown <broonie@kernel.org>2022-05-03 13:47:43 +0100
commit2364a64d0673f5044e6a52cb17d6d60c6f1f8329 (patch)
treefcf53adad29c544399eb407a9d0584a76a89797e /drivers/regulator/pca9450-regulator.c
parentbd2f5e71454bc84427c4fd67c5ea4881f155ac6e (diff)
downloadlinux-2364a64d0673f5044e6a52cb17d6d60c6f1f8329.tar.gz
regulator: pca9450: Make warm reset on WDOG_B assertion
The default configuration of the PMIC behavior makes the PMIC
power cycle most regulators on WDOG_B assertion. This power
cycling causes the memory contents of OCRAM to be lost.
Some systems neeeds some memory that survives reset and
reboot, therefore this patch is created.

Signed-off-by: Rickard x Andersson <rickaran@axis.com>
Link: https://lore.kernel.org/r/20220429072211.24957-4-rickaran@axis.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/pca9450-regulator.c')
-rw-r--r--drivers/regulator/pca9450-regulator.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index 87b4e6e29ba1..4a3ae73c600c 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -702,6 +702,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
 	struct regulator_config config = { };
 	struct pca9450 *pca9450;
 	unsigned int device_id, i;
+	unsigned int reset_ctrl;
 	int ret;
 
 	if (!i2c->irq) {
@@ -802,9 +803,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
 		return ret;
 	}
 
+	if (of_property_read_bool(i2c->dev.of_node, "nxp,wdog_b-warm-reset"))
+		reset_ctrl = WDOG_B_CFG_WARM;
+	else
+		reset_ctrl = WDOG_B_CFG_COLD_LDO12;
+
 	/* 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);
+				 WDOG_B_CFG_MASK, reset_ctrl);
 	if (ret) {
 		dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n");
 		return ret;