diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-07-25 18:38:36 +0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-07-28 14:28:05 +0400 |
commit | 39b2bbe3d715cf5013b5c48695ccdd25bd3bf120 (patch) | |
tree | 019129dbc7b1cc10200342602fe7eac47230219e /sound/sparc | |
parent | 9b5b33f6256a941d9d34f219b508ba7140a39dba (diff) | |
download | linux-39b2bbe3d715cf5013b5c48695ccdd25bd3bf120.tar.xz |
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 'sound/sparc')
0 files changed, 0 insertions, 0 deletions