diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-07-25 16:38:36 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-07-28 12:28:05 +0200 |
commit | 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120 (patch) | |
tree | 019129dbc7b1cc10200342602fe7eac47230219e /scripts/pnmtologo.c | |
parent | MAINTAINERS: Update Samsung pin control entry (diff) | |
download | linux-39b2bbe3d715cf5013b5c48695ccdd25bd3bf120.tar.xz linux-39b2bbe3d715cf5013b5c48695ccdd25bd3bf120.zip |
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>
Diffstat (limited to 'scripts/pnmtologo.c')
0 files changed, 0 insertions, 0 deletions