Skip to content

Commit 2364a64

Browse files
Rickard x Anderssonbroonie
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent bd2f5e7 commit 2364a64

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

drivers/regulator/pca9450-regulator.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
702702
struct regulator_config config = { };
703703
struct pca9450 *pca9450;
704704
unsigned int device_id, i;
705+
unsigned int reset_ctrl;
705706
int ret;
706707

707708
if (!i2c->irq) {
@@ -802,9 +803,14 @@ static int pca9450_i2c_probe(struct i2c_client *i2c,
802803
return ret;
803804
}
804805

806+
if (of_property_read_bool(i2c->dev.of_node, "nxp,wdog_b-warm-reset"))
807+
reset_ctrl = WDOG_B_CFG_WARM;
808+
else
809+
reset_ctrl = WDOG_B_CFG_COLD_LDO12;
810+
805811
/* Set reset behavior on assertion of WDOG_B signal */
806812
ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL,
807-
WDOG_B_CFG_MASK, WDOG_B_CFG_COLD_LDO12);
813+
WDOG_B_CFG_MASK, reset_ctrl);
808814
if (ret) {
809815
dev_err(&i2c->dev, "Failed to set WDOG_B reset behavior\n");
810816
return ret;

0 commit comments

Comments
 (0)