]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - arch/arm/plat-nomadik/gpio.c
ARM: 6101/1: nomadik-gpio: don't enable in set_type
[mv-sheeva.git] / arch / arm / plat-nomadik / gpio.c
index a8ac545ddadc6f9993d9fa6cb6e80abf0b872127..b877d76878f95fc0029e207496045beb1b57d9ae 100644 (file)
@@ -162,6 +162,7 @@ static void nmk_gpio_irq_unmask(unsigned int irq)
 
 static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
 {
+       bool enabled = !(irq_to_desc(irq)->status & IRQ_DISABLED);
        int gpio;
        struct nmk_gpio_chip *nmk_chip;
        unsigned long flags;
@@ -180,19 +181,21 @@ static int nmk_gpio_irq_set_type(unsigned int irq, unsigned int type)
 
        spin_lock_irqsave(&nmk_chip->lock, flags);
 
+       if (enabled)
+               __nmk_gpio_irq_modify(nmk_chip, gpio, false);
+
        nmk_chip->edge_rising &= ~bitmask;
        if (type & IRQ_TYPE_EDGE_RISING)
                nmk_chip->edge_rising |= bitmask;
-       writel(nmk_chip->edge_rising, nmk_chip->addr + NMK_GPIO_RIMSC);
 
        nmk_chip->edge_falling &= ~bitmask;
        if (type & IRQ_TYPE_EDGE_FALLING)
                nmk_chip->edge_falling |= bitmask;
-       writel(nmk_chip->edge_falling, nmk_chip->addr + NMK_GPIO_FIMSC);
 
-       spin_unlock_irqrestore(&nmk_chip->lock, flags);
+       if (enabled)
+               __nmk_gpio_irq_modify(nmk_chip, gpio, true);
 
-       nmk_gpio_irq_unmask(irq);
+       spin_unlock_irqrestore(&nmk_chip->lock, flags);
 
        return 0;
 }