Commit 80681d29 authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Anas Nashif
Browse files

stm32: gpio: Fix device runtime pm



When CONFIG_PM_DEVICE_RUNTIME is enabled, if a pin is configure as
input after an output pin has already being configured the device is
wrongly suspended.

Fixes #38433

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent 79ff6453
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -464,16 +464,11 @@ static int gpio_stm32_config(const struct device *dev,
	}

#ifdef CONFIG_PM_DEVICE_RUNTIME
	enum pm_device_state state;

	(void)pm_device_state_get(dev, &state);
	/* Enable device clock before configuration (requires bank writes) */
	if (state != PM_DEVICE_STATE_ACTIVE) {
	err = pm_device_get(dev);
	if (err < 0) {
		return err;
	}
	}
#endif /* CONFIG_PM_DEVICE_RUNTIME */

	if ((flags & GPIO_OUTPUT) != 0) {