drivers: gpio: stm32: introduce gpio_stm32_configure_raw
Make gpio32_stm32_configure use runtime PM API (so that it can be used externally without further effort). The raw version of the function (no PM put/get) has been introduced for internal use. Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
This commit is contained in:
parent
a7a6a86505
commit
a9ae700695
4 changed files with 22 additions and 23 deletions
|
@ -9,7 +9,6 @@
|
|||
#include <drivers/clock_control/stm32_clock_control.h>
|
||||
#include <drivers/pinctrl.h>
|
||||
#include <gpio/gpio_stm32.h>
|
||||
#include <pm/device_runtime.h>
|
||||
|
||||
#include <stm32_ll_bus.h>
|
||||
#include <stm32_ll_gpio.h>
|
||||
|
@ -146,7 +145,6 @@ static int stm32_pins_remap(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt)
|
|||
static int stm32_pin_configure(uint32_t pin, uint32_t func, uint32_t altf)
|
||||
{
|
||||
const struct device *port_device;
|
||||
int ret;
|
||||
|
||||
if (STM32_PORT(pin) >= gpio_ports_cnt) {
|
||||
return -EINVAL;
|
||||
|
@ -158,14 +156,7 @@ static int stm32_pin_configure(uint32_t pin, uint32_t func, uint32_t altf)
|
|||
return -ENODEV;
|
||||
}
|
||||
|
||||
ret = pm_device_runtime_get(port_device);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
gpio_stm32_configure(port_device, STM32_PIN(pin), func, altf);
|
||||
|
||||
return pm_device_runtime_put(port_device);
|
||||
return gpio_stm32_configure(port_device, STM32_PIN(pin), func, altf);
|
||||
}
|
||||
|
||||
int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue