v2.4.8 -> v2.4.8.1
[opensuse:kernel.git] / arch / arm / mach-anakin / irq.c
1 /*
2  *  linux/arch/arm/mach-anakin/irq.c
3  *
4  *  Copyright (C) 2001 Aleph One Ltd. for Acunia N.V.
5  *
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.
9  *
10  *  Changelog:
11  *   10-Apr-2001 TTC    Created
12  */
13
14 #include <linux/ptrace.h>
15 #include <linux/sched.h>
16 #include <linux/interrupt.h>
17 #include <linux/init.h>
18
19 #include <asm/irq.h>
20 #include <asm/mach/irq.h>
21
22 extern unsigned int anakin_irq_mask, anakin_active_irqs;
23 extern void do_IRQ(int, struct pt_regs *);
24
25 static void
26 anakin_mask_irq(unsigned int irq)
27 {
28         anakin_irq_mask &= ~(1 << irq);
29 }
30
31 static void
32 anakin_unmask_irq(unsigned int irq)
33 {
34         anakin_irq_mask |= (1 << irq);
35 }
36
37 /*
38  * This is a faked interrupt to deal with parallel interrupt requests
39  * on the Anakin.  Make sure that its interrupt number is not in any
40  * way conflicting with the hardware interrupt numbers!  Check
41  * IRQ_ANAKIN in linux/include/asm-arm/arch-anakin/irqs.h.
42  */
43 static void
44 anakin_interrupt(int irq, void *dev_id, struct pt_regs *regs)
45 {
46         for (irq = 0; irq < NR_IRQS; irq++)
47                 if (anakin_active_irqs & (1 << irq))
48                         do_IRQ(irq, regs);
49 }
50
51 static struct irqaction anakin_irq = {
52         name:           "Anakin IRQ",
53         handler:        anakin_interrupt,
54         flags:          SA_INTERRUPT
55 };
56  
57 void __init
58 irq_init_irq(void)
59 {
60         unsigned int irq;
61
62         for (irq = 0; irq < NR_IRQS; irq++) {
63                 switch (irq) {
64                 case IRQ_UART0:
65                 case IRQ_UART1:
66                 case IRQ_UART2:
67                 case IRQ_TICK:
68                 case IRQ_CODEC:
69                 case IRQ_UART4:
70                 case IRQ_TOUCHSCREEN:
71                 case IRQ_UART3:
72                 case IRQ_FIFO:
73                 case IRQ_CAN:
74                 case IRQ_COMPACTFLASH:
75                 case IRQ_BOSH:
76                 case IRQ_ANAKIN:
77                         irq_desc[irq].valid = 1;
78                         irq_desc[irq].mask_ack = anakin_mask_irq;
79                         irq_desc[irq].mask = anakin_mask_irq;
80                         irq_desc[irq].unmask = anakin_unmask_irq;
81                 }
82         }
83         setup_arm_irq(IRQ_ANAKIN, &anakin_irq);
84 }