From 85cbf736bd6fd4ecf2b4c22b6ec9bb06998e1d0b Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Thu, 24 Mar 2011 12:38:50 +0100 Subject: [PATCH] --- yaml --- r: 243279 b: refs/heads/master c: d1118f68b66ef6e0f36c9887c504462f2ec02d0d h: refs/heads/master i: 243277: 4ce5dee7f6bf4653cd3cca81b9ddc0fe06381ab9 243275: 1233d768aee0471a6ed1a61374b4f7e5623204bf 243271: 9fb75ea0488d8964b5d1e3bd5d14b43d0b9f9f79 243263: 0195967ca7cca4dd36f0f11f831fc75085fc0f93 v: v3 --- [refs] | 2 +- trunk/arch/arm/plat-nomadik/gpio.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index 07627db4f396..2be9eaf00086 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e0fc5b3226cc5668afc8a1277f79a271ec5ffcb5 +refs/heads/master: d1118f68b66ef6e0f36c9887c504462f2ec02d0d diff --git a/trunk/arch/arm/plat-nomadik/gpio.c b/trunk/arch/arm/plat-nomadik/gpio.c index 6436ba597c12..1b402a8e9031 100644 --- a/trunk/arch/arm/plat-nomadik/gpio.c +++ b/trunk/arch/arm/plat-nomadik/gpio.c @@ -54,6 +54,7 @@ struct nmk_gpio_chip { u32 rwimsc; u32 fwimsc; u32 slpm; + u32 enabled; }; static struct nmk_gpio_chip * @@ -557,6 +558,11 @@ static int nmk_gpio_irq_maskunmask(struct irq_data *d, bool enable) if (!nmk_chip) return -EINVAL; + if (enable) + nmk_chip->enabled |= bitmask; + else + nmk_chip->enabled &= ~bitmask; + spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); spin_lock(&nmk_chip->lock); @@ -583,8 +589,6 @@ static void nmk_gpio_irq_unmask(struct irq_data *d) static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) { - struct irq_desc *desc = irq_to_desc(d->irq); - bool enabled = !(desc->status & IRQ_DISABLED); struct nmk_gpio_chip *nmk_chip; unsigned long flags; u32 bitmask; @@ -599,7 +603,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) spin_lock_irqsave(&nmk_gpio_slpm_lock, flags); spin_lock(&nmk_chip->lock); - if (!enabled) + if (!(nmk_chip->enabled & bitmask)) __nmk_gpio_set_wake(nmk_chip, gpio, on); if (on) @@ -615,9 +619,7 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on) static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) { - struct irq_desc *desc = irq_to_desc(d->irq); - bool enabled = !(desc->status & IRQ_DISABLED); - bool wake = desc->wake_depth; + bool enabled, wake = irqd_is_wakeup_set(d); int gpio; struct nmk_gpio_chip *nmk_chip; unsigned long flags; @@ -634,6 +636,8 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type) if (type & IRQ_TYPE_LEVEL_LOW) return -EINVAL; + enabled = nmk_chip->enabled & bitmask; + spin_lock_irqsave(&nmk_chip->lock, flags); if (enabled)