]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/plat-omap/gpio.c
ARM: OMAP: Fix OMAP1 compilation after MPUIO check change
[linux-2.6-omap-h63xx.git] / arch / arm / plat-omap / gpio.c
index cb0c21d384c066ec1441b346810355113dfa7bab..b27ba0ee00fbb82cf774822a77787576785058c3 100644 (file)
 #define OMAP24XX_GPIO_CLEARDATAOUT     0x0090
 #define OMAP24XX_GPIO_SETDATAOUT       0x0094
 
-#define OMAP_MPUIO_MASK                (~OMAP_MAX_GPIO_LINES & 0xff)
-
 struct gpio_bank {
        void __iomem *base;
        u16 irq;
@@ -216,11 +214,13 @@ static inline int gpio_valid(int gpio)
 {
        if (gpio < 0)
                return -1;
+#ifndef CONFIG_ARCH_OMAP24XX
        if (OMAP_GPIO_IS_MPUIO(gpio)) {
-               if ((gpio & OMAP_MPUIO_MASK) > 16)
+               if (gpio >= OMAP_MAX_GPIO_LINES + 16)
                        return -1;
                return 0;
        }
+#endif
 #ifdef CONFIG_ARCH_OMAP15XX
        if (cpu_is_omap15xx() && gpio < 16)
                return 0;
@@ -850,7 +850,8 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
                        /* Don't run the handler if it's already running
                         * or was disabled lazely.
                         */
-                       if (unlikely((d->disable_depth || d->running))) {
+                       if (unlikely((d->depth ||
+                                     (d->status & IRQ_INPROGRESS)))) {
                                irq_mask = 1 <<
                                        (gpio_irq - bank->virtual_irq_start);
                                /* The unmasking will be done by
@@ -859,22 +860,22 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
                                 * it's already running.
                                 */
                                _enable_gpio_irqbank(bank, irq_mask, 0);
-                               if (!d->disable_depth) {
+                               if (!d->depth) {
                                        /* Level triggered interrupts
                                         * won't ever be reentered
                                         */
                                        BUG_ON(level_mask & irq_mask);
-                                       d->pending = 1;
+                                       d->status |= IRQ_PENDING;
                                }
                                continue;
                        }
-                       d->running = 1;
+
                        desc_handle_irq(gpio_irq, d, regs);
-                       d->running = 0;
-                       if (unlikely(d->pending && !d->disable_depth)) {
+
+                       if (unlikely((d->status & IRQ_PENDING) && !d->depth)) {
                                irq_mask = 1 <<
                                        (gpio_irq - bank->virtual_irq_start);
-                               d->pending = 0;
+                               d->status &= ~IRQ_PENDING;
                                _enable_gpio_irqbank(bank, irq_mask, 1);
                                retrigger |= irq_mask;
                        }
@@ -943,7 +944,8 @@ static void mpuio_unmask_irq(unsigned int irq)
        _set_gpio_irqenable(bank, gpio, 1);
 }
 
-static struct irqchip gpio_irq_chip = {
+static struct irq_chip gpio_irq_chip = {
+       .name           = "GPIO",
        .ack            = gpio_ack_irq,
        .mask           = gpio_mask_irq,
        .unmask         = gpio_unmask_irq,
@@ -951,10 +953,11 @@ static struct irqchip gpio_irq_chip = {
        .set_wake       = gpio_wake_enable,
 };
 
-static struct irqchip mpuio_irq_chip = {
+static struct irq_chip mpuio_irq_chip = {
+       .name   = "MPUIO",
        .ack    = mpuio_ack_irq,
        .mask   = mpuio_mask_irq,
-       .unmask = mpuio_unmask_irq
+       .unmask = mpuio_unmask_irq
 };
 
 static int initialized;