From 0bf713e53a1f2556e66f76a368476e233e5ab89d Mon Sep 17 00:00:00 2001 From: Ahmad Fatoum Date: Mon, 17 Jun 2019 17:07:42 +0200 Subject: gpiolib: add gpio_get_chip helper Pinctrl nodes adhering to the generic pinctrl bindings may contain properties like input-low/input-high, which require pinctrl_ops.set_state to have a handle on the relevant gpio chip. Currently this would lead to code duplication: Both the pinctrl driver and gpiolib will need to store a list of registered gpiochips. Avoid this by providing a helper to query the registered gpio_chip given a gpio's number. Signed-off-by: Ahmad Fatoum Signed-off-by: Sascha Hauer --- include/gpio.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/gpio.h b/include/gpio.h index 38d6ba2df9..e822fd5347 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -153,5 +153,6 @@ int gpiochip_add(struct gpio_chip *chip); void gpiochip_remove(struct gpio_chip *chip); int gpio_get_num(struct device_d *dev, int gpio); +struct gpio_chip *gpio_get_chip(int gpio); #endif /* __GPIO_H */ -- cgit v1.2.3