drivers: gpio: stm32: Keep port clock in input configuration

When pin is configured in input mode, clock is also required.

Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
Erwan Gouriou 2022-12-12 16:23:56 +01:00 committed by Christopher Friedt
parent 5fab7a5173
commit 428700f709

View File

@ -550,8 +550,8 @@ static int gpio_stm32_config(const struct device *dev,
gpio_stm32_configure_raw(dev, pin, pincfg, 0);
/* Release clock only if configuration doesn't require bank writes */
if ((flags & GPIO_OUTPUT) == 0) {
/* Release clock only if pin is disconnected */
if (((flags & GPIO_OUTPUT) == 0) && ((flags & GPIO_INPUT) == 0)) {
err = pm_device_runtime_put(dev);
if (err < 0) {
return err;