From 3bcf10cdaf1e4fe974854fbc8a1f834542bae5a1 Mon Sep 17 00:00:00 2001 From: Rabin Vincent Date: Thu, 6 May 2010 10:43:55 +0100 Subject: [PATCH] --- yaml --- r: 191782 b: refs/heads/master c: 7a852d8060e1bb3a5e621caaebea86c43cf4a62d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/arm/plat-nomadik/gpio.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index c753a6efe4ab..c702940968f4 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 040e5ecddaa72f1f982b83cb205509bc9ce7f91e +refs/heads/master: 7a852d8060e1bb3a5e621caaebea86c43cf4a62d diff --git a/trunk/arch/arm/plat-nomadik/gpio.c b/trunk/arch/arm/plat-nomadik/gpio.c index a8ac545ddadc..b877d76878f9 100644 --- a/trunk/arch/arm/plat-nomadik/gpio.c +++ b/trunk/arch/arm/plat-nomadik/gpio.c @@ -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; }