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 <a.fatoum@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 74c9e3d commit 0bf713e53a1f2556e66f76a368476e233e5ab89d
@Ahmad Fatoum Ahmad Fatoum authored on 17 Jun 2019
Sascha Hauer committed on 20 Jun 2019
Showing 2 changed files
View
drivers/gpio/gpiolib.c
View
include/gpio.h