aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/irq.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/irq.c')
-rw-r--r--arch/arm/mach-pxa/irq.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index d694ce289668..6112af431fa4 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -25,6 +25,8 @@
25 25
26#include "generic.h" 26#include "generic.h"
27 27
28#define MAX_INTERNAL_IRQS 128
29
28#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) 30#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
29#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) 31#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
30#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) 32#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
@@ -122,6 +124,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
122{ 124{
123 int irq, i; 125 int irq, i;
124 126
127 BUG_ON(irq_nr > MAX_INTERNAL_IRQS);
128
125 pxa_internal_irq_nr = irq_nr; 129 pxa_internal_irq_nr = irq_nr;
126 130
127 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { 131 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) {
@@ -149,7 +153,8 @@ void __init pxa_init_irq(int irq_nr, set_wake_t fn)
149} 153}
150 154
151#ifdef CONFIG_PM 155#ifdef CONFIG_PM
152static unsigned long saved_icmr[2]; 156static unsigned long saved_icmr[MAX_INTERNAL_IRQS/32];
157static unsigned long saved_ipr[MAX_INTERNAL_IRQS];
153 158
154static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 159static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
155{ 160{
@@ -159,6 +164,8 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
159 saved_icmr[i] = _ICMR(irq); 164 saved_icmr[i] = _ICMR(irq);
160 _ICMR(irq) = 0; 165 _ICMR(irq) = 0;
161 } 166 }
167 for (i = 0; i < pxa_internal_irq_nr; i++)
168 saved_ipr[i] = IPR(i);
162 169
163 return 0; 170 return 0;
164} 171}
@@ -171,6 +178,8 @@ static int pxa_irq_resume(struct sys_device *dev)
171 _ICMR(irq) = saved_icmr[i]; 178 _ICMR(irq) = saved_icmr[i];
172 _ICLR(irq) = 0; 179 _ICLR(irq) = 0;
173 } 180 }
181 for (i = 0; i < pxa_internal_irq_nr; i++)
182 IPR(i) = saved_ipr[i];
174 183
175 ICCR = 1; 184 ICCR = 1;
176 return 0; 185 return 0;