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 <gerard.marull@nordicsemi.no>
This commit is contained in:
Gerard Marull-Paretas 2022-06-22 15:48:12 +02:00 committed by Fabio Baltieri
parent d3251c28aa
commit 00ecc66677
1 changed files with 2 additions and 2 deletions

View File

@ -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,