summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDrew Fustini <drew@pdp7.com>2019-11-05 10:04:23 +0800
committerBartosz Golaszewski <bgolaszewski@baylibre.com>2019-11-12 16:30:30 +0100
commit9225d5169d110734099a82c39c073a11e399cb3f (patch)
treece801bf8c51d4dc21533dca65d8c2f8d87562a2a /include
parentf932a68695e4c7d92e721d2c23580d9f35494662 (diff)
downloadlinux-9225d5169d110734099a82c39c073a11e399cb3f.tar.gz
linux-9225d5169d110734099a82c39c073a11e399cb3f.tar.bz2
linux-9225d5169d110734099a82c39c073a11e399cb3f.zip
gpio: expose pull-up/pull-down line flags to userspace
Add pull-up/pull-down flags to the gpio line get and set ioctl() calls. Use cases include a push button that does not have an external resistor. Addition use cases described by Limor Fried (ladyada) of Adafruit in this PR for Adafruit_Blinka Python lib: https://github.com/adafruit/Adafruit_Blinka/pull/59 Signed-off-by: Drew Fustini <drew@pdp7.com> [Kent: added BIAS to GPIO flag names and restrict application to input lines] Signed-off-by: Kent Gibson <warthog618@gmail.com> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Diffstat (limited to 'include')
-rw-r--r--include/uapi/linux/gpio.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/uapi/linux/gpio.h b/include/uapi/linux/gpio.h
index 4ebfe0ac6c5b..39e6c7854d63 100644
--- a/include/uapi/linux/gpio.h
+++ b/include/uapi/linux/gpio.h
@@ -33,6 +33,8 @@ struct gpiochip_info {
#define GPIOLINE_FLAG_ACTIVE_LOW (1UL << 2)
#define GPIOLINE_FLAG_OPEN_DRAIN (1UL << 3)
#define GPIOLINE_FLAG_OPEN_SOURCE (1UL << 4)
+#define GPIOLINE_FLAG_BIAS_PULL_UP (1UL << 5)
+#define GPIOLINE_FLAG_BIAS_PULL_DOWN (1UL << 6)
/**
* struct gpioline_info - Information about a certain GPIO line
@@ -62,6 +64,8 @@ struct gpioline_info {
#define GPIOHANDLE_REQUEST_ACTIVE_LOW (1UL << 2)
#define GPIOHANDLE_REQUEST_OPEN_DRAIN (1UL << 3)
#define GPIOHANDLE_REQUEST_OPEN_SOURCE (1UL << 4)
+#define GPIOHANDLE_REQUEST_BIAS_PULL_UP (1UL << 5)
+#define GPIOHANDLE_REQUEST_BIAS_PULL_DOWN (1UL << 6)
/**
* struct gpiohandle_request - Information about a GPIO handle request