aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap
diff options
context:
space:
mode:
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)