gpiolib: Introduce gpiod_set_config()
authorGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 24 Mar 2020 13:56:50 +0000 (14:56 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Fri, 27 Mar 2020 21:36:29 +0000 (22:36 +0100)
commit8ced32ffadc857eaa45d62c0c5a34cf6f37168ea
tree2a216644d93a9fef8233ecbae085043a9b4e958e
parent06dd3f31cb70035cbd3f507c11fd50e3089aeb81
gpiolib: Introduce gpiod_set_config()

The GPIO Aggregator will need a method to forward a .set_config() call
to its parent gpiochip.  This requires obtaining the gpio_chip and
offset for a given gpio_desc.  While gpiod_to_chip() is public,
gpio_chip_hwgpio() is not, so there is currently no method to obtain the
needed GPIO offset parameter.

Hence introduce a public gpiod_set_config() helper, which invokes the
.set_config() callback through a gpio_desc pointer, like is done for
most other gpio_chip callbacks.

Rewrite the existing gpiod_set_debounce() helper as a wrapper around
gpiod_set_config(), to avoid duplication.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20200324135653.6676-5-geert+renesas@glider.be
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
include/linux/gpio/consumer.h