WSL2-Linux-Kernel/Documentation/gpio
Alexandre Courbot 39b2bbe3d7 gpio: add flags argument to gpiod_get*() functions
The huge majority of GPIOs have their direction and initial value set
right after being obtained by one of the gpiod_get() functions. The
integer GPIO API had gpio_request_one() that took a convenience flags
parameter allowing to specify an direction and value applied to the
returned GPIO. This feature greatly simplifies client code and ensures
errors are always handled properly.

A similar feature has been requested for the gpiod API. Since setting
the direction of a GPIO is so often the very next action done after
obtaining its descriptor, we prefer to extend the existing functions
instead of introducing new functions that would raise the
number of gpiod getters to 16 (!).

The drawback of this approach is that all gpiod clients need to be
updated. To limit the pain, temporary macros are introduced that allow
gpiod_get*() to be called with or without the extra flags argument. They
will be removed once all consumer code has been updated.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Reviewed-by: Mark Brown <broonie@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2014-07-28 12:28:05 +02:00
..
00-INDEX Documentation: gpiolib: add 00-INDEX file 2013-12-03 13:10:48 +01:00
board.txt gpio: split gpiod board registration into machine header 2014-07-28 12:23:35 +02:00
consumer.txt gpio: add flags argument to gpiod_get*() functions 2014-07-28 12:28:05 +02:00
driver.txt gpiolib: Export gpiochip_request_own_desc and gpiochip_free_own_desc 2014-07-24 10:25:00 +02:00
gpio-legacy.txt
gpio.txt
sysfs.txt