From 1f156c352ca64194f7d41ba3d8ab9ac511673156 Mon Sep 17 00:00:00 2001 From: Andy Sinclair Date: Thu, 11 Apr 2024 15:51:06 +0100 Subject: [PATCH] drivers: mfd: npm1300: Fixed configuration of long press reset Added write of strobe register after setting long press reset configuration. This is needed to apply the new value. Signed-off-by: Andy Sinclair --- drivers/mfd/mfd_npm1300.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/mfd_npm1300.c b/drivers/mfd/mfd_npm1300.c index a8cc16c15a..2ea0818fae 100644 --- a/drivers/mfd/mfd_npm1300.c +++ b/drivers/mfd/mfd_npm1300.c @@ -29,6 +29,7 @@ #define MAIN_OFFSET_INTENCLR 0x03U #define SHIP_OFFSET_HIBERNATE 0x00U +#define SHIP_OFFSET_CFGSTROBE 0x01U #define SHIP_OFFSET_CONFIG 0x04U #define SHIP_OFFSET_LPCONFIG 0x06U @@ -175,7 +176,12 @@ static int mfd_npm1300_init(const struct device *dev) return ret; } - return mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_LPCONFIG, config->lp_reset); + ret = mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_LPCONFIG, config->lp_reset); + if (ret < 0) { + return ret; + } + + return mfd_npm1300_reg_write(dev, SHIP_BASE, SHIP_OFFSET_CFGSTROBE, 1U); } int mfd_npm1300_reg_read_burst(const struct device *dev, uint8_t base, uint8_t offset, void *data,