[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    [RFC][PATCH 4/7] unify the PXA IRQ numbering and move specific code
From:       "Eric Miao" <eric.y.miao () gmail ! com>
Date:       2007-05-30 5:18:47
Message-ID: f17812d70705292218ibfb9ed1yb80bfe3cdcb9a06 () mail ! gmail ! com
[Download RAW message or body]

>From 8ecd613401d8f30edf9d79bfc3651924bb8f41b0 Mon Sep 17 00:00:00 2001
From: eric miao <eric.miao@marvell.com>
Date: Wed, 30 May 2007 11:00:43 +0800
Subject: [PATCH] [ARM][PXA] remove #ifdef .. #endif from
pxa_gpio_demux_handler()

1. using GPIO_IRQ_mask[] to select those bits of interest
2. remove #ifdef PXA_LAST_GPIO > 96 .. #endif, GPIO_IRQ_mask[]
   is used to mask out the irrelevant bits, so that even though
   the GEDR3 on PXA25x is reserved, it will be masked, and the
   following code will never run. Another point is that GPIO85-
   GPIO95 bits within GEDR2 will also be masked out on PXA25x
---
 arch/arm/mach-pxa/irq.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 256f8d2..09d2fe1 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -250,7 +250,7 @@ static void pxa_gpio_demux_handler(unsigned int
irq, struct irq_desc *desc)
 	do {
 		loop = 0;

-		mask = GEDR0 & ~3;
+		mask = GEDR0 & GPIO_IRQ_mask[0] & ~3;
 		if (mask) {
 			GEDR0 = mask;
 			irq = IRQ_GPIO(2);
@@ -266,7 +266,7 @@ static void pxa_gpio_demux_handler(unsigned int
irq, struct irq_desc *desc)
 			loop = 1;
 		}

-		mask = GEDR1;
+		mask = GEDR1 & GPIO_IRQ_mask[1];
 		if (mask) {
 			GEDR1 = mask;
 			irq = IRQ_GPIO(32);
@@ -281,7 +281,7 @@ static void pxa_gpio_demux_handler(unsigned int
irq, struct irq_desc *desc)
 			loop = 1;
 		}

-		mask = GEDR2;
+		mask = GEDR2 & GPIO_IRQ_mask[2];
 		if (mask) {
 			GEDR2 = mask;
 			irq = IRQ_GPIO(64);
@@ -296,8 +296,7 @@ static void pxa_gpio_demux_handler(unsigned int
irq, struct irq_desc *desc)
 			loop = 1;
 		}

-#if PXA_LAST_GPIO >= 96
-		mask = GEDR3;
+		mask = GEDR3 & GPIO_IRQ_mask[3];
 		if (mask) {
 			GEDR3 = mask;
 			irq = IRQ_GPIO(96);
@@ -311,7 +310,6 @@ static void pxa_gpio_demux_handler(unsigned int
irq, struct irq_desc *desc)
 			} while (mask);
 			loop = 1;
 		}
-#endif
 	} while (loop);
 }

-- 
1.5.0.5

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic