aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ixp23xx
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-11-29 04:33:32 -0500
committerLennert Buytenhek <buytenh@wantstofly.org>2011-01-13 11:18:39 -0500
commitc1d065e696b8a1e0486a25fa2a804da0d2d6d98c (patch)
tree0b183ecc36107f7ac66c2760b903ac4f37a8d0c1 /arch/arm/mach-ixp23xx
parent6e8f54fad5b2e15b64595d6ededb316d713db102 (diff)
ARM: ixp23xx: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-ixp23xx')
-rw-r--r--arch/arm/mach-ixp23xx/core.c55
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c36
2 files changed, 49 insertions, 42 deletions
diff --git a/arch/arm/mach-ixp23xx/core.c b/arch/arm/mach-ixp23xx/core.c
index aa4c4420ff3d..9c8a33903216 100644
--- a/arch/arm/mach-ixp23xx/core.c
+++ b/arch/arm/mach-ixp23xx/core.c
@@ -111,9 +111,9 @@ enum ixp23xx_irq_type {
111 111
112static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type); 112static void ixp23xx_config_irq(unsigned int, enum ixp23xx_irq_type);
113 113
114static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type) 114static int ixp23xx_irq_set_type(struct irq_data *d, unsigned int type)
115{ 115{
116 int line = irq - IRQ_IXP23XX_GPIO6 + 6; 116 int line = d->irq - IRQ_IXP23XX_GPIO6 + 6;
117 u32 int_style; 117 u32 int_style;
118 enum ixp23xx_irq_type irq_type; 118 enum ixp23xx_irq_type irq_type;
119 volatile u32 *int_reg; 119 volatile u32 *int_reg;
@@ -149,7 +149,7 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type)
149 return -EINVAL; 149 return -EINVAL;
150 } 150 }
151 151
152 ixp23xx_config_irq(irq, irq_type); 152 ixp23xx_config_irq(d->irq, irq_type);
153 153
154 if (line >= 8) { /* pins 8-15 */ 154 if (line >= 8) { /* pins 8-15 */
155 line -= 8; 155 line -= 8;
@@ -173,9 +173,10 @@ static int ixp23xx_irq_set_type(unsigned int irq, unsigned int type)
173 return 0; 173 return 0;
174} 174}
175 175
176static void ixp23xx_irq_mask(unsigned int irq) 176static void ixp23xx_irq_mask(struct irq_data *d)
177{ 177{
178 volatile unsigned long *intr_reg; 178 volatile unsigned long *intr_reg;
179 unsigned int irq = d->irq;
179 180
180 if (irq >= 56) 181 if (irq >= 56)
181 irq += 8; 182 irq += 8;
@@ -184,9 +185,9 @@ static void ixp23xx_irq_mask(unsigned int irq)
184 *intr_reg &= ~(1 << (irq % 32)); 185 *intr_reg &= ~(1 << (irq % 32));
185} 186}
186 187
187static void ixp23xx_irq_ack(unsigned int irq) 188static void ixp23xx_irq_ack(struct irq_data *d)
188{ 189{
189 int line = irq - IRQ_IXP23XX_GPIO6 + 6; 190 int line = d->irq - IRQ_IXP23XX_GPIO6 + 6;
190 191
191 if ((line < 6) || (line > 15)) 192 if ((line < 6) || (line > 15))
192 return; 193 return;
@@ -198,11 +199,12 @@ static void ixp23xx_irq_ack(unsigned int irq)
198 * Level triggered interrupts on GPIO lines can only be cleared when the 199 * Level triggered interrupts on GPIO lines can only be cleared when the
199 * interrupt condition disappears. 200 * interrupt condition disappears.
200 */ 201 */
201static void ixp23xx_irq_level_unmask(unsigned int irq) 202static void ixp23xx_irq_level_unmask(struct irq_data *d)
202{ 203{
203 volatile unsigned long *intr_reg; 204 volatile unsigned long *intr_reg;
205 unsigned int irq = d->irq;
204 206
205 ixp23xx_irq_ack(irq); 207 ixp23xx_irq_ack(d);
206 208
207 if (irq >= 56) 209 if (irq >= 56)
208 irq += 8; 210 irq += 8;
@@ -211,9 +213,10 @@ static void ixp23xx_irq_level_unmask(unsigned int irq)
211 *intr_reg |= (1 << (irq % 32)); 213 *intr_reg |= (1 << (irq % 32));
212} 214}
213 215
214static void ixp23xx_irq_edge_unmask(unsigned int irq) 216static void ixp23xx_irq_edge_unmask(struct irq_data *d)
215{ 217{
216 volatile unsigned long *intr_reg; 218 volatile unsigned long *intr_reg;
219 unsigned int irq = d->irq;
217 220
218 if (irq >= 56) 221 if (irq >= 56)
219 irq += 8; 222 irq += 8;
@@ -223,26 +226,30 @@ static void ixp23xx_irq_edge_unmask(unsigned int irq)
223} 226}
224 227
225static struct irq_chip ixp23xx_irq_level_chip = { 228static struct irq_chip ixp23xx_irq_level_chip = {
226 .ack = ixp23xx_irq_mask, 229 .irq_ack = ixp23xx_irq_mask,
227 .mask = ixp23xx_irq_mask, 230 .irq_mask = ixp23xx_irq_mask,
228 .unmask = ixp23xx_irq_level_unmask, 231 .irq_unmask = ixp23xx_irq_level_unmask,
229 .set_type = ixp23xx_irq_set_type 232 .irq_set_type = ixp23xx_irq_set_type
230}; 233};
231 234
232static struct irq_chip ixp23xx_irq_edge_chip = { 235static struct irq_chip ixp23xx_irq_edge_chip = {
233 .ack = ixp23xx_irq_ack, 236 .irq_ack = ixp23xx_irq_ack,
234 .mask = ixp23xx_irq_mask, 237 .irq_mask = ixp23xx_irq_mask,
235 .unmask = ixp23xx_irq_edge_unmask, 238 .irq_unmask = ixp23xx_irq_edge_unmask,
236 .set_type = ixp23xx_irq_set_type 239 .irq_set_type = ixp23xx_irq_set_type
237}; 240};
238 241
239static void ixp23xx_pci_irq_mask(unsigned int irq) 242static void ixp23xx_pci_irq_mask(struct irq_data *d)
240{ 243{
244 unsigned int irq = d->irq;
245
241 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq)); 246 *IXP23XX_PCI_XSCALE_INT_ENABLE &= ~(1 << (IRQ_IXP23XX_INTA + 27 - irq));
242} 247}
243 248
244static void ixp23xx_pci_irq_unmask(unsigned int irq) 249static void ixp23xx_pci_irq_unmask(struct irq_data *d)
245{ 250{
251 unsigned int irq = d->irq;
252
246 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq)); 253 *IXP23XX_PCI_XSCALE_INT_ENABLE |= (1 << (IRQ_IXP23XX_INTA + 27 - irq));
247} 254}
248 255
@@ -256,7 +263,7 @@ static void pci_handler(unsigned int irq, struct irq_desc *desc)
256 263
257 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS; 264 pci_interrupt = *IXP23XX_PCI_XSCALE_INT_STATUS;
258 265
259 desc->chip->ack(irq); 266 desc->irq_data.chip->irq_ack(&desc->irq_data);
260 267
261 /* See which PCI_INTA, or PCI_INTB interrupted */ 268 /* See which PCI_INTA, or PCI_INTB interrupted */
262 if (pci_interrupt & (1 << 26)) { 269 if (pci_interrupt & (1 << 26)) {
@@ -269,13 +276,13 @@ static void pci_handler(unsigned int irq, struct irq_desc *desc)
269 276
270 generic_handle_irq(irqno); 277 generic_handle_irq(irqno);
271 278
272 desc->chip->unmask(irq); 279 desc->irq_data.chip->irq_unmask(&desc->irq_data);
273} 280}
274 281
275static struct irq_chip ixp23xx_pci_irq_chip = { 282static struct irq_chip ixp23xx_pci_irq_chip = {
276 .ack = ixp23xx_pci_irq_mask, 283 .irq_ack = ixp23xx_pci_irq_mask,
277 .mask = ixp23xx_pci_irq_mask, 284 .irq_mask = ixp23xx_pci_irq_mask,
278 .unmask = ixp23xx_pci_irq_unmask 285 .irq_unmask = ixp23xx_pci_irq_unmask
279}; 286};
280 287
281static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type) 288static void ixp23xx_config_irq(unsigned int irq, enum ixp23xx_irq_type type)
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c
index 664e39c2a903..181116aa6591 100644
--- a/arch/arm/mach-ixp23xx/ixdp2351.c
+++ b/arch/arm/mach-ixp23xx/ixdp2351.c
@@ -48,14 +48,14 @@
48/* 48/*
49 * IXDP2351 Interrupt Handling 49 * IXDP2351 Interrupt Handling
50 */ 50 */
51static void ixdp2351_inta_mask(unsigned int irq) 51static void ixdp2351_inta_mask(struct irq_data *d)
52{ 52{
53 *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(irq); 53 *IXDP2351_CPLD_INTA_MASK_SET_REG = IXDP2351_INTA_IRQ_MASK(d->irq);
54} 54}
55 55
56static void ixdp2351_inta_unmask(unsigned int irq) 56static void ixdp2351_inta_unmask(struct irq_data *d)
57{ 57{
58 *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(irq); 58 *IXDP2351_CPLD_INTA_MASK_CLR_REG = IXDP2351_INTA_IRQ_MASK(d->irq);
59} 59}
60 60
61static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc) 61static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc)
@@ -64,7 +64,7 @@ static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc)
64 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID; 64 *IXDP2351_CPLD_INTA_STAT_REG & IXDP2351_INTA_IRQ_VALID;
65 int i; 65 int i;
66 66
67 desc->chip->mask(irq); 67 desc->irq_data.chip->irq_mask(&desc->irq_data);
68 68
69 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) { 69 for (i = 0; i < IXDP2351_INTA_IRQ_NUM; i++) {
70 if (ex_interrupt & (1 << i)) { 70 if (ex_interrupt & (1 << i)) {
@@ -74,23 +74,23 @@ static void ixdp2351_inta_handler(unsigned int irq, struct irq_desc *desc)
74 } 74 }
75 } 75 }
76 76
77 desc->chip->unmask(irq); 77 desc->irq_data.chip->irq_unmask(&desc->irq_data);
78} 78}
79 79
80static struct irq_chip ixdp2351_inta_chip = { 80static struct irq_chip ixdp2351_inta_chip = {
81 .ack = ixdp2351_inta_mask, 81 .irq_ack = ixdp2351_inta_mask,
82 .mask = ixdp2351_inta_mask, 82 .irq_mask = ixdp2351_inta_mask,
83 .unmask = ixdp2351_inta_unmask 83 .irq_unmask = ixdp2351_inta_unmask
84}; 84};
85 85
86static void ixdp2351_intb_mask(unsigned int irq) 86static void ixdp2351_intb_mask(struct irq_data *d)
87{ 87{
88 *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(irq); 88 *IXDP2351_CPLD_INTB_MASK_SET_REG = IXDP2351_INTB_IRQ_MASK(d->irq);
89} 89}
90 90
91static void ixdp2351_intb_unmask(unsigned int irq) 91static void ixdp2351_intb_unmask(struct irq_data *d)
92{ 92{
93 *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(irq); 93 *IXDP2351_CPLD_INTB_MASK_CLR_REG = IXDP2351_INTB_IRQ_MASK(d->irq);
94} 94}
95 95
96static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc) 96static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc)
@@ -99,7 +99,7 @@ static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc)
99 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID; 99 *IXDP2351_CPLD_INTB_STAT_REG & IXDP2351_INTB_IRQ_VALID;
100 int i; 100 int i;
101 101
102 desc->chip->ack(irq); 102 desc->irq_data.chip->irq_ack(&desc->irq_data);
103 103
104 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) { 104 for (i = 0; i < IXDP2351_INTB_IRQ_NUM; i++) {
105 if (ex_interrupt & (1 << i)) { 105 if (ex_interrupt & (1 << i)) {
@@ -109,13 +109,13 @@ static void ixdp2351_intb_handler(unsigned int irq, struct irq_desc *desc)
109 } 109 }
110 } 110 }
111 111
112 desc->chip->unmask(irq); 112 desc->irq_data.chip->irq_unmask(&desc->irq_data);
113} 113}
114 114
115static struct irq_chip ixdp2351_intb_chip = { 115static struct irq_chip ixdp2351_intb_chip = {
116 .ack = ixdp2351_intb_mask, 116 .irq_ack = ixdp2351_intb_mask,
117 .mask = ixdp2351_intb_mask, 117 .irq_mask = ixdp2351_intb_mask,
118 .unmask = ixdp2351_intb_unmask 118 .irq_unmask = ixdp2351_intb_unmask
119}; 119};
120 120
121void __init ixdp2351_init_irq(void) 121void __init ixdp2351_init_irq(void)