Michael Niewöhner | dbb667a | 2020-12-11 21:26:02 +0100 | [diff] [blame] | 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__ */ |