3 * Vikas Manocha, <vikas.manocha@st.com>
5 * SPDX-License-Identifier: GPL-2.0+
11 enum stm32_gpio_port {
12 STM32_GPIO_PORT_A = 0,
42 enum stm32_gpio_mode {
43 STM32_GPIO_MODE_IN = 0,
49 enum stm32_gpio_otype {
50 STM32_GPIO_OTYPE_PP = 0,
54 enum stm32_gpio_speed {
55 STM32_GPIO_SPEED_2M = 0,
61 enum stm32_gpio_pupd {
62 STM32_GPIO_PUPD_NO = 0,
86 struct stm32_gpio_dsc {
87 enum stm32_gpio_port port;
88 enum stm32_gpio_pin pin;
91 struct stm32_gpio_ctl {
92 enum stm32_gpio_mode mode;
93 enum stm32_gpio_otype otype;
94 enum stm32_gpio_speed speed;
95 enum stm32_gpio_pupd pupd;
96 enum stm32_gpio_af af;
99 static inline unsigned stm32_gpio_to_port(unsigned gpio)
104 static inline unsigned stm32_gpio_to_pin(unsigned gpio)
109 int stm32_gpio_config(const struct stm32_gpio_dsc *gpio_dsc,
110 const struct stm32_gpio_ctl *gpio_ctl);
111 int stm32_gpout_set(const struct stm32_gpio_dsc *gpio_dsc, int state);
113 #endif /* _STM32_GPIO_H_ */