summaryrefslogtreecommitdiff
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-02-17 20:26:21 +0530
committerSimone Willett <swillett@nvidia.com>2012-03-07 22:24:14 -0800
commit38ca86e591ad3e80e21d40ff647622a85e110f95 (patch)
tree233444b56e4292d4629bbf6814154166cbc0aeeb /include/linux/gpio.h
parent0d441392be71b23aa5adaa2533318bf2d38c643e (diff)
gpio: gpiolib: Support for open drain/collector gpios
Adding support for the open drain gpio on which client can specify the open drain property through GPIO flag GPIOF_OPEN_DRAIN at the time of gpio request. The open drain pins are normally pulled high and it cannot be driven to output with value of 1 and so when client request for setting the pin to HIGH, the gpio will be set to input direction to make pin in tristate and hence PULL-UP on pins will make the state to HIGH. The open drain pin can be driven to LOW by setting output with value of 0. Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cherry-picked from mainline aca5ce14eb773a75e5d935968b2e390dc5bd29c3 Change-Id: I097caebcc7cf6fb1497bb0395320dfc061bb6277 Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com> Reviewed-on: http://git-master/r/88264
Diffstat (limited to 'include/linux/gpio.h')
-rw-r--r--include/linux/gpio.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 17b5a0d80e42..8d3a8011f312 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -14,6 +14,9 @@
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
+/* Gpio pin is open drain */
+#define GPIOF_OPEN_DRAIN (1 << 2)
+
#ifdef CONFIG_GENERIC_GPIO
#include <asm/gpio.h>