aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2011-04-17 16:53:04 -0400
committerGeert Uytterhoeven <geert@linux-m68k.org>2011-11-08 16:35:47 -0500
commite8abf5e73cdb6c034d35ccba1f63a4801cd3dec5 (patch)
tree170de6cb1d0048757b2ab55b2a0bfeb87d274fd4 /arch
parent6549d537922da6a6893e9bc1be9c2b89db663719 (diff)
m68k/irq: Switch irq_chip methods to "struct irq_data *data"
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/m68k/amiga/amiints.c16
-rw-r--r--arch/m68k/amiga/cia.c25
-rw-r--r--arch/m68k/apollo/dn_ints.c8
-rw-r--r--arch/m68k/atari/ataints.c30
-rw-r--r--arch/m68k/include/asm/irq.h13
-rw-r--r--arch/m68k/kernel/ints.c23
-rw-r--r--arch/m68k/mac/macints.c14
-rw-r--r--arch/m68k/q40/q40ints.c28
-rw-r--r--arch/m68k/sun3/sun3ints.c14
9 files changed, 113 insertions, 58 deletions
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c
index 320c5d048dc7..09a695babfe9 100644
--- a/arch/m68k/amiga/amiints.c
+++ b/arch/m68k/amiga/amiints.c
@@ -45,8 +45,8 @@
45#include <asm/amigaints.h> 45#include <asm/amigaints.h>
46#include <asm/amipcmcia.h> 46#include <asm/amipcmcia.h>
47 47
48static void amiga_enable_irq(unsigned int irq); 48static void amiga_irq_enable(struct irq_data *data);
49static void amiga_disable_irq(unsigned int irq); 49static void amiga_irq_disable(struct irq_data *data);
50static irqreturn_t ami_int1(int irq, void *dev_id); 50static irqreturn_t ami_int1(int irq, void *dev_id);
51static irqreturn_t ami_int3(int irq, void *dev_id); 51static irqreturn_t ami_int3(int irq, void *dev_id);
52static irqreturn_t ami_int4(int irq, void *dev_id); 52static irqreturn_t ami_int4(int irq, void *dev_id);
@@ -54,8 +54,8 @@ static irqreturn_t ami_int5(int irq, void *dev_id);
54 54
55static struct irq_chip amiga_irq_chip = { 55static struct irq_chip amiga_irq_chip = {
56 .name = "amiga", 56 .name = "amiga",
57 .irq_enable = amiga_enable_irq, 57 .irq_enable = amiga_irq_enable,
58 .irq_disable = amiga_disable_irq, 58 .irq_disable = amiga_irq_disable,
59}; 59};
60 60
61/* 61/*
@@ -102,14 +102,14 @@ void __init amiga_init_IRQ(void)
102 * internal data, that may not be changed by the interrupt at the same time. 102 * internal data, that may not be changed by the interrupt at the same time.
103 */ 103 */
104 104
105static void amiga_enable_irq(unsigned int irq) 105static void amiga_irq_enable(struct irq_data *data)
106{ 106{
107 amiga_custom.intena = IF_SETCLR | (1 << (irq - IRQ_USER)); 107 amiga_custom.intena = IF_SETCLR | (1 << (data->irq - IRQ_USER));
108} 108}
109 109
110static void amiga_disable_irq(unsigned int irq) 110static void amiga_irq_disable(struct irq_data *data)
111{ 111{
112 amiga_custom.intena = 1 << (irq - IRQ_USER); 112 amiga_custom.intena = 1 << (data->irq - IRQ_USER);
113} 113}
114 114
115/* 115/*
diff --git a/arch/m68k/amiga/cia.c b/arch/m68k/amiga/cia.c
index 637ef53112b6..b04b453718d9 100644
--- a/arch/m68k/amiga/cia.c
+++ b/arch/m68k/amiga/cia.c
@@ -98,8 +98,9 @@ static irqreturn_t cia_handler(int irq, void *dev_id)
98 return IRQ_HANDLED; 98 return IRQ_HANDLED;
99} 99}
100 100
101static void cia_enable_irq(unsigned int irq) 101static void cia_irq_enable(struct irq_data *data)
102{ 102{
103 unsigned int irq = data->irq;
103 unsigned char mask; 104 unsigned char mask;
104 105
105 if (irq >= IRQ_AMIGA_CIAB) { 106 if (irq >= IRQ_AMIGA_CIAB) {
@@ -113,8 +114,10 @@ static void cia_enable_irq(unsigned int irq)
113 } 114 }
114} 115}
115 116
116static void cia_disable_irq(unsigned int irq) 117static void cia_irq_disable(struct irq_data *data)
117{ 118{
119 unsigned int irq = data->irq;
120
118 if (irq >= IRQ_AMIGA_CIAB) 121 if (irq >= IRQ_AMIGA_CIAB)
119 cia_able_irq(&ciab_base, 1 << (irq - IRQ_AMIGA_CIAB)); 122 cia_able_irq(&ciab_base, 1 << (irq - IRQ_AMIGA_CIAB));
120 else 123 else
@@ -123,8 +126,8 @@ static void cia_disable_irq(unsigned int irq)
123 126
124static struct irq_chip cia_irq_chip = { 127static struct irq_chip cia_irq_chip = {
125 .name = "cia", 128 .name = "cia",
126 .irq_enable = cia_enable_irq, 129 .irq_enable = cia_irq_enable,
127 .irq_disable = cia_disable_irq, 130 .irq_disable = cia_irq_disable,
128}; 131};
129 132
130/* 133/*
@@ -133,9 +136,9 @@ static struct irq_chip cia_irq_chip = {
133 * into this chain. 136 * into this chain.
134 */ 137 */
135 138
136static void auto_enable_irq(unsigned int irq) 139static void auto_irq_enable(struct irq_data *data)
137{ 140{
138 switch (irq) { 141 switch (data->irq) {
139 case IRQ_AUTO_2: 142 case IRQ_AUTO_2:
140 amiga_custom.intena = IF_SETCLR | IF_PORTS; 143 amiga_custom.intena = IF_SETCLR | IF_PORTS;
141 break; 144 break;
@@ -145,9 +148,9 @@ static void auto_enable_irq(unsigned int irq)
145 } 148 }
146} 149}
147 150
148static void auto_disable_irq(unsigned int irq) 151static void auto_irq_disable(struct irq_data *data)
149{ 152{
150 switch (irq) { 153 switch (data->irq) {
151 case IRQ_AUTO_2: 154 case IRQ_AUTO_2:
152 amiga_custom.intena = IF_PORTS; 155 amiga_custom.intena = IF_PORTS;
153 break; 156 break;
@@ -159,8 +162,8 @@ static void auto_disable_irq(unsigned int irq)
159 162
160static struct irq_chip auto_irq_chip = { 163static struct irq_chip auto_irq_chip = {
161 .name = "auto", 164 .name = "auto",
162 .irq_enable = auto_enable_irq, 165 .irq_enable = auto_irq_enable,
163 .irq_disable = auto_disable_irq, 166 .irq_disable = auto_irq_disable,
164}; 167};
165 168
166void __init cia_init_IRQ(struct ciabase *base) 169void __init cia_init_IRQ(struct ciabase *base)
@@ -173,7 +176,7 @@ void __init cia_init_IRQ(struct ciabase *base)
173 176
174 /* override auto int and install CIA handler */ 177 /* override auto int and install CIA handler */
175 m68k_setup_irq_chip(&auto_irq_chip, base->handler_irq, 1); 178 m68k_setup_irq_chip(&auto_irq_chip, base->handler_irq, 1);
176 m68k_irq_startup(base->handler_irq); 179 m68k_irq_startup_irq(base->handler_irq);
177 if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED, 180 if (request_irq(base->handler_irq, cia_handler, IRQF_SHARED,
178 base->name, base)) 181 base->name, base))
179 pr_err("Couldn't register %s interrupt\n", base->name); 182 pr_err("Couldn't register %s interrupt\n", base->name);
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c
index d6e8f33466be..2bdab498b6c1 100644
--- a/arch/m68k/apollo/dn_ints.c
+++ b/arch/m68k/apollo/dn_ints.c
@@ -12,8 +12,10 @@ void dn_process_int(unsigned int irq, struct pt_regs *fp)
12 *(volatile unsigned char *)(picb)=0x20; 12 *(volatile unsigned char *)(picb)=0x20;
13} 13}
14 14
15unsigned int apollo_irq_startup(unsigned int irq) 15unsigned int apollo_irq_startup(struct irq_data *data)
16{ 16{
17 unsigned int irq = data->irq;
18
17 if (irq < 8) 19 if (irq < 8)
18 *(volatile unsigned char *)(pica+1) &= ~(1 << irq); 20 *(volatile unsigned char *)(pica+1) &= ~(1 << irq);
19 else 21 else
@@ -21,8 +23,10 @@ unsigned int apollo_irq_startup(unsigned int irq)
21 return 0; 23 return 0;
22} 24}
23 25
24void apollo_irq_shutdown(unsigned int irq) 26void apollo_irq_shutdown(struct irq_data *data)
25{ 27{
28 unsigned int irq = data->irq;
29
26 if (irq < 8) 30 if (irq < 8)
27 *(volatile unsigned char *)(pica+1) |= (1 << irq); 31 *(volatile unsigned char *)(pica+1) |= (1 << irq);
28 else 32 else
diff --git a/arch/m68k/atari/ataints.c b/arch/m68k/atari/ataints.c
index ac0ebdf6ca72..7f4e5a9b77c5 100644
--- a/arch/m68k/atari/ataints.c
+++ b/arch/m68k/atari/ataints.c
@@ -320,30 +320,44 @@ extern void atari_microwire_cmd(int cmd);
320 320
321extern int atari_SCC_reset_done; 321extern int atari_SCC_reset_done;
322 322
323static unsigned int atari_startup_irq(unsigned int irq) 323static unsigned int atari_irq_startup(struct irq_data *data)
324{ 324{
325 m68k_irq_startup(irq); 325 unsigned int irq = data->irq;
326
327 m68k_irq_startup(data);
326 atari_turnon_irq(irq); 328 atari_turnon_irq(irq);
327 atari_enable_irq(irq); 329 atari_enable_irq(irq);
328 return 0; 330 return 0;
329} 331}
330 332
331static void atari_shutdown_irq(unsigned int irq) 333static void atari_irq_shutdown(struct irq_data *data)
332{ 334{
335 unsigned int irq = data->irq;
336
333 atari_disable_irq(irq); 337 atari_disable_irq(irq);
334 atari_turnoff_irq(irq); 338 atari_turnoff_irq(irq);
335 m68k_irq_shutdown(irq); 339 m68k_irq_shutdown(data);
336 340
337 if (irq == IRQ_AUTO_4) 341 if (irq == IRQ_AUTO_4)
338 vectors[VEC_INT4] = falcon_hblhandler; 342 vectors[VEC_INT4] = falcon_hblhandler;
339} 343}
340 344
345static void atari_irq_enable(struct irq_data *data)
346{
347 atari_enable_irq(data->irq);
348}
349
350static void atari_irq_disable(struct irq_data *data)
351{
352 atari_disable_irq(data->irq);
353}
354
341static struct irq_chip atari_irq_chip = { 355static struct irq_chip atari_irq_chip = {
342 .name = "atari", 356 .name = "atari",
343 .irq_startup = atari_startup_irq, 357 .irq_startup = atari_irq_startup,
344 .irq_shutdown = atari_shutdown_irq, 358 .irq_shutdown = atari_irq_shutdown,
345 .irq_enable = atari_enable_irq, 359 .irq_enable = atari_irq_enable,
346 .irq_disable = atari_disable_irq, 360 .irq_disable = atari_irq_disable,
347}; 361};
348 362
349/* 363/*
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h
index 3cb037c36d10..423f064955f2 100644
--- a/arch/m68k/include/asm/irq.h
+++ b/arch/m68k/include/asm/irq.h
@@ -96,14 +96,15 @@ struct irq_handler {
96 96
97struct irq_chip { 97struct irq_chip {
98 const char *name; 98 const char *name;
99 unsigned int (*irq_startup)(unsigned int irq); 99 unsigned int (*irq_startup)(struct irq_data *data);
100 void (*irq_shutdown)(unsigned int irq); 100 void (*irq_shutdown)(struct irq_data *data);
101 void (*irq_enable)(unsigned int irq); 101 void (*irq_enable)(struct irq_data *data);
102 void (*irq_disable)(unsigned int irq); 102 void (*irq_disable)(struct irq_data *data);
103}; 103};
104 104
105extern unsigned int m68k_irq_startup(unsigned int); 105extern unsigned int m68k_irq_startup(struct irq_data *data);
106extern void m68k_irq_shutdown(unsigned int); 106extern unsigned int m68k_irq_startup_irq(unsigned int irq);
107extern void m68k_irq_shutdown(struct irq_data *data);
107 108
108/* 109/*
109 * This function returns a new struct irq_data 110 * This function returns a new struct irq_data
diff --git a/arch/m68k/kernel/ints.c b/arch/m68k/kernel/ints.c
index 88779320d406..404d832f5d35 100644
--- a/arch/m68k/kernel/ints.c
+++ b/arch/m68k/kernel/ints.c
@@ -203,9 +203,9 @@ int setup_irq(unsigned int irq, struct irq_data *node)
203 203
204 if (!irq_list[irq]) { 204 if (!irq_list[irq]) {
205 if (contr->irq_startup) 205 if (contr->irq_startup)
206 contr->irq_startup(irq); 206 contr->irq_startup(node);
207 else 207 else
208 contr->irq_enable(irq); 208 contr->irq_enable(node);
209 } 209 }
210 node->next = NULL; 210 node->next = NULL;
211 *prev = node; 211 *prev = node;
@@ -270,9 +270,9 @@ void free_irq(unsigned int irq, void *dev_id)
270 270
271 if (!irq_list[irq]) { 271 if (!irq_list[irq]) {
272 if (contr->irq_shutdown) 272 if (contr->irq_shutdown)
273 contr->irq_shutdown(irq); 273 contr->irq_shutdown(node);
274 else 274 else
275 contr->irq_disable(irq); 275 contr->irq_disable(node);
276 } 276 }
277 277
278 local_irq_restore(flags); 278 local_irq_restore(flags);
@@ -295,7 +295,7 @@ void enable_irq(unsigned int irq)
295 if (irq_depth[irq]) { 295 if (irq_depth[irq]) {
296 if (!--irq_depth[irq]) { 296 if (!--irq_depth[irq]) {
297 if (contr->irq_enable) 297 if (contr->irq_enable)
298 contr->irq_enable(irq); 298 contr->irq_enable(irq_list[irq]);
299 } 299 }
300 } else 300 } else
301 WARN_ON(1); 301 WARN_ON(1);
@@ -318,7 +318,7 @@ void disable_irq(unsigned int irq)
318 local_irq_save(flags); 318 local_irq_save(flags);
319 if (!irq_depth[irq]++) { 319 if (!irq_depth[irq]++) {
320 if (contr->irq_disable) 320 if (contr->irq_disable)
321 contr->irq_disable(irq); 321 contr->irq_disable(irq_list[irq]);
322 } 322 }
323 local_irq_restore(flags); 323 local_irq_restore(flags);
324} 324}
@@ -329,7 +329,7 @@ void disable_irq_nosync(unsigned int irq) __attribute__((alias("disable_irq")));
329 329
330EXPORT_SYMBOL(disable_irq_nosync); 330EXPORT_SYMBOL(disable_irq_nosync);
331 331
332unsigned int m68k_irq_startup(unsigned int irq) 332unsigned int m68k_irq_startup_irq(unsigned int irq)
333{ 333{
334 if (irq <= IRQ_AUTO_7) 334 if (irq <= IRQ_AUTO_7)
335 vectors[VEC_SPUR + irq] = auto_inthandler; 335 vectors[VEC_SPUR + irq] = auto_inthandler;
@@ -338,8 +338,15 @@ unsigned int m68k_irq_startup(unsigned int irq)
338 return 0; 338 return 0;
339} 339}
340 340
341void m68k_irq_shutdown(unsigned int irq) 341unsigned int m68k_irq_startup(struct irq_data *data)
342{ 342{
343 return m68k_irq_startup_irq(data->irq);
344}
345
346void m68k_irq_shutdown(struct irq_data *data)
347{
348 unsigned int irq = data->irq;
349
343 if (irq <= IRQ_AUTO_7) 350 if (irq <= IRQ_AUTO_7)
344 vectors[VEC_SPUR + irq] = bad_inthandler; 351 vectors[VEC_SPUR + irq] = bad_inthandler;
345 else 352 else
diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c
index ffa1b3f7e2b7..3cee6d29cc5d 100644
--- a/arch/m68k/mac/macints.c
+++ b/arch/m68k/mac/macints.c
@@ -193,10 +193,20 @@ irqreturn_t mac_debug_handler(int, void *);
193void mac_enable_irq(unsigned int irq); 193void mac_enable_irq(unsigned int irq);
194void mac_disable_irq(unsigned int irq); 194void mac_disable_irq(unsigned int irq);
195 195
196static void mac_irq_enable(struct irq_data *data)
197{
198 mac_enable_irq(data->irq);
199}
200
201static void mac_irq_disable(struct irq_data *data)
202{
203 mac_disable_irq(data->irq);
204}
205
196static struct irq_chip mac_irq_chip = { 206static struct irq_chip mac_irq_chip = {
197 .name = "mac", 207 .name = "mac",
198 .irq_enable = mac_enable_irq, 208 .irq_enable = mac_irq_enable,
199 .irq_disable = mac_disable_irq, 209 .irq_disable = mac_irq_disable,
200}; 210};
201 211
202void __init mac_init_IRQ(void) 212void __init mac_init_IRQ(void)
diff --git a/arch/m68k/q40/q40ints.c b/arch/m68k/q40/q40ints.c
index fa05a03f8dfe..cb245f972e1a 100644
--- a/arch/m68k/q40/q40ints.c
+++ b/arch/m68k/q40/q40ints.c
@@ -35,14 +35,16 @@
35*/ 35*/
36 36
37static void q40_irq_handler(unsigned int, struct pt_regs *fp); 37static void q40_irq_handler(unsigned int, struct pt_regs *fp);
38static void q40_enable_irq(unsigned int); 38static void q40_irq_enable(struct irq_data *data);
39static void q40_disable_irq(unsigned int); 39static void q40_irq_disable(struct irq_data *data);
40 40
41unsigned short q40_ablecount[35]; 41unsigned short q40_ablecount[35];
42unsigned short q40_state[35]; 42unsigned short q40_state[35];
43 43
44static unsigned int q40_irq_startup(unsigned int irq) 44static unsigned int q40_irq_startup(struct irq_data *data)
45{ 45{
46 unsigned int irq = data->irq;
47
46 /* test for ISA ints not implemented by HW */ 48 /* test for ISA ints not implemented by HW */
47 switch (irq) { 49 switch (irq) {
48 case 1: case 2: case 8: case 9: 50 case 1: case 2: case 8: case 9:
@@ -53,7 +55,7 @@ static unsigned int q40_irq_startup(unsigned int irq)
53 return 0; 55 return 0;
54} 56}
55 57
56static void q40_irq_shutdown(unsigned int irq) 58static void q40_irq_shutdown(struct irq_data *data)
57{ 59{
58} 60}
59 61
@@ -61,8 +63,8 @@ static struct irq_chip q40_irq_chip = {
61 .name = "q40", 63 .name = "q40",
62 .irq_startup = q40_irq_startup, 64 .irq_startup = q40_irq_startup,
63 .irq_shutdown = q40_irq_shutdown, 65 .irq_shutdown = q40_irq_shutdown,
64 .irq_enable = q40_enable_irq, 66 .irq_enable = q40_irq_enable,
65 .irq_disable = q40_disable_irq, 67 .irq_disable = q40_irq_disable,
66}; 68};
67 69
68/* 70/*
@@ -85,8 +87,8 @@ void __init q40_init_IRQ(void)
85 /* setup handler for ISA ints */ 87 /* setup handler for ISA ints */
86 m68k_setup_auto_interrupt(q40_irq_handler); 88 m68k_setup_auto_interrupt(q40_irq_handler);
87 89
88 m68k_irq_startup(IRQ_AUTO_2); 90 m68k_irq_startup_irq(IRQ_AUTO_2);
89 m68k_irq_startup(IRQ_AUTO_4); 91 m68k_irq_startup_irq(IRQ_AUTO_4);
90 92
91 /* now enable some ints.. */ 93 /* now enable some ints.. */
92 master_outb(1, EXT_ENABLE_REG); /* ISA IRQ 5-15 */ 94 master_outb(1, EXT_ENABLE_REG); /* ISA IRQ 5-15 */
@@ -292,20 +294,24 @@ static void q40_irq_handler(unsigned int irq, struct pt_regs *fp)
292 return; 294 return;
293} 295}
294 296
295void q40_enable_irq(unsigned int irq) 297void q40_irq_enable(struct irq_data *data)
296{ 298{
299 unsigned int irq = data->irq;
300
297 if (irq >= 5 && irq <= 15) { 301 if (irq >= 5 && irq <= 15) {
298 mext_disabled--; 302 mext_disabled--;
299 if (mext_disabled > 0) 303 if (mext_disabled > 0)
300 printk("q40_enable_irq : nested disable/enable\n"); 304 printk("q40_irq_enable : nested disable/enable\n");
301 if (mext_disabled == 0) 305 if (mext_disabled == 0)
302 master_outb(1, EXT_ENABLE_REG); 306 master_outb(1, EXT_ENABLE_REG);
303 } 307 }
304} 308}
305 309
306 310
307void q40_disable_irq(unsigned int irq) 311void q40_irq_disable(struct irq_data *data)
308{ 312{
313 unsigned int irq = data->irq;
314
309 /* disable ISA iqs : only do something if the driver has been 315 /* disable ISA iqs : only do something if the driver has been
310 * verified to be Q40 "compatible" - right now IDE, NE2K 316 * verified to be Q40 "compatible" - right now IDE, NE2K
311 * Any driver should not attempt to sleep across disable_irq !! 317 * Any driver should not attempt to sleep across disable_irq !!
diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c
index 97fa9edc5a9d..5d45e0065d2e 100644
--- a/arch/m68k/sun3/sun3ints.c
+++ b/arch/m68k/sun3/sun3ints.c
@@ -86,12 +86,22 @@ static void sun3_inthandle(unsigned int irq, struct pt_regs *fp)
86 __m68k_handle_int(irq, fp); 86 __m68k_handle_int(irq, fp);
87} 87}
88 88
89static void sun3_irq_enable(struct irq_data *data)
90{
91 sun3_enable_irq(data->irq);
92};
93
94static void sun3_irq_disable(struct irq_data *data)
95{
96 sun3_disable_irq(data->irq);
97};
98
89static struct irq_chip sun3_irq_chip = { 99static struct irq_chip sun3_irq_chip = {
90 .name = "sun3", 100 .name = "sun3",
91 .irq_startup = m68k_irq_startup, 101 .irq_startup = m68k_irq_startup,
92 .irq_shutdown = m68k_irq_shutdown, 102 .irq_shutdown = m68k_irq_shutdown,
93 .irq_enable = sun3_enable_irq, 103 .irq_enable = sun3_irq_enable,
94 .irq_disable = sun3_disable_irq, 104 .irq_disable = sun3_irq_disable,
95}; 105};
96 106
97void __init sun3_init_IRQ(void) 107void __init sun3_init_IRQ(void)