summaryrefslogtreecommitdiff
path: root/include/linux/gpio.h
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2012-02-17 20:26:22 +0530
committerSimone Willett <swillett@nvidia.com>2012-03-07 22:24:27 -0800
commit806c13eb6bda41bdceb65ae7478b08965e1a4d5d (patch)
treea5accce31e203137269d7f01d5e301c9b5adfad8 /include/linux/gpio.h
parent38ca86e591ad3e80e21d40ff647622a85e110f95 (diff)
gpio: gpiolib: Support for open source/emitter gpios
Adding support for the open source gpio on which client can specify the open source property through GPIO flag GPIOF_OPEN_SOURCE at the time of gpio request. The open source pins are normally pulled low and it cannot be driven to output with value of 0 and so when client request for setting the pin to LOW, the gpio will be set to input direction to make pin in tristate and hence PULL-DOWN on pins will make the state to LOW. The open source pin can be driven to HIGH by setting output with value of 1. 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 commit 25553ff0756c59b617af6bdd280c94e943164184 Change-Id: I3062a5dec7bf745b624d9a147f79d3830927325b Reviewed-on: http://git-master/r/88265 Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
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 8d3a8011f312..6e20df099279 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -17,6 +17,9 @@
/* Gpio pin is open drain */
#define GPIOF_OPEN_DRAIN (1 << 2)
+/* Gpio pin is open source */
+#define GPIOF_OPEN_SOURCE (1 << 3)
+
#ifdef CONFIG_GENERIC_GPIO
#include <asm/gpio.h>