linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 6/7] ARM: sa1100: rewrite the high GPIO IRQ handler
Date: Tue, 12 Nov 2013 14:48:37 +0100	[thread overview]
Message-ID: <1384264117-6396-1-git-send-email-linus.walleij@linaro.org> (raw)

Simplify the handler for the high IRQs and follow the pattern
of the ordinary "normal" IRQ handler.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/mach-sa1100/irq.c | 35 ++++++++++++-----------------------
 1 file changed, 12 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 5463ba521ac7..a6823f3281e2 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -106,34 +106,23 @@ static int sa1100_low_gpio_wake(struct irq_data *d, unsigned int on)
 }
 
 /*
- * IRQ11 (GPIO11 through 27) handler.  We enter here with the
- * irq_controller_lock held, and IRQs disabled.  Decode the IRQ
+ * High GPIO on IRQ11 (GPIO11 through 27) handler. We enter here with
+ * the irq_controller_lock held, and IRQs disabled. Decode the IRQ
  * and call the handler.
  */
 static void
 sa1100_high_gpio_handler(unsigned int irq, struct irq_desc *desc)
 {
-	unsigned int mask;
-
-	mask = GEDR & 0xfffff800;
-	do {
-		/*
-		 * clear down all currently active IRQ sources.
-		 * We will be processing them all.
-		 */
-		GEDR = mask;
-
-		irq = IRQ_GPIO11;
-		mask >>= 11;
-		do {
-			if (mask & 1)
-				generic_handle_irq(irq);
-			mask >>= 1;
-			irq++;
-		} while (mask);
-
-		mask = GEDR & 0xfffff800;
-	} while (mask);
+	struct irq_data *data = irq_desc_get_irq_data(desc);
+	struct sa1100_sc *sc = irq_data_get_irq_chip_data(data);
+	int hwirq;
+	u32 status;
+
+	/* We're only interested in GPIOs 11 and upward */
+	while ((status = (GEDR & 0xfffff800))) {
+		hwirq = ffs(status) - 1;
+		generic_handle_irq(irq_find_mapping(sc->high_domain, hwirq));
+	}
 }
 
 /*
-- 
1.8.3.1

                 reply	other threads:[~2013-11-12 13:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1384264117-6396-1-git-send-email-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).