Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28090
b: refs/heads/master
c: 683c66b
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Victor authored and Russell King committed Jun 19, 2006
1 parent 1f07033 commit 5c33174
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 37f2e4bc120bd784e7f69f961233e1c16b74d170
refs/heads/master: 683c66bf75ce277b90d658da0c1a0bf1a55cce4c
36 changes: 36 additions & 0 deletions trunk/arch/arm/mach-at91rm9200/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,47 @@ static int at91rm9200_irq_type(unsigned irq, unsigned type)
return 0;
}

#ifdef CONFIG_PM

static u32 wakeups;
static u32 backups;

static int at91rm9200_irq_set_wake(unsigned irq, unsigned value)
{
if (unlikely(irq >= 32))
return -EINVAL;

if (value)
wakeups |= (1 << irq);
else
wakeups &= ~(1 << irq);

return 0;
}

void at91_irq_suspend(void)
{
backups = at91_sys_read(AT91_AIC_IMR);
at91_sys_write(AT91_AIC_IDCR, backups);
at91_sys_write(AT91_AIC_IECR, wakeups);
}

void at91_irq_resume(void)
{
at91_sys_write(AT91_AIC_IDCR, wakeups);
at91_sys_write(AT91_AIC_IECR, backups);
}

#else
#define at91rm9200_irq_set_wake NULL
#endif

static struct irqchip at91rm9200_irq_chip = {
.ack = at91rm9200_mask_irq,
.mask = at91rm9200_mask_irq,
.unmask = at91rm9200_unmask_irq,
.set_type = at91rm9200_irq_type,
.set_wake = at91rm9200_irq_set_wake,
};

/*
Expand Down

0 comments on commit 5c33174

Please sign in to comment.