All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] dm: gpio: handle GPIO_ACTIVE_LOW flag in DT
@ 2016-03-25 20:12 Eric Nelson
  2016-03-29  4:57 ` Peng Fan
  0 siblings, 1 reply; 67+ messages in thread
From: Eric Nelson @ 2016-03-25 20:12 UTC (permalink / raw)
  To: u-boot

Device tree parsing of GPIO nodes is currently ignoring flags.

Add support for GPIO_ACTIVE_LOW by checking for the presence
of the flag and setting the desc->flags field to the driver
model constant GPIOD_ACTIVE_LOW.

Signed-off-by: Eric Nelson <eric@nelint.com>
---
 drivers/gpio/gpio-uclass.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-uclass.c b/drivers/gpio/gpio-uclass.c
index b58d4e6..6d30612 100644
--- a/drivers/gpio/gpio-uclass.c
+++ b/drivers/gpio/gpio-uclass.c
@@ -6,6 +6,7 @@
 
 #include <common.h>
 #include <dm.h>
+#include <dt-bindings/gpio/gpio.h>
 #include <errno.h>
 #include <fdtdec.h>
 #include <malloc.h>
@@ -118,12 +119,16 @@ static int gpio_find_and_xlate(struct gpio_desc *desc,
 {
 	struct dm_gpio_ops *ops = gpio_get_ops(desc->dev);
 
+	desc->flags = 0;
 	/* Use the first argument as the offset by default */
-	if (args->args_count > 0)
+	if (args->args_count > 0) {
 		desc->offset = args->args[0];
+		if ((args->args_count > 1) &&
+		    (args->args[1] & GPIO_ACTIVE_LOW))
+			desc->flags = GPIOD_ACTIVE_LOW;
+	}
 	else
 		desc->offset = -1;
-	desc->flags = 0;
 
 	return ops->xlate ? ops->xlate(desc->dev, desc, args) : 0;
 }
-- 
2.6.2

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

end of thread, other threads:[~2016-05-07 19:03 UTC | newest]

Thread overview: 67+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-25 20:12 [U-Boot] [PATCH] dm: gpio: handle GPIO_ACTIVE_LOW flag in DT Eric Nelson
2016-03-29  4:57 ` Peng Fan
2016-03-31 20:41   ` Eric Nelson
2016-04-01 15:47     ` [U-Boot] [PATCH 0/7] Handle GPIO_ACTIVE_LOW in gpio-uclass Eric Nelson
2016-04-01 15:47       ` [U-Boot] [PATCH 1/7] dm: gpio: handle GPIO_ACTIVE_LOW flag in DT Eric Nelson
2016-04-01 15:47       ` [U-Boot] [PATCH 2/7] gpio: intel_broadwell: remove gpio_xlate routine Eric Nelson
2016-04-09 18:33         ` Simon Glass
2016-04-01 15:47       ` [U-Boot] [PATCH 3/7] gpio: omap: " Eric Nelson
2016-04-09 18:33         ` Simon Glass
2016-04-01 15:47       ` [U-Boot] [PATCH 4/7] gpio: pic32: " Eric Nelson
2016-04-09 18:33         ` Simon Glass
2016-04-01 15:47       ` [U-Boot] [PATCH 5/7] gpio: rk: " Eric Nelson
2016-04-09 18:33         ` Simon Glass
2016-04-01 15:47       ` [U-Boot] [PATCH 6/7] gpio: exynos(s5p): " Eric Nelson
2016-04-09 18:34         ` Simon Glass
2016-04-01 15:47       ` [U-Boot] [PATCH 7/7] gpio: tegra: remove flags parsing in xlate routine Eric Nelson
2016-04-05 22:09         ` Stephen Warren
2016-04-09 18:34           ` Simon Glass
2016-04-10 14:45             ` Eric Nelson
2016-04-10 15:55               ` Eric Nelson
2016-04-11 17:00       ` [U-Boot] [PATCH V2 0/6] Handle GPIO_ACTIVE_LOW in gpio-uclass Eric Nelson
2016-04-11 17:00         ` [U-Boot] [PATCH V2 1/6] dm: gpio: add a default gpio xlate routine Eric Nelson
2016-04-11 17:16           ` Stephen Warren
2016-04-11 17:18             ` Eric Nelson
2016-04-11 17:31             ` [U-Boot] [PATCH V3 " Eric Nelson
2016-04-12  3:49               ` Purna Chandra Mandal
2016-04-11 17:00         ` [U-Boot] [PATCH V2 2/6] gpio: intel_broadwell: remove gpio_xlate routine Eric Nelson
2016-04-11 17:00         ` [U-Boot] [PATCH V2 3/6] gpio: omap: " Eric Nelson
2016-04-11 17:00         ` [U-Boot] [PATCH V2 4/6] gpio: pic32: " Eric Nelson
2016-04-12  3:49           ` Purna Chandra Mandal
2016-04-11 17:00         ` [U-Boot] [PATCH V2 5/6] gpio: rk: " Eric Nelson
2016-04-11 17:00         ` [U-Boot] [PATCH V2 6/6] gpio: exynos(s5p): " Eric Nelson
2016-04-12  3:56           ` Minkyu Kang
2016-04-02  5:46     ` [U-Boot] [PATCH] dm: gpio: handle GPIO_ACTIVE_LOW flag in DT Peng Fan
2016-04-02 15:13       ` Eric Nelson
2016-04-03  3:37         ` Stephen Warren
2016-04-03 14:07           ` Eric Nelson
2016-04-04 17:50             ` Stephen Warren
2016-04-09 18:33               ` Simon Glass
2016-04-10 14:48                 ` Eric Nelson
2016-04-11 14:47                   ` Simon Glass
2016-04-11 14:55                     ` Eric Nelson
2016-04-11 14:59                       ` Simon Glass
2016-04-11 15:10                         ` Eric Nelson
2016-04-11 15:12                           ` Simon Glass
2016-04-11 16:10                             ` Stephen Warren
2016-04-11 16:53                               ` Simon Glass
2016-04-11 17:17                                 ` Eric Nelson
2016-04-20 14:40                                   ` Simon Glass
2016-04-20 15:23                                     ` Eric Nelson
2016-04-20 15:37                                     ` [U-Boot] [RESEND PATCH 0/6] Handle GPIO_ACTIVE_LOW in gpio-uclass Eric Nelson
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V3 1/6] dm: gpio: add a default gpio xlate routine Eric Nelson
2016-04-21 17:03                                         ` Stephen Warren
2016-04-24 23:32                                           ` Eric Nelson
2016-04-24 23:32                                           ` [U-Boot] [PATCH V4, " Eric Nelson
2016-04-27 15:12                                             ` Simon Glass
2016-05-07 19:03                                               ` Simon Glass
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V2 2/6] gpio: intel_broadwell: remove gpio_xlate routine Eric Nelson
2016-05-07 19:03                                         ` Simon Glass
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V2 3/6] gpio: omap: " Eric Nelson
2016-05-07 19:03                                         ` Simon Glass
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V2 4/6] gpio: pic32: " Eric Nelson
2016-05-07 19:03                                         ` Simon Glass
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V2 5/6] gpio: rk: " Eric Nelson
2016-05-07 19:03                                         ` Simon Glass
2016-04-20 15:37                                       ` [U-Boot] [RESEND PATCH V2 6/6] gpio: exynos(s5p): " Eric Nelson
2016-05-07 19:03                                         ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.