Commit 4a3dcd35 authored by Eric Miao's avatar Eric Miao Committed by Russell King

[ARM] 4438/1: PXA: remove #ifdef .. #endif from pxa_gpio_demux_handler()

1. use GPIO_IRQ_mask[] to select those bits of interest, actually
   only those "unmasked" GPIO IRQs with their corresponding bits
   in GPIO_IRQ_mask[] set to "1" should be checked

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
Signed-off-by: default avatareric miao <eric.miao@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 348f2e3b
...@@ -250,7 +250,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) ...@@ -250,7 +250,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
do { do {
loop = 0; loop = 0;
mask = GEDR0 & ~3; mask = GEDR0 & GPIO_IRQ_mask[0] & ~3;
if (mask) { if (mask) {
GEDR0 = mask; GEDR0 = mask;
irq = IRQ_GPIO(2); irq = IRQ_GPIO(2);
...@@ -266,7 +266,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) ...@@ -266,7 +266,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
loop = 1; loop = 1;
} }
mask = GEDR1; mask = GEDR1 & GPIO_IRQ_mask[1];
if (mask) { if (mask) {
GEDR1 = mask; GEDR1 = mask;
irq = IRQ_GPIO(32); irq = IRQ_GPIO(32);
...@@ -281,7 +281,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) ...@@ -281,7 +281,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
loop = 1; loop = 1;
} }
mask = GEDR2; mask = GEDR2 & GPIO_IRQ_mask[2];
if (mask) { if (mask) {
GEDR2 = mask; GEDR2 = mask;
irq = IRQ_GPIO(64); irq = IRQ_GPIO(64);
...@@ -296,8 +296,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) ...@@ -296,8 +296,7 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
loop = 1; loop = 1;
} }
#if PXA_LAST_GPIO >= 96 mask = GEDR3 & GPIO_IRQ_mask[3];
mask = GEDR3;
if (mask) { if (mask) {
GEDR3 = mask; GEDR3 = mask;
irq = IRQ_GPIO(96); irq = IRQ_GPIO(96);
...@@ -311,7 +310,6 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) ...@@ -311,7 +310,6 @@ static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
} while (mask); } while (mask);
loop = 1; loop = 1;
} }
#endif
} while (loop); } while (loop);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment