diff options
author | Etienne Carriere <etienne.carriere@linaro.org> | 2021-09-24 18:43:54 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2021-10-06 19:59:28 +0200 |
commit | aae59a1e065f8d5ada64bdbde7c89317b1557d31 (patch) | |
tree | 6c1c0ccaaf25d65f869c2434cd43501423878944 | |
parent | 7a2947dc6209267c60bdfbb198df3c7822a085e7 (diff) |
drivers: stm32_gpio: inline function when without GPIO support
Provide an implementation for GPIO configuration when the driver
is not embedded (CFG_STM32_GPIO!=y). In such configuration, platform
cannot configure the GPIO pins hence place an assert() instruction.
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
Acked-by: Jerome Forissier <jerome@forissier.org>
-rw-r--r-- | core/include/drivers/stm32_gpio.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/core/include/drivers/stm32_gpio.h b/core/include/drivers/stm32_gpio.h index 7387a69b..6a241bab 100644 --- a/core/include/drivers/stm32_gpio.h +++ b/core/include/drivers/stm32_gpio.h @@ -13,6 +13,7 @@ #ifndef __STM32_GPIO_H #define __STM32_GPIO_H +#include <assert.h> #include <stdbool.h> #include <stdint.h> #include <stddef.h> @@ -151,6 +152,7 @@ static inline int stm32_pinctrl_get_gpio_level(struct stm32_pinctrl *pinctrl) return stm32_gpio_get_input_level(pinctrl->bank, pinctrl->pin); } +#ifdef CFG_STM32_GPIO /* * Configure pin muxing access permission: can be secure or not * @@ -160,6 +162,14 @@ static inline int stm32_pinctrl_get_gpio_level(struct stm32_pinctrl *pinctrl) */ void stm32_gpio_set_secure_cfg(unsigned int bank, unsigned int pin, bool secure); +#else +static inline void stm32_gpio_set_secure_cfg(unsigned int bank __unused, + unsigned int pin __unused, + bool secure __unused) +{ + assert(0); +} +#endif /* * Get the number of GPIO pins supported by a target GPIO bank |