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:
parent
d3251c28aa
commit
00ecc66677
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue