aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-omap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r--drivers/gpio/gpio-omap.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index dd7934abf6b7..615e9507de15 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -89,11 +89,6 @@ struct gpio_bank {
89 89
90static void omap_gpio_unmask_irq(struct irq_data *d); 90static void omap_gpio_unmask_irq(struct irq_data *d);
91 91
92static int omap_irq_to_gpio(struct gpio_bank *bank, unsigned int gpio_irq)
93{
94 return bank->chip.base + gpio_irq;
95}
96
97static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d) 92static inline struct gpio_bank *omap_irq_data_get_bank(struct irq_data *d)
98{ 93{
99 struct gpio_chip *chip = irq_data_get_irq_chip_data(d); 94 struct gpio_chip *chip = irq_data_get_irq_chip_data(d);
@@ -490,22 +485,21 @@ static void omap_gpio_init_irq(struct gpio_bank *bank, unsigned offset)
490static int omap_gpio_irq_type(struct irq_data *d, unsigned type) 485static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
491{ 486{
492 struct gpio_bank *bank = omap_irq_data_get_bank(d); 487 struct gpio_bank *bank = omap_irq_data_get_bank(d);
493 unsigned gpio = 0;
494 int retval; 488 int retval;
495 unsigned long flags; 489 unsigned long flags;
496 unsigned offset; 490 unsigned offset = d->hwirq;
497 491
498 if (!BANK_USED(bank)) 492 if (!BANK_USED(bank))
499 pm_runtime_get_sync(bank->dev); 493 pm_runtime_get_sync(bank->dev);
500 494
501#ifdef CONFIG_ARCH_OMAP1 495#ifdef CONFIG_ARCH_OMAP1
502 if (d->irq > IH_MPUIO_BASE) 496 if (d->irq > IH_MPUIO_BASE) {
497 unsigned gpio = 0;
503 gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE); 498 gpio = OMAP_MPUIO(d->irq - IH_MPUIO_BASE);
499 offset = GPIO_INDEX(bank, gpio);
500 }
504#endif 501#endif
505 502
506 if (!gpio)
507 gpio = omap_irq_to_gpio(bank, d->hwirq);
508
509 if (type & ~IRQ_TYPE_SENSE_MASK) 503 if (type & ~IRQ_TYPE_SENSE_MASK)
510 return -EINVAL; 504 return -EINVAL;
511 505
@@ -514,7 +508,6 @@ static int omap_gpio_irq_type(struct irq_data *d, unsigned type)
514 return -EINVAL; 508 return -EINVAL;
515 509
516 spin_lock_irqsave(&bank->lock, flags); 510 spin_lock_irqsave(&bank->lock, flags);
517 offset = GPIO_INDEX(bank, gpio);
518 retval = omap_set_gpio_triggering(bank, offset, type); 511 retval = omap_set_gpio_triggering(bank, offset, type);
519 omap_gpio_init_irq(bank, offset); 512 omap_gpio_init_irq(bank, offset);
520 if (!omap_gpio_is_input(bank, offset)) { 513 if (!omap_gpio_is_input(bank, offset)) {