Fix IP22 timer calibration.
[linux-2.6/linux-mips.git] / arch / arm / mach-anakin / irq.c
blobfcf335fadc5834b559edf15dce9cfdd619f91902
1 /*
2 * linux/arch/arm/mach-anakin/irq.c
4 * Copyright (C) 2001 Aleph One Ltd. for Acunia N.V.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Changelog:
11 * 10-Apr-2001 TTC Created
14 #include <linux/ptrace.h>
15 #include <linux/interrupt.h>
16 #include <linux/init.h>
18 #include <asm/irq.h>
19 #include <asm/mach/irq.h>
21 extern unsigned int anakin_irq_mask, anakin_active_irqs;
22 extern void do_IRQ(int, struct pt_regs *);
24 static void
25 anakin_mask_irq(unsigned int irq)
27 anakin_irq_mask &= ~(1 << irq);
30 static void
31 anakin_unmask_irq(unsigned int irq)
33 anakin_irq_mask |= (1 << irq);
37 * This is a faked interrupt to deal with parallel interrupt requests
38 * on the Anakin. Make sure that its interrupt number is not in any
39 * way conflicting with the hardware interrupt numbers! Check
40 * IRQ_ANAKIN in linux/include/asm-arm/arch-anakin/irqs.h.
42 static void
43 anakin_interrupt(int irq, void *dev_id, struct pt_regs *regs)
45 for (irq = 0; irq < NR_IRQS; irq++)
46 if (anakin_active_irqs & (1 << irq))
47 do_IRQ(irq, regs);
50 static struct irqaction anakin_irq = {
51 .name = "Anakin IRQ",
52 .handler = anakin_interrupt,
53 .flags = SA_INTERRUPT
56 void __init
57 irq_init_irq(void)
59 unsigned int irq;
61 for (irq = 0; irq < NR_IRQS; irq++) {
62 switch (irq) {
63 case IRQ_UART0:
64 case IRQ_UART1:
65 case IRQ_UART2:
66 case IRQ_TICK:
67 case IRQ_CODEC:
68 case IRQ_UART4:
69 case IRQ_TOUCHSCREEN:
70 case IRQ_UART3:
71 case IRQ_FIFO:
72 case IRQ_CAN:
73 case IRQ_COMPACTFLASH:
74 case IRQ_BOSH:
75 case IRQ_ANAKIN:
76 irq_desc[irq].valid = 1;
77 irq_desc[irq].mask_ack = anakin_mask_irq;
78 irq_desc[irq].mask = anakin_mask_irq;
79 irq_desc[irq].unmask = anakin_unmask_irq;
82 setup_arm_irq(IRQ_ANAKIN, &anakin_irq);