linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: Add support for GPIOF_ACTIVE_LOW to gpio_request_one
@ 2014-07-16 23:11 Guenter Roeck
  2014-07-17  6:09 ` Alexandre Courbot
  0 siblings, 1 reply; 8+ messages in thread
From: Guenter Roeck @ 2014-07-16 23:11 UTC (permalink / raw)
  To: linux-gpio; +Cc: linux-kernel, Linus Walleij, Alexandre Courbot, Guenter Roeck

The gpio include file and the gpio documentation declare and document
GPIOF_ACTIVE_LOW as one of the flags to be passed to gpio_request_one
and related functions. However, the flag is not evaluated or used.

Check the flag in gpio_request_one and set the gpio internal flag
FLAG_ACTIVE_LOW if it is set.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/gpio/gpiolib.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 2ebc907..43d9e34 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1842,6 +1842,9 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
 	if (flags & GPIOF_OPEN_SOURCE)
 		set_bit(FLAG_OPEN_SOURCE, &desc->flags);
 
+	if (flags & GPIOF_ACTIVE_LOW)
+		set_bit(FLAG_ACTIVE_LOW, &desc->flags);
+
 	if (flags & GPIOF_DIR_IN)
 		err = gpiod_direction_input(desc);
 	else
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-07-22  7:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-16 23:11 [PATCH] gpio: Add support for GPIOF_ACTIVE_LOW to gpio_request_one Guenter Roeck
2014-07-17  6:09 ` Alexandre Courbot
2014-07-17  6:37   ` Guenter Roeck
2014-07-17  7:26     ` Alexandre Courbot
2014-07-17 14:34       ` Guenter Roeck
2014-07-22  4:30         ` Alexandre Courbot
2014-07-22  5:16           ` Guenter Roeck
2014-07-22  6:59             ` Alexandre Courbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).