diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-03-22 15:14:09 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-22 15:14:09 -0500 |
commit | bd115ea007e671e96b8b53c2e0e885103d39fd40 (patch) | |
tree | e33f6a612f0a4dcb447d2bd3ce4678f928d94838 /arch/arm | |
parent | bec1b8193651ea4394cc4d6e18152cb83e735f93 (diff) |
[ARM] 3378/1: ixp2000: fix gpio interrupt handling
Patch from Lennert Buytenhek
ixp2000 used to initially mark GPIO interrupts as invalid, and not
mark them valid until set_irq_type() was called, but this doesn't
work if you want to use request_irq() with the SA_TRIGGER_* flags.
So, just mark the GPIO interrupts valid from the beginning. We
configure GPIOs as inputs when set_irq_type() is called anyway, so
this shouldn't be a problem.
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-ixp2000/core.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c index cfd5bef3190b..6e8d504aca55 100644 --- a/arch/arm/mach-ixp2000/core.c +++ b/arch/arm/mach-ixp2000/core.c | |||
@@ -288,8 +288,6 @@ void gpio_line_config(int line, int direction) | |||
288 | 288 | ||
289 | local_irq_save(flags); | 289 | local_irq_save(flags); |
290 | if (direction == GPIO_OUT) { | 290 | if (direction == GPIO_OUT) { |
291 | irq_desc[line + IRQ_IXP2000_GPIO0].valid = 0; | ||
292 | |||
293 | /* if it's an output, it ain't an interrupt anymore */ | 291 | /* if it's an output, it ain't an interrupt anymore */ |
294 | GPIO_IRQ_falling_edge &= ~(1 << line); | 292 | GPIO_IRQ_falling_edge &= ~(1 << line); |
295 | GPIO_IRQ_rising_edge &= ~(1 << line); | 293 | GPIO_IRQ_rising_edge &= ~(1 << line); |
@@ -351,11 +349,6 @@ static int ixp2000_GPIO_irq_type(unsigned int irq, unsigned int type) | |||
351 | GPIO_IRQ_level_high &= ~(1 << line); | 349 | GPIO_IRQ_level_high &= ~(1 << line); |
352 | update_gpio_int_csrs(); | 350 | update_gpio_int_csrs(); |
353 | 351 | ||
354 | /* | ||
355 | * Finally, mark the corresponding IRQ as valid. | ||
356 | */ | ||
357 | irq_desc[irq].valid = 1; | ||
358 | |||
359 | return 0; | 352 | return 0; |
360 | } | 353 | } |
361 | 354 | ||
@@ -506,14 +499,10 @@ void __init ixp2000_init_irq(void) | |||
506 | } | 499 | } |
507 | set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler); | 500 | set_irq_chained_handler(IRQ_IXP2000_ERRSUM, ixp2000_err_irq_handler); |
508 | 501 | ||
509 | /* | ||
510 | * GPIO IRQs are invalid until someone sets the interrupt mode | ||
511 | * by calling set_irq_type(). | ||
512 | */ | ||
513 | for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) { | 502 | for (irq = IRQ_IXP2000_GPIO0; irq <= IRQ_IXP2000_GPIO7; irq++) { |
514 | set_irq_chip(irq, &ixp2000_GPIO_irq_chip); | 503 | set_irq_chip(irq, &ixp2000_GPIO_irq_chip); |
515 | set_irq_handler(irq, do_level_IRQ); | 504 | set_irq_handler(irq, do_level_IRQ); |
516 | set_irq_flags(irq, 0); | 505 | set_irq_flags(irq, IRQF_VALID); |
517 | } | 506 | } |
518 | set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler); | 507 | set_irq_chained_handler(IRQ_IXP2000_GPIO, ixp2000_GPIO_irq_handler); |
519 | 508 | ||