diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-05-31 05:11:01 -0400 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2011-11-08 16:35:49 -0500 |
commit | 92b1bd5f1aa88ce4760c02814bfcbb58ad521984 (patch) | |
tree | b643113beec42f4b5698959d0f52105d1e52b13a /arch/m68k | |
parent | 34971bad3a1511db7b76eeb2337819967a135075 (diff) |
m68k/amiga: Refactor amiints.c
- Remove filename in comments,
- Reorder functions so we no longer need forward declarations.
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/amiga/amiints.c | 98 |
1 files changed, 47 insertions, 51 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index e5f3033499e7..c8f9eac121a1 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/m68k/amiga/amiints.c -- Amiga Linux interrupt handling code | 2 | * Amiga Linux interrupt handling code |
3 | * | 3 | * |
4 | * This file is subject to the terms and conditions of the GNU General Public | 4 | * This file is subject to the terms and conditions of the GNU General Public |
5 | * License. See the file COPYING in the main directory of this archive | 5 | * License. See the file COPYING in the main directory of this archive |
@@ -16,56 +16,6 @@ | |||
16 | #include <asm/amigaints.h> | 16 | #include <asm/amigaints.h> |
17 | #include <asm/amipcmcia.h> | 17 | #include <asm/amipcmcia.h> |
18 | 18 | ||
19 | static void amiga_irq_enable(struct irq_data *data); | ||
20 | static void amiga_irq_disable(struct irq_data *data); | ||
21 | static irqreturn_t ami_int1(int irq, void *dev_id); | ||
22 | static irqreturn_t ami_int3(int irq, void *dev_id); | ||
23 | static irqreturn_t ami_int4(int irq, void *dev_id); | ||
24 | static irqreturn_t ami_int5(int irq, void *dev_id); | ||
25 | |||
26 | static struct irq_chip amiga_irq_chip = { | ||
27 | .name = "amiga", | ||
28 | .irq_enable = amiga_irq_enable, | ||
29 | .irq_disable = amiga_irq_disable, | ||
30 | }; | ||
31 | |||
32 | /* | ||
33 | * void amiga_init_IRQ(void) | ||
34 | * | ||
35 | * Parameters: None | ||
36 | * | ||
37 | * Returns: Nothing | ||
38 | * | ||
39 | * This function should be called during kernel startup to initialize | ||
40 | * the amiga IRQ handling routines. | ||
41 | */ | ||
42 | |||
43 | void __init amiga_init_IRQ(void) | ||
44 | { | ||
45 | if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL)) | ||
46 | pr_err("Couldn't register int%d\n", 1); | ||
47 | if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL)) | ||
48 | pr_err("Couldn't register int%d\n", 3); | ||
49 | if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL)) | ||
50 | pr_err("Couldn't register int%d\n", 4); | ||
51 | if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL)) | ||
52 | pr_err("Couldn't register int%d\n", 5); | ||
53 | |||
54 | m68k_setup_irq_controller(&amiga_irq_chip, handle_simple_irq, IRQ_USER, | ||
55 | AMI_STD_IRQS); | ||
56 | |||
57 | /* turn off PCMCIA interrupts */ | ||
58 | if (AMIGAHW_PRESENT(PCMCIA)) | ||
59 | gayle.inten = GAYLE_IRQ_IDE; | ||
60 | |||
61 | /* turn off all interrupts and enable the master interrupt bit */ | ||
62 | amiga_custom.intena = 0x7fff; | ||
63 | amiga_custom.intreq = 0x7fff; | ||
64 | amiga_custom.intena = IF_SETCLR | IF_INTEN; | ||
65 | |||
66 | cia_init_IRQ(&ciaa_base); | ||
67 | cia_init_IRQ(&ciab_base); | ||
68 | } | ||
69 | 19 | ||
70 | /* | 20 | /* |
71 | * Enable/disable a particular machine specific interrupt source. | 21 | * Enable/disable a particular machine specific interrupt source. |
@@ -84,6 +34,13 @@ static void amiga_irq_disable(struct irq_data *data) | |||
84 | amiga_custom.intena = 1 << (data->irq - IRQ_USER); | 34 | amiga_custom.intena = 1 << (data->irq - IRQ_USER); |
85 | } | 35 | } |
86 | 36 | ||
37 | static struct irq_chip amiga_irq_chip = { | ||
38 | .name = "amiga", | ||
39 | .irq_enable = amiga_irq_enable, | ||
40 | .irq_disable = amiga_irq_disable, | ||
41 | }; | ||
42 | |||
43 | |||
87 | /* | 44 | /* |
88 | * The builtin Amiga hardware interrupt handlers. | 45 | * The builtin Amiga hardware interrupt handlers. |
89 | */ | 46 | */ |
@@ -183,3 +140,42 @@ static irqreturn_t ami_int5(int irq, void *dev_id) | |||
183 | } | 140 | } |
184 | return IRQ_HANDLED; | 141 | return IRQ_HANDLED; |
185 | } | 142 | } |
143 | |||
144 | |||
145 | /* | ||
146 | * void amiga_init_IRQ(void) | ||
147 | * | ||
148 | * Parameters: None | ||
149 | * | ||
150 | * Returns: Nothing | ||
151 | * | ||
152 | * This function should be called during kernel startup to initialize | ||
153 | * the amiga IRQ handling routines. | ||
154 | */ | ||
155 | |||
156 | void __init amiga_init_IRQ(void) | ||
157 | { | ||
158 | if (request_irq(IRQ_AUTO_1, ami_int1, 0, "int1", NULL)) | ||
159 | pr_err("Couldn't register int%d\n", 1); | ||
160 | if (request_irq(IRQ_AUTO_3, ami_int3, 0, "int3", NULL)) | ||
161 | pr_err("Couldn't register int%d\n", 3); | ||
162 | if (request_irq(IRQ_AUTO_4, ami_int4, 0, "int4", NULL)) | ||
163 | pr_err("Couldn't register int%d\n", 4); | ||
164 | if (request_irq(IRQ_AUTO_5, ami_int5, 0, "int5", NULL)) | ||
165 | pr_err("Couldn't register int%d\n", 5); | ||
166 | |||
167 | m68k_setup_irq_controller(&amiga_irq_chip, handle_simple_irq, IRQ_USER, | ||
168 | AMI_STD_IRQS); | ||
169 | |||
170 | /* turn off PCMCIA interrupts */ | ||
171 | if (AMIGAHW_PRESENT(PCMCIA)) | ||
172 | gayle.inten = GAYLE_IRQ_IDE; | ||
173 | |||
174 | /* turn off all interrupts and enable the master interrupt bit */ | ||
175 | amiga_custom.intena = 0x7fff; | ||
176 | amiga_custom.intreq = 0x7fff; | ||
177 | amiga_custom.intena = IF_SETCLR | IF_INTEN; | ||
178 | |||
179 | cia_init_IRQ(&ciaa_base); | ||
180 | cia_init_IRQ(&ciab_base); | ||
181 | } | ||