diff options
author | Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> | 2015-12-22 16:37:28 +0200 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-12-26 22:28:43 +0100 |
commit | 60befd2ea1c2061775838ea7bac5cc2b1353afd0 (patch) | |
tree | 9bd578c65dd61d662d43423e6a27786280f51956 /include | |
parent | 723a63034eaf10ad36eff28496667f8e2a9f5da3 (diff) | |
download | linux-stable-60befd2ea1c2061775838ea7bac5cc2b1353afd0.tar.gz linux-stable-60befd2ea1c2061775838ea7bac5cc2b1353afd0.tar.bz2 linux-stable-60befd2ea1c2061775838ea7bac5cc2b1353afd0.zip |
gpio: update gpiochip .get() callback description
Since gpiochip .get() callback may return a negative error value, it
strictly limits the range of possible non-error returned values to
a subset of [30:0] bitmask, however on practice on success all
gpiochip drivers return either 0 for low signal or 1 for high signal,
this is assured by "gpio: *: Be sure to clamp return value" series of
changes. To avoid any confusion, misinterpretation and potential
errors while developing gpiochip drivers in future convert this
implicit assumption to a mandatory rule.
For output signals with unknown output signal state gpiochip drivers
should return a negative error instead of 0.
Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/gpio/driver.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h index b02c43be7859..990797589408 100644 --- a/include/linux/gpio/driver.h +++ b/include/linux/gpio/driver.h @@ -32,8 +32,7 @@ struct seq_file; * (same as GPIOF_DIR_XXX), or negative error * @direction_input: configures signal "offset" as input, or returns error * @direction_output: configures signal "offset" as output, or returns error - * @get: returns value for signal "offset"; for output signals this - * returns either the value actually sensed, or zero + * @get: returns value for signal "offset", 0=low, 1=high, or negative error * @set: assigns output value for signal "offset" * @set_multiple: assigns output values for multiple signals defined by "mask" * @set_debounce: optional hook for setting debounce time for specified gpio in |