aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/sa1111.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2010-11-29 04:20:06 -0500
committerLennert Buytenhek <buytenh@wantstofly.org>2011-01-13 11:18:19 -0500
commit8231e74150cc3731f48879f804d47c8f061c8777 (patch)
tree1974768a6ac7377d06b40e3dba192568e5b78c98 /arch/arm/common/sa1111.c
parent680244df886face4d29d3f75d964c8e45e0e8bda (diff)
ARM: sa1111: irq_data conversion.
Signed-off-by: Lennert Buytenhek <buytenh@secretlab.ca> Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Diffstat (limited to 'arch/arm/common/sa1111.c')
-rw-r--r--arch/arm/common/sa1111.c94
1 files changed, 47 insertions, 47 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index c0258a8c103b..d6c784e78c83 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -210,7 +210,7 @@ sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
210 210
211 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0); 211 sa1111_writel(stat0, mapbase + SA1111_INTSTATCLR0);
212 212
213 desc->chip->ack(irq); 213 desc->irq_data.chip->irq_ack(&desc->irq_data);
214 214
215 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); 215 sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1);
216 216
@@ -228,35 +228,35 @@ sa1111_irq_handler(unsigned int irq, struct irq_desc *desc)
228 generic_handle_irq(i + sachip->irq_base); 228 generic_handle_irq(i + sachip->irq_base);
229 229
230 /* For level-based interrupts */ 230 /* For level-based interrupts */
231 desc->chip->unmask(irq); 231 desc->irq_data.chip->irq_unmask(&desc->irq_data);
232} 232}
233 233
234#define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base)) 234#define SA1111_IRQMASK_LO(x) (1 << (x - sachip->irq_base))
235#define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32)) 235#define SA1111_IRQMASK_HI(x) (1 << (x - sachip->irq_base - 32))
236 236
237static void sa1111_ack_irq(unsigned int irq) 237static void sa1111_ack_irq(struct irq_data *d)
238{ 238{
239} 239}
240 240
241static void sa1111_mask_lowirq(unsigned int irq) 241static void sa1111_mask_lowirq(struct irq_data *d)
242{ 242{
243 struct sa1111 *sachip = get_irq_chip_data(irq); 243 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
244 void __iomem *mapbase = sachip->base + SA1111_INTC; 244 void __iomem *mapbase = sachip->base + SA1111_INTC;
245 unsigned long ie0; 245 unsigned long ie0;
246 246
247 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 247 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
248 ie0 &= ~SA1111_IRQMASK_LO(irq); 248 ie0 &= ~SA1111_IRQMASK_LO(d->irq);
249 writel(ie0, mapbase + SA1111_INTEN0); 249 writel(ie0, mapbase + SA1111_INTEN0);
250} 250}
251 251
252static void sa1111_unmask_lowirq(unsigned int irq) 252static void sa1111_unmask_lowirq(struct irq_data *d)
253{ 253{
254 struct sa1111 *sachip = get_irq_chip_data(irq); 254 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
255 void __iomem *mapbase = sachip->base + SA1111_INTC; 255 void __iomem *mapbase = sachip->base + SA1111_INTC;
256 unsigned long ie0; 256 unsigned long ie0;
257 257
258 ie0 = sa1111_readl(mapbase + SA1111_INTEN0); 258 ie0 = sa1111_readl(mapbase + SA1111_INTEN0);
259 ie0 |= SA1111_IRQMASK_LO(irq); 259 ie0 |= SA1111_IRQMASK_LO(d->irq);
260 sa1111_writel(ie0, mapbase + SA1111_INTEN0); 260 sa1111_writel(ie0, mapbase + SA1111_INTEN0);
261} 261}
262 262
@@ -267,11 +267,11 @@ static void sa1111_unmask_lowirq(unsigned int irq)
267 * be triggered. In fact, its very difficult, if not impossible to get 267 * be triggered. In fact, its very difficult, if not impossible to get
268 * INTSET to re-trigger the interrupt. 268 * INTSET to re-trigger the interrupt.
269 */ 269 */
270static int sa1111_retrigger_lowirq(unsigned int irq) 270static int sa1111_retrigger_lowirq(struct irq_data *d)
271{ 271{
272 struct sa1111 *sachip = get_irq_chip_data(irq); 272 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
273 void __iomem *mapbase = sachip->base + SA1111_INTC; 273 void __iomem *mapbase = sachip->base + SA1111_INTC;
274 unsigned int mask = SA1111_IRQMASK_LO(irq); 274 unsigned int mask = SA1111_IRQMASK_LO(d->irq);
275 unsigned long ip0; 275 unsigned long ip0;
276 int i; 276 int i;
277 277
@@ -285,15 +285,15 @@ static int sa1111_retrigger_lowirq(unsigned int irq)
285 285
286 if (i == 8) 286 if (i == 8)
287 printk(KERN_ERR "Danger Will Robinson: failed to " 287 printk(KERN_ERR "Danger Will Robinson: failed to "
288 "re-trigger IRQ%d\n", irq); 288 "re-trigger IRQ%d\n", d->irq);
289 return i == 8 ? -1 : 0; 289 return i == 8 ? -1 : 0;
290} 290}
291 291
292static int sa1111_type_lowirq(unsigned int irq, unsigned int flags) 292static int sa1111_type_lowirq(struct irq_data *d, unsigned int flags)
293{ 293{
294 struct sa1111 *sachip = get_irq_chip_data(irq); 294 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
295 void __iomem *mapbase = sachip->base + SA1111_INTC; 295 void __iomem *mapbase = sachip->base + SA1111_INTC;
296 unsigned int mask = SA1111_IRQMASK_LO(irq); 296 unsigned int mask = SA1111_IRQMASK_LO(d->irq);
297 unsigned long ip0; 297 unsigned long ip0;
298 298
299 if (flags == IRQ_TYPE_PROBE) 299 if (flags == IRQ_TYPE_PROBE)
@@ -313,11 +313,11 @@ static int sa1111_type_lowirq(unsigned int irq, unsigned int flags)
313 return 0; 313 return 0;
314} 314}
315 315
316static int sa1111_wake_lowirq(unsigned int irq, unsigned int on) 316static int sa1111_wake_lowirq(struct irq_data *d, unsigned int on)
317{ 317{
318 struct sa1111 *sachip = get_irq_chip_data(irq); 318 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
319 void __iomem *mapbase = sachip->base + SA1111_INTC; 319 void __iomem *mapbase = sachip->base + SA1111_INTC;
320 unsigned int mask = SA1111_IRQMASK_LO(irq); 320 unsigned int mask = SA1111_IRQMASK_LO(d->irq);
321 unsigned long we0; 321 unsigned long we0;
322 322
323 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0); 323 we0 = sa1111_readl(mapbase + SA1111_WAKEEN0);
@@ -332,33 +332,33 @@ static int sa1111_wake_lowirq(unsigned int irq, unsigned int on)
332 332
333static struct irq_chip sa1111_low_chip = { 333static struct irq_chip sa1111_low_chip = {
334 .name = "SA1111-l", 334 .name = "SA1111-l",
335 .ack = sa1111_ack_irq, 335 .irq_ack = sa1111_ack_irq,
336 .mask = sa1111_mask_lowirq, 336 .irq_mask = sa1111_mask_lowirq,
337 .unmask = sa1111_unmask_lowirq, 337 .irq_unmask = sa1111_unmask_lowirq,
338 .retrigger = sa1111_retrigger_lowirq, 338 .irq_retrigger = sa1111_retrigger_lowirq,
339 .set_type = sa1111_type_lowirq, 339 .irq_set_type = sa1111_type_lowirq,
340 .set_wake = sa1111_wake_lowirq, 340 .irq_set_wake = sa1111_wake_lowirq,
341}; 341};
342 342
343static void sa1111_mask_highirq(unsigned int irq) 343static void sa1111_mask_highirq(struct irq_data *d)
344{ 344{
345 struct sa1111 *sachip = get_irq_chip_data(irq); 345 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
346 void __iomem *mapbase = sachip->base + SA1111_INTC; 346 void __iomem *mapbase = sachip->base + SA1111_INTC;
347 unsigned long ie1; 347 unsigned long ie1;
348 348
349 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 349 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
350 ie1 &= ~SA1111_IRQMASK_HI(irq); 350 ie1 &= ~SA1111_IRQMASK_HI(d->irq);
351 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 351 sa1111_writel(ie1, mapbase + SA1111_INTEN1);
352} 352}
353 353
354static void sa1111_unmask_highirq(unsigned int irq) 354static void sa1111_unmask_highirq(struct irq_data *d)
355{ 355{
356 struct sa1111 *sachip = get_irq_chip_data(irq); 356 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
357 void __iomem *mapbase = sachip->base + SA1111_INTC; 357 void __iomem *mapbase = sachip->base + SA1111_INTC;
358 unsigned long ie1; 358 unsigned long ie1;
359 359
360 ie1 = sa1111_readl(mapbase + SA1111_INTEN1); 360 ie1 = sa1111_readl(mapbase + SA1111_INTEN1);
361 ie1 |= SA1111_IRQMASK_HI(irq); 361 ie1 |= SA1111_IRQMASK_HI(d->irq);
362 sa1111_writel(ie1, mapbase + SA1111_INTEN1); 362 sa1111_writel(ie1, mapbase + SA1111_INTEN1);
363} 363}
364 364
@@ -369,11 +369,11 @@ static void sa1111_unmask_highirq(unsigned int irq)
369 * be triggered. In fact, its very difficult, if not impossible to get 369 * be triggered. In fact, its very difficult, if not impossible to get
370 * INTSET to re-trigger the interrupt. 370 * INTSET to re-trigger the interrupt.
371 */ 371 */
372static int sa1111_retrigger_highirq(unsigned int irq) 372static int sa1111_retrigger_highirq(struct irq_data *d)
373{ 373{
374 struct sa1111 *sachip = get_irq_chip_data(irq); 374 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
375 void __iomem *mapbase = sachip->base + SA1111_INTC; 375 void __iomem *mapbase = sachip->base + SA1111_INTC;
376 unsigned int mask = SA1111_IRQMASK_HI(irq); 376 unsigned int mask = SA1111_IRQMASK_HI(d->irq);
377 unsigned long ip1; 377 unsigned long ip1;
378 int i; 378 int i;
379 379
@@ -387,15 +387,15 @@ static int sa1111_retrigger_highirq(unsigned int irq)
387 387
388 if (i == 8) 388 if (i == 8)
389 printk(KERN_ERR "Danger Will Robinson: failed to " 389 printk(KERN_ERR "Danger Will Robinson: failed to "
390 "re-trigger IRQ%d\n", irq); 390 "re-trigger IRQ%d\n", d->irq);
391 return i == 8 ? -1 : 0; 391 return i == 8 ? -1 : 0;
392} 392}
393 393
394static int sa1111_type_highirq(unsigned int irq, unsigned int flags) 394static int sa1111_type_highirq(struct irq_data *d, unsigned int flags)
395{ 395{
396 struct sa1111 *sachip = get_irq_chip_data(irq); 396 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
397 void __iomem *mapbase = sachip->base + SA1111_INTC; 397 void __iomem *mapbase = sachip->base + SA1111_INTC;
398 unsigned int mask = SA1111_IRQMASK_HI(irq); 398 unsigned int mask = SA1111_IRQMASK_HI(d->irq);
399 unsigned long ip1; 399 unsigned long ip1;
400 400
401 if (flags == IRQ_TYPE_PROBE) 401 if (flags == IRQ_TYPE_PROBE)
@@ -415,11 +415,11 @@ static int sa1111_type_highirq(unsigned int irq, unsigned int flags)
415 return 0; 415 return 0;
416} 416}
417 417
418static int sa1111_wake_highirq(unsigned int irq, unsigned int on) 418static int sa1111_wake_highirq(struct irq_data *d, unsigned int on)
419{ 419{
420 struct sa1111 *sachip = get_irq_chip_data(irq); 420 struct sa1111 *sachip = irq_data_get_irq_chip_data(d);
421 void __iomem *mapbase = sachip->base + SA1111_INTC; 421 void __iomem *mapbase = sachip->base + SA1111_INTC;
422 unsigned int mask = SA1111_IRQMASK_HI(irq); 422 unsigned int mask = SA1111_IRQMASK_HI(d->irq);
423 unsigned long we1; 423 unsigned long we1;
424 424
425 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1); 425 we1 = sa1111_readl(mapbase + SA1111_WAKEEN1);
@@ -434,12 +434,12 @@ static int sa1111_wake_highirq(unsigned int irq, unsigned int on)
434 434
435static struct irq_chip sa1111_high_chip = { 435static struct irq_chip sa1111_high_chip = {
436 .name = "SA1111-h", 436 .name = "SA1111-h",
437 .ack = sa1111_ack_irq, 437 .irq_ack = sa1111_ack_irq,
438 .mask = sa1111_mask_highirq, 438 .irq_mask = sa1111_mask_highirq,
439 .unmask = sa1111_unmask_highirq, 439 .irq_unmask = sa1111_unmask_highirq,
440 .retrigger = sa1111_retrigger_highirq, 440 .irq_retrigger = sa1111_retrigger_highirq,
441 .set_type = sa1111_type_highirq, 441 .irq_set_type = sa1111_type_highirq,
442 .set_wake = sa1111_wake_highirq, 442 .irq_set_wake = sa1111_wake_highirq,
443}; 443};
444 444
445static void sa1111_setup_irq(struct sa1111 *sachip) 445static void sa1111_setup_irq(struct sa1111 *sachip)