aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorAndrew Victor <andrew@sanpeople.com>2006-06-19 10:26:53 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-06-19 10:26:53 -0400
commit683c66bf75ce277b90d658da0c1a0bf1a55cce4c (patch)
tree962a3d92b8eba3424df5642e5a02e66220876281 /arch/arm
parent37f2e4bc120bd784e7f69f961233e1c16b74d170 (diff)
[ARM] 3583/1: AT91RM9200 IRQ suspend/resume support
Patch from Andrew Victor Added suspend/resume/set_wake support for the AT91RM9200's AIC interrupt controller. Signed-off-by: Andrew Victor <andrew@sanpeople.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-at91rm9200/irq.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-at91rm9200/irq.c b/arch/arm/mach-at91rm9200/irq.c
index cc545b2c4388..70f4d7ac1533 100644
--- a/arch/arm/mach-at91rm9200/irq.c
+++ b/arch/arm/mach-at91rm9200/irq.c
@@ -118,11 +118,47 @@ static int at91rm9200_irq_type(unsigned irq, unsigned type)
118 return 0; 118 return 0;
119} 119}
120 120
121#ifdef CONFIG_PM
122
123static u32 wakeups;
124static u32 backups;
125
126static int at91rm9200_irq_set_wake(unsigned irq, unsigned value)
127{
128 if (unlikely(irq >= 32))
129 return -EINVAL;
130
131 if (value)
132 wakeups |= (1 << irq);
133 else
134 wakeups &= ~(1 << irq);
135
136 return 0;
137}
138
139void at91_irq_suspend(void)
140{
141 backups = at91_sys_read(AT91_AIC_IMR);
142 at91_sys_write(AT91_AIC_IDCR, backups);
143 at91_sys_write(AT91_AIC_IECR, wakeups);
144}
145
146void at91_irq_resume(void)
147{
148 at91_sys_write(AT91_AIC_IDCR, wakeups);
149 at91_sys_write(AT91_AIC_IECR, backups);
150}
151
152#else
153#define at91rm9200_irq_set_wake NULL
154#endif
155
121static struct irqchip at91rm9200_irq_chip = { 156static struct irqchip at91rm9200_irq_chip = {
122 .ack = at91rm9200_mask_irq, 157 .ack = at91rm9200_mask_irq,
123 .mask = at91rm9200_mask_irq, 158 .mask = at91rm9200_mask_irq,
124 .unmask = at91rm9200_unmask_irq, 159 .unmask = at91rm9200_unmask_irq,
125 .set_type = at91rm9200_irq_type, 160 .set_type = at91rm9200_irq_type,
161 .set_wake = at91rm9200_irq_set_wake,
126}; 162};
127 163
128/* 164/*