drivers: mfd: npm6001: set SWREADY

Sets SWREADY in MFD initialization, so that hysteresis mode can be used.

Signed-off-by: Bernt Johan Damslora <bernt.damslora@nordicsemi.no>
This commit is contained in:
Bernt Johan Damslora 2024-02-22 13:04:37 +01:00 committed by Carles Cufí
parent 517d5ce2e3
commit 73d56dea66

View file

@ -11,6 +11,7 @@
#include <zephyr/sys/util.h> #include <zephyr/sys/util.h>
/* nPM6001 registers */ /* nPM6001 registers */
#define NPM6001_SWREADY 0x01U
#define NPM6001_BUCK3SELDAC 0x44U #define NPM6001_BUCK3SELDAC 0x44U
#define NPM6001_BUCKMODEPADCONF 0x4EU #define NPM6001_BUCKMODEPADCONF 0x4EU
#define NPM6001_PADDRIVESTRENGTH 0x53U #define NPM6001_PADDRIVESTRENGTH 0x53U
@ -60,6 +61,12 @@ static int mfd_npm6001_init(const struct device *dev)
return ret; return ret;
} }
/* Enable switching to hysteresis mode */
ret = i2c_reg_write_byte_dt(&config->i2c, NPM6001_SWREADY, 1U);
if (ret < 0) {
return ret;
}
return 0; return 0;
} }