xref: /optee_os/core/include/drivers/stm32_gpio.h (revision a0f3154cfa75eda772785dfcb586b916514d7007)
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright (c) 2017-2023, STMicroelectronics
4  */
5 
6 #ifndef __DRIVERS_STM32_GPIO_H
7 #define __DRIVERS_STM32_GPIO_H
8 
9 #include <assert.h>
10 #include <drivers/pinctrl.h>
11 #include <stdbool.h>
12 #include <stdint.h>
13 #include <stddef.h>
14 
15 struct pinctrl_state;
16 struct stm32_pinctrl;
17 
18 #ifdef CFG_STM32_GPIO
19 /*
20  * Get the bank and pin indices related to a pin control state
21  * @pinctrl: Pinctrl state
22  * @bank: Output bank indices array or NULL
23  * @pin: Output pin indices array or NULL
24  * @count: [in] Number of cells of @bank and @pin, [out] pin count in @pinctrl
25  */
26 void stm32_gpio_pinctrl_bank_pin(struct pinctrl_state *pinctrl,
27 				 unsigned int *bank, unsigned int *pin,
28 				 unsigned int *count);
29 #else
30 static inline void stm32_gpio_pinctrl_bank_pin(struct pinctrl_state *p __unused,
31 					       unsigned int *bank __unused,
32 					       unsigned int *pin __unused,
33 					       unsigned int *count __unused)
34 {
35 }
36 #endif /*CFG_STM32_GPIO*/
37 #endif /*__DRIVERS_STM32_GPIO_H*/
38