aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/gpio
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2014-01-07 06:34:11 -0500
committerLinus Walleij <linus.walleij@linaro.org>2014-02-07 03:47:02 -0500
commitef70bbe1aaa612f75360e5df5952fddec50b7ca9 (patch)
tree2f80756c83780e9ed9c67401af16022a749543c0 /include/linux/gpio
parent25b35da7f4cce82271859f1b6eabd9f3bd41a2bb (diff)
gpio: make gpiod_direction_output take a logical value
The documentation was not clear about whether gpio_direction_output should take a logical value or the physical level on the output line, i.e. whether the ACTIVE_LOW status would be taken into account. This converts gpiod_direction_output to use the logical level and adds a new gpiod_direction_output_raw for the raw value. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/gpio')
-rw-r--r--include/linux/gpio/consumer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/gpio/consumer.h b/include/linux/gpio/consumer.h
index 4d34dbbbad4d..387994325122 100644
--- a/include/linux/gpio/consumer.h
+++ b/include/linux/gpio/consumer.h
@@ -36,6 +36,7 @@ void devm_gpiod_put(struct device *dev, struct gpio_desc *desc);
36int gpiod_get_direction(const struct gpio_desc *desc); 36int gpiod_get_direction(const struct gpio_desc *desc);
37int gpiod_direction_input(struct gpio_desc *desc); 37int gpiod_direction_input(struct gpio_desc *desc);
38int gpiod_direction_output(struct gpio_desc *desc, int value); 38int gpiod_direction_output(struct gpio_desc *desc, int value);
39int gpiod_direction_output_raw(struct gpio_desc *desc, int value);
39 40
40/* Value get/set from non-sleeping context */ 41/* Value get/set from non-sleeping context */
41int gpiod_get_value(const struct gpio_desc *desc); 42int gpiod_get_value(const struct gpio_desc *desc);
@@ -121,6 +122,12 @@ static inline int gpiod_direction_output(struct gpio_desc *desc, int value)
121 WARN_ON(1); 122 WARN_ON(1);
122 return -ENOSYS; 123 return -ENOSYS;
123} 124}
125static inline int gpiod_direction_output_raw(struct gpio_desc *desc, int value)
126{
127 /* GPIO can never have been requested */
128 WARN_ON(1);
129 return -ENOSYS;
130}
124 131
125 132
126static inline int gpiod_get_value(const struct gpio_desc *desc) 133static inline int gpiod_get_value(const struct gpio_desc *desc)