Commit 2364a64d authored by Rickard x Andersson's avatar Rickard x Andersson Committed by Mark Brown

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: default avatarRickard x Andersson <rickaran@axis.com>
Link: https://lore.kernel.org/r/20220429072211.24957-4-rickaran@axis.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent bd2f5e71
...@@ -702,6 +702,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c, ...@@ -702,6 +702,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
struct regulator_config config = { }; struct regulator_config config = { };
struct pca9450 *pca9450; struct pca9450 *pca9450;
unsigned int device_id, i; unsigned int device_id, i;
unsigned int reset_ctrl;
int ret; int ret;
if (!i2c->irq) { if (!i2c->irq) {
...@@ -802,9 +803,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c, ...@@ -802,9 +803,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
return ret; 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 */ /* Set reset behavior on assertion of WDOG_B signal */
ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL, 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) { if (ret) {
dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n"); dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n");
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment