Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 243279
b: refs/heads/master
c: d1118f6
h: refs/heads/master
i:
  243277: 4ce5dee
  243275: 1233d76
  243271: 9fb75ea
  243263: 0195967
v: v3
  • Loading branch information
Thomas Gleixner committed Mar 29, 2011
1 parent 294b473 commit 85cbf73
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e0fc5b3226cc5668afc8a1277f79a271ec5ffcb5
refs/heads/master: d1118f68b66ef6e0f36c9887c504462f2ec02d0d
16 changes: 10 additions & 6 deletions trunk/arch/arm/plat-nomadik/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct nmk_gpio_chip {
u32 rwimsc;
u32 fwimsc;
u32 slpm;
u32 enabled;
};

static struct nmk_gpio_chip *
Expand Down Expand Up @@ -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);

Expand All @@ -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;
Expand All @@ -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)
Expand All @@ -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;
Expand All @@ -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)
Expand Down

0 comments on commit 85cbf73

Please sign in to comment.