From 25553ff0756c59b617af6bdd280c94e943164184 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Fri, 17 Feb 2012 20:26:22 +0530 Subject: 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 Reviwed-by: Mark Brown Acked-by: Linus Walleij Signed-off-by: Grant Likely --- include/linux/gpio.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/gpio.h') diff --git a/include/linux/gpio.h b/include/linux/gpio.h index 66a5b2e9d35a..67851bbd3a42 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) + /** * struct gpio - a structure describing a GPIO with configuration * @gpio: the GPIO number -- cgit v1.2.3-55-g7522