aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
authorImre Deak <imre.deak@nokia.com>2006-06-26 19:16:07 -0400
committerTony Lindgren <tony@atomide.com>2006-06-26 19:16:07 -0400
commit99c477074de4a91a388aff863646dc3e2eb783e2 (patch)
treed3cd4f913d4c7a2113167a6007fd33397335dac6 /arch/arm/plat-omap
parenteca9e56eb8dfcf2b8b966c1c49e4622196f0586d (diff)
ARM: OMAP: Fix GPIO IRQ mask handling
The GPIO IRQ mask was retrieved incorrectly in cases where we have a mask register instead of an enable register. Also we should only return the valid bits depending on the bank size. This fixes a bug on 1510/1610 based OMAPs where GPIO IRQs are not delivered. Signed-off-by: Imre Deak <imre.deak@nokia.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap')
-rw-r--r--arch/arm/plat-omap/gpio.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
index cd1e508f90c1..e75a2ca70ba1 100644
--- a/arch/arm/plat-omap/gpio.c
+++ b/arch/arm/plat-omap/gpio.c
@@ -540,29 +540,44 @@ static inline void _clear_gpio_irqstatus(struct gpio_bank *bank, int gpio)
540static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank) 540static u32 _get_gpio_irqbank_mask(struct gpio_bank *bank)
541{ 541{
542 void __iomem *reg = bank->base; 542 void __iomem *reg = bank->base;
543 int inv = 0;
544 u32 l;
545 u32 mask;
543 546
544 switch (bank->method) { 547 switch (bank->method) {
545 case METHOD_MPUIO: 548 case METHOD_MPUIO:
546 reg += OMAP_MPUIO_GPIO_MASKIT; 549 reg += OMAP_MPUIO_GPIO_MASKIT;
550 mask = 0xffff;
551 inv = 1;
547 break; 552 break;
548 case METHOD_GPIO_1510: 553 case METHOD_GPIO_1510:
549 reg += OMAP1510_GPIO_INT_MASK; 554 reg += OMAP1510_GPIO_INT_MASK;
555 mask = 0xffff;
556 inv = 1;
550 break; 557 break;
551 case METHOD_GPIO_1610: 558 case METHOD_GPIO_1610:
552 reg += OMAP1610_GPIO_IRQENABLE1; 559 reg += OMAP1610_GPIO_IRQENABLE1;
560 mask = 0xffff;
553 break; 561 break;
554 case METHOD_GPIO_730: 562 case METHOD_GPIO_730:
555 reg += OMAP730_GPIO_INT_MASK; 563 reg += OMAP730_GPIO_INT_MASK;
564 mask = 0xffffffff;
565 inv = 1;
556 break; 566 break;
557 case METHOD_GPIO_24XX: 567 case METHOD_GPIO_24XX:
558 reg += OMAP24XX_GPIO_IRQENABLE1; 568 reg += OMAP24XX_GPIO_IRQENABLE1;
569 mask = 0xffffffff;
559 break; 570 break;
560 default: 571 default:
561 BUG(); 572 BUG();
562 return 0; 573 return 0;
563 } 574 }
564 575
565 return __raw_readl(reg); 576 l = __raw_readl(reg);
577 if (inv)
578 l = ~l;
579 l &= mask;
580 return l;
566} 581}
567 582
568static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable) 583static void _enable_gpio_irqbank(struct gpio_bank *bank, int gpio_mask, int enable)