+ gpio-show-irq-settings-even-if-gpio-direction-is-output.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     gpio: show IRQ settings even if GPIO direction is "output"
has been added to the -mm tree.  Its filename is
     gpio-show-irq-settings-even-if-gpio-direction-is-output.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: gpio: show IRQ settings even if GPIO direction is "output"
From: Rodolfo Giometti <giometti@xxxxxxxx>

Some architectures (as PXA 27x for example) may define GPIO IRQ lines as
outputs since internal circuitry supports such configuration.

This patch simply detects if a GPIO is a IRQ line or not just looking for
IRQ line number, "desc" and "desc->action" fields.

Signed-off-by: Rodolfo Giometti <giometti@xxxxxxxx>
Cc: <raffaele.recalcati@xxxxxxxxxx>
Cc: David Brownell <david-b@xxxxxxxxxxx>
Cc: Haavard Skinnemoen <hskinnemoen@xxxxxxxxx>
Cc: Janakiram Sistla <janakiram.sistla@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/gpio/gpiolib.c |   82 +++++++++++++++++++--------------------
 1 file changed, 41 insertions(+), 41 deletions(-)

diff -puN drivers/gpio/gpiolib.c~gpio-show-irq-settings-even-if-gpio-direction-is-output drivers/gpio/gpiolib.c
--- a/drivers/gpio/gpiolib.c~gpio-show-irq-settings-even-if-gpio-direction-is-output
+++ a/drivers/gpio/gpiolib.c
@@ -1518,6 +1518,8 @@ static void gpiolib_dbg_show(struct seq_
 	unsigned		gpio = chip->base;
 	struct gpio_desc	*gdesc = &gpio_desc[gpio];
 	int			is_out;
+	int			irq;
+	struct irq_desc		*desc;
 
 	for (i = 0; i < chip->ngpio; i++, gpio++, gdesc++) {
 		if (!test_bit(FLAG_REQUESTED, &gdesc->flags))
@@ -1531,48 +1533,46 @@ static void gpiolib_dbg_show(struct seq_
 				? (chip->get(chip, i) ? "hi" : "lo")
 				: "?  ");
 
-		if (!is_out) {
-			int		irq = gpio_to_irq(gpio);
-			struct irq_desc	*desc = irq_to_desc(irq);
-
-			/* This races with request_irq(), set_irq_type(),
-			 * and set_irq_wake() ... but those are "rare".
-			 *
-			 * More significantly, trigger type flags aren't
-			 * currently maintained by genirq.
-			 */
-			if (irq >= 0 && desc->action) {
-				char *trigger;
-
-				switch (desc->status & IRQ_TYPE_SENSE_MASK) {
-				case IRQ_TYPE_NONE:
-					trigger = "(default)";
-					break;
-				case IRQ_TYPE_EDGE_FALLING:
-					trigger = "edge-falling";
-					break;
-				case IRQ_TYPE_EDGE_RISING:
-					trigger = "edge-rising";
-					break;
-				case IRQ_TYPE_EDGE_BOTH:
-					trigger = "edge-both";
-					break;
-				case IRQ_TYPE_LEVEL_HIGH:
-					trigger = "level-high";
-					break;
-				case IRQ_TYPE_LEVEL_LOW:
-					trigger = "level-low";
-					break;
-				default:
-					trigger = "?trigger?";
-					break;
-				}
-
-				seq_printf(s, " irq-%d %s%s",
-					irq, trigger,
-					(desc->status & IRQ_WAKEUP)
-						? " wakeup" : "");
+		irq = gpio_to_irq(gpio);
+		desc = irq_to_desc(irq);
+
+		/* This races with request_irq(), set_irq_type(),
+		 * and set_irq_wake() ... but those are "rare".
+		 *
+		 * More significantly, trigger type flags aren't
+		 * currently maintained by genirq.
+		 */
+		if (irq >= 0 && desc && desc->action) {
+			char *trigger;
+
+			switch (desc->status & IRQ_TYPE_SENSE_MASK) {
+			case IRQ_TYPE_NONE:
+				trigger = "(default)";
+				break;
+			case IRQ_TYPE_EDGE_FALLING:
+				trigger = "edge-falling";
+				break;
+			case IRQ_TYPE_EDGE_RISING:
+				trigger = "edge-rising";
+				break;
+			case IRQ_TYPE_EDGE_BOTH:
+				trigger = "edge-both";
+				break;
+			case IRQ_TYPE_LEVEL_HIGH:
+				trigger = "level-high";
+				break;
+			case IRQ_TYPE_LEVEL_LOW:
+				trigger = "level-low";
+				break;
+			default:
+				trigger = "?trigger?";
+				break;
 			}
+
+			seq_printf(s, " irq-%d %s%s",
+				irq, trigger,
+				(desc->status & IRQ_WAKEUP)
+					? " wakeup" : "");
 		}
 
 		seq_printf(s, "\n");
_

Patches currently in -mm which might be from giometti@xxxxxxxx are

linux-next.patch
gpio-show-irq-settings-even-if-gpio-direction-is-output.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux