| 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __LINUX_GPIO_FORWARDER_H |
| 3 | #define __LINUX_GPIO_FORWARDER_H |
| 4 | |
| 5 | struct gpio_desc; |
| 6 | struct gpio_chip; |
| 7 | struct gpiochip_fwd; |
| 8 | |
| 9 | struct gpiochip_fwd *devm_gpiochip_fwd_alloc(struct device *dev, |
| 10 | unsigned int ngpios); |
| 11 | int gpiochip_fwd_desc_add(struct gpiochip_fwd *fwd, |
| 12 | struct gpio_desc *desc, unsigned int offset); |
| 13 | void gpiochip_fwd_desc_free(struct gpiochip_fwd *fwd, unsigned int offset); |
| 14 | int gpiochip_fwd_register(struct gpiochip_fwd *fwd, void *data); |
| 15 | |
| 16 | struct gpio_chip *gpiochip_fwd_get_gpiochip(struct gpiochip_fwd *fwd); |
| 17 | |
| 18 | void *gpiochip_fwd_get_data(struct gpiochip_fwd *fwd); |
| 19 | |
| 20 | int gpiochip_fwd_gpio_request(struct gpiochip_fwd *fwd, unsigned int offset); |
| 21 | int gpiochip_fwd_gpio_get_direction(struct gpiochip_fwd *fwd, |
| 22 | unsigned int offset); |
| 23 | int gpiochip_fwd_gpio_direction_input(struct gpiochip_fwd *fwd, |
| 24 | unsigned int offset); |
| 25 | int gpiochip_fwd_gpio_direction_output(struct gpiochip_fwd *fwd, |
| 26 | unsigned int offset, |
| 27 | int value); |
| 28 | int gpiochip_fwd_gpio_get(struct gpiochip_fwd *fwd, unsigned int offset); |
| 29 | int gpiochip_fwd_gpio_get_multiple(struct gpiochip_fwd *fwd, |
| 30 | unsigned long *mask, |
| 31 | unsigned long *bits); |
| 32 | int gpiochip_fwd_gpio_set(struct gpiochip_fwd *fwd, unsigned int offset, |
| 33 | int value); |
| 34 | int gpiochip_fwd_gpio_set_multiple(struct gpiochip_fwd *fwd, |
| 35 | unsigned long *mask, |
| 36 | unsigned long *bits); |
| 37 | int gpiochip_fwd_gpio_set_config(struct gpiochip_fwd *fwd, unsigned int offset, |
| 38 | unsigned long config); |
| 39 | int gpiochip_fwd_gpio_to_irq(struct gpiochip_fwd *fwd, unsigned int offset); |
| 40 | |
| 41 | #endif |
| 42 | |