* [PATCH 2/2] regulator: pca9450: Make i2c-reset a warm reset optionally
2026-12-03 14:50 [PATCH 1/2] dt-bindings: regulator: pca9450: add warm reset for i2c-reset pin Martin Kepplinger-Novakovic
@ 2026-12-03 14:50 ` Martin Kepplinger-Novakovic
2026-12-03 15:07 ` [PATCH 1/2] dt-bindings: regulator: pca9450: add warm reset for i2c-reset pin Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Martin Kepplinger-Novakovic @ 2026-12-03 14:50 UTC (permalink / raw)
To: lgirdwood, broonie, robh, krzk+dt, conor+dt, yibin.gong
Cc: linux-kernel, devicetree, linux-pm
When resetting via i2c-reset pin, the pca9450 does a cold reset by default
("Power recycle all regulators except LDO1, LDO2 and CLK_32K_OUT"). Add
support for doing Warm Reset ("Toggle POR_B for 20 ms") instead if needed.
Implement this using the DT property nxp,i2c-warm-reset.
Chapter 7.4 of the datasheet has the details, see
https://www.nxp.com/docs/en/data-sheet/PCA9450.pdf
Signed-off-by: Martin Kepplinger-Novakovic <martin.kepplinger-novakovic@ginzinger.com>
---
drivers/regulator/pca9450-regulator.c | 8 +++++++-
include/linux/regulator/pca9450.h | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/pca9450-regulator.c b/drivers/regulator/pca9450-regulator.c
index f1c787e6db8bf..8423abc55612f 100644
--- a/drivers/regulator/pca9450-regulator.c
+++ b/drivers/regulator/pca9450-regulator.c
@@ -45,6 +45,7 @@ struct pca9450 {
int irq;
bool sd_vsel_fixed_low;
int default_t_off_deb;
+ int sw_reset_cmd;
};
static const struct regmap_range pca9450_status_range = {
@@ -1195,7 +1196,7 @@ static int pca9450_i2c_restart_handler(struct sys_off_data *data)
struct i2c_client *i2c = container_of(pca9450->dev, struct i2c_client, dev);
dev_dbg(&i2c->dev, "Restarting device..\n");
- if (i2c_smbus_write_byte_data(i2c, PCA9450_REG_SWRST, SW_RST_COMMAND) == 0) {
+ if (i2c_smbus_write_byte_data(i2c, PCA9450_REG_SWRST, pca9450->sw_reset_cmd) == 0) {
/* tRESTART is 250ms, so 300 should be enough to make sure it happened */
mdelay(300);
/* When we get here, the PMIC didn't power cycle for some reason. so warn.*/
@@ -1223,6 +1224,11 @@ static int pca9450_of_init(struct pca9450 *pca9450)
else
reset_ctrl = WDOG_B_CFG_COLD_LDO12;
+ if (of_property_read_bool(i2c->dev.of_node, "nxp,i2c-warm-reset"))
+ pca9450->sw_reset_cmd = SW_RST_WARM_COMMAND;
+ else
+ pca9450->sw_reset_cmd = SW_RST_COMMAND;
+
/* Set reset behavior on assertion of WDOG_B signal */
ret = regmap_update_bits(pca9450->regmap, PCA9450_REG_RESET_CTRL,
WDOG_B_CFG_MASK, reset_ctrl);
diff --git a/include/linux/regulator/pca9450.h b/include/linux/regulator/pca9450.h
index bf94df5fafe30..599bf43713a17 100644
--- a/include/linux/regulator/pca9450.h
+++ b/include/linux/regulator/pca9450.h
@@ -273,5 +273,6 @@ enum {
/* PCA9450_REG_SW_RST command */
#define SW_RST_COMMAND 0x14
+#define SW_RST_WARM_COMMAND 0x35
#endif /* __LINUX_REG_PCA9450_H__ */
--
2.47.3
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH 1/2] dt-bindings: regulator: pca9450: add warm reset for i2c-reset pin
2026-12-03 14:50 [PATCH 1/2] dt-bindings: regulator: pca9450: add warm reset for i2c-reset pin Martin Kepplinger-Novakovic
2026-12-03 14:50 ` [PATCH 2/2] regulator: pca9450: Make i2c-reset a warm reset optionally Martin Kepplinger-Novakovic
@ 2026-12-03 15:07 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-12-03 15:07 UTC (permalink / raw)
To: Martin Kepplinger-Novakovic
Cc: lgirdwood, robh, krzk+dt, conor+dt, yibin.gong, linux-kernel,
devicetree, linux-pm
[-- Attachment #1: Type: text/plain, Size: 632 bytes --]
On Thu, Dec 03, 2026 at 03:50:50PM +0100, Martin Kepplinger-Novakovic wrote:
> When resetting via i2c-reset pin, the pca9450 does a cold reset by default
> (Power recycle all regulators except LDO1, LDO2 and CLK_32K_OUT). Add
> support for doing Warm Reset (Toggle POR_B for 20 ms) instead if needed.
Please submit patches using subject lines reflecting the style for the
subsystem, this makes it easier for people to identify relevant patches.
Look at what existing commits in the area you're changing are doing and
make sure your subject lines visually resemble what they're doing.
There's no need to resubmit to fix this alone.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread