]> www.infradead.org Git - users/willy/xarray.git/commitdiff
gpio: Add definition for GPIO direction
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Wed, 6 Nov 2019 08:51:47 +0000 (10:51 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 7 Nov 2019 08:19:39 +0000 (09:19 +0100)
At least for me it is difficult to remember the meaning of GPIO
direction values. Define GPIO_LINE_DIRECTION_IN and
GPIO_LINE_DIRECTION_OUT so that occasional GPIO contributors would
not need to always check the meaning of hard coded values 1 and 0.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
include/linux/gpio/driver.h

index 5dd9c982e2cbee6d10aa42fbcd888d702e6751cc..cc9ade4552d95c9de2b8c929e66f06ab875e799b 100644 (file)
@@ -22,6 +22,9 @@ enum gpio_lookup_flags;
 
 struct gpio_chip;
 
+#define GPIO_LINE_DIRECTION_IN 1
+#define GPIO_LINE_DIRECTION_OUT        0
+
 /**
  * struct gpio_irq_chip - GPIO interrupt controller
  */