From 00ecc666773ea9c8c4b6c01cac38fee80d2bbc7e Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Wed, 22 Jun 2022 15:48:12 +0200 Subject: [PATCH] drivers: i2c: nrfx_twim: enable/disable when resuming/suspending The driver already implemented some sort of runtime PM by unconditionally calling nrfx_twim_disable/enable. Perform the same operations in the PM callback instead of doing a full init/deinit every time. Signed-off-by: Gerard Marull-Paretas --- drivers/i2c/i2c_nrfx_twim.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/i2c_nrfx_twim.c b/drivers/i2c/i2c_nrfx_twim.c index 41d4f718c35..827d8ba574f 100644 --- a/drivers/i2c/i2c_nrfx_twim.c +++ b/drivers/i2c/i2c_nrfx_twim.c @@ -324,11 +324,11 @@ static int twim_nrfx_pm_action(const struct device *dev, return ret; } #endif - ret = init_twim(dev); + nrfx_twim_enable(&dev_config->twim); break; case PM_DEVICE_ACTION_SUSPEND: - nrfx_twim_uninit(&dev_config->twim); + nrfx_twim_disable(&dev_config->twim); #ifdef CONFIG_PINCTRL ret = pinctrl_apply_state(dev_config->pcfg,