xref: /aosp_15_r20/external/coreboot/src/include/device/gpio.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __DEVICE_GPIO_H__
4 #define __DEVICE_GPIO_H__
5 
6 #include <types.h>
7 
8 struct gpio_operations {
9 	int  (*get)(uint32_t gpio);
10 	void (*set)(uint32_t gpio, int value);
11 	void (*input_pulldown)(uint32_t gpio);
12 	void (*input_pullup)(uint32_t gpio);
13 	void (*input)(uint32_t gpio);
14 	void (*output)(uint32_t gpio, int value);
15 };
16 
17 /* Helper for getting gpio operations from a device */
18 const struct gpio_operations *dev_get_gpio_ops(struct device *dev);
19 
20 #endif	/* __DEVICE_GPIO_H__ */
21