gpiolib: add gpiochip_get_desc() driver function
authorAlexandre Courbot <acourbot@nvidia.com>
Sun, 9 Feb 2014 08:43:54 +0000 (17:43 +0900)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 12 Feb 2014 16:11:35 +0000 (17:11 +0100)
commitbb1e88ccb771492ac908ac295ec135efa1d53093
treeb8848e3943167f59db95516a0626020f4efbbe71
parent90df4fe07f9794984bd2dafd1d28acd45318d37f
gpiolib: add gpiochip_get_desc() driver function

Some drivers dealing with a gpio_chip might need to act on its
descriptors directly; one example is pinctrl drivers that need to lock a
GPIO for being used as IRQ using gpiod_lock_as_irq().

This patch exports a gpiochip_get_desc() function that returns the
GPIO descriptor at the requested index. It also sweeps the
gpio_to_chip() function out of the consumer interface since any holder
of a gpio_chip reference can manipulate its GPIOs way beyond what a
consumer should be allowed to do.

As a result, gpio_chip is not visible anymore to simple GPIO consumers.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Jean-Jacques Hiblot <jjhiblot@traphandler.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpiolib.c
include/linux/gpio/consumer.h
include/linux/gpio/driver.h
This page took 0.025471 seconds and 5 git commands to generate.