aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh/intc/chip.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sh/intc/chip.c')
-rw-r--r--drivers/sh/intc/chip.c53
1 files changed, 30 insertions, 23 deletions
diff --git a/drivers/sh/intc/chip.c b/drivers/sh/intc/chip.c
index 35c03706cc21..de885a0f917a 100644
--- a/drivers/sh/intc/chip.c
+++ b/drivers/sh/intc/chip.c
@@ -12,15 +12,16 @@
12#include <linux/io.h> 12#include <linux/io.h>
13#include "internals.h" 13#include "internals.h"
14 14
15void _intc_enable(unsigned int irq, unsigned long handle) 15void _intc_enable(struct irq_data *data, unsigned long handle)
16{ 16{
17 unsigned int irq = data->irq;
17 struct intc_desc_int *d = get_intc_desc(irq); 18 struct intc_desc_int *d = get_intc_desc(irq);
18 unsigned long addr; 19 unsigned long addr;
19 unsigned int cpu; 20 unsigned int cpu;
20 21
21 for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) { 22 for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_E(handle)); cpu++) {
22#ifdef CONFIG_SMP 23#ifdef CONFIG_SMP
23 if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 24 if (!cpumask_test_cpu(cpu, data->affinity))
24 continue; 25 continue;
25#endif 26#endif
26 addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu); 27 addr = INTC_REG(d, _INTC_ADDR_E(handle), cpu);
@@ -31,15 +32,16 @@ void _intc_enable(unsigned int irq, unsigned long handle)
31 intc_balancing_enable(irq); 32 intc_balancing_enable(irq);
32} 33}
33 34
34static void intc_enable(unsigned int irq) 35static void intc_enable(struct irq_data *data)
35{ 36{
36 _intc_enable(irq, (unsigned long)get_irq_chip_data(irq)); 37 _intc_enable(data, (unsigned long)irq_data_get_irq_chip_data(data));
37} 38}
38 39
39static void intc_disable(unsigned int irq) 40static void intc_disable(struct irq_data *data)
40{ 41{
42 unsigned int irq = data->irq;
41 struct intc_desc_int *d = get_intc_desc(irq); 43 struct intc_desc_int *d = get_intc_desc(irq);
42 unsigned long handle = (unsigned long)get_irq_chip_data(irq); 44 unsigned long handle = (unsigned long)irq_data_get_irq_chip_data(data);
43 unsigned long addr; 45 unsigned long addr;
44 unsigned int cpu; 46 unsigned int cpu;
45 47
@@ -47,7 +49,7 @@ static void intc_disable(unsigned int irq)
47 49
48 for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) { 50 for (cpu = 0; cpu < SMP_NR(d, _INTC_ADDR_D(handle)); cpu++) {
49#ifdef CONFIG_SMP 51#ifdef CONFIG_SMP
50 if (!cpumask_test_cpu(cpu, irq_to_desc(irq)->affinity)) 52 if (!cpumask_test_cpu(cpu, data->affinity))
51 continue; 53 continue;
52#endif 54#endif
53 addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu); 55 addr = INTC_REG(d, _INTC_ADDR_D(handle), cpu);
@@ -56,7 +58,7 @@ static void intc_disable(unsigned int irq)
56 } 58 }
57} 59}
58 60
59static int intc_set_wake(unsigned int irq, unsigned int on) 61static int intc_set_wake(struct irq_data *data, unsigned int on)
60{ 62{
61 return 0; /* allow wakeup, but setup hardware in intc_suspend() */ 63 return 0; /* allow wakeup, but setup hardware in intc_suspend() */
62} 64}
@@ -67,24 +69,27 @@ static int intc_set_wake(unsigned int irq, unsigned int on)
67 * additional locking here at the intc desc level. The affinity mask is 69 * additional locking here at the intc desc level. The affinity mask is
68 * later tested in the enable/disable paths. 70 * later tested in the enable/disable paths.
69 */ 71 */
70static int intc_set_affinity(unsigned int irq, const struct cpumask *cpumask) 72static int intc_set_affinity(struct irq_data *data,
73 const struct cpumask *cpumask,
74 bool force)
71{ 75{
72 if (!cpumask_intersects(cpumask, cpu_online_mask)) 76 if (!cpumask_intersects(cpumask, cpu_online_mask))
73 return -1; 77 return -1;
74 78
75 cpumask_copy(irq_to_desc(irq)->affinity, cpumask); 79 cpumask_copy(data->affinity, cpumask);
76 80
77 return 0; 81 return 0;
78} 82}
79#endif 83#endif
80 84
81static void intc_mask_ack(unsigned int irq) 85static void intc_mask_ack(struct irq_data *data)
82{ 86{
87 unsigned int irq = data->irq;
83 struct intc_desc_int *d = get_intc_desc(irq); 88 struct intc_desc_int *d = get_intc_desc(irq);
84 unsigned long handle = intc_get_ack_handle(irq); 89 unsigned long handle = intc_get_ack_handle(irq);
85 unsigned long addr; 90 unsigned long addr;
86 91
87 intc_disable(irq); 92 intc_disable(data);
88 93
89 /* read register and write zero only to the associated bit */ 94 /* read register and write zero only to the associated bit */
90 if (handle) { 95 if (handle) {
@@ -144,6 +149,7 @@ static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp,
144int intc_set_priority(unsigned int irq, unsigned int prio) 149int intc_set_priority(unsigned int irq, unsigned int prio)
145{ 150{
146 struct intc_desc_int *d = get_intc_desc(irq); 151 struct intc_desc_int *d = get_intc_desc(irq);
152 struct irq_data *data = irq_get_irq_data(irq);
147 struct intc_handle_int *ihp; 153 struct intc_handle_int *ihp;
148 154
149 if (!intc_get_prio_level(irq) || prio <= 1) 155 if (!intc_get_prio_level(irq) || prio <= 1)
@@ -162,7 +168,7 @@ int intc_set_priority(unsigned int irq, unsigned int prio)
162 * priority level will be set during next enable() 168 * priority level will be set during next enable()
163 */ 169 */
164 if (_INTC_FN(ihp->handle) != REG_FN_ERR) 170 if (_INTC_FN(ihp->handle) != REG_FN_ERR)
165 _intc_enable(irq, ihp->handle); 171 _intc_enable(data, ihp->handle);
166 } 172 }
167 return 0; 173 return 0;
168} 174}
@@ -181,8 +187,9 @@ static unsigned char intc_irq_sense_table[IRQ_TYPE_SENSE_MASK + 1] = {
181#endif 187#endif
182}; 188};
183 189
184static int intc_set_type(unsigned int irq, unsigned int type) 190static int intc_set_type(struct irq_data *data, unsigned int type)
185{ 191{
192 unsigned int irq = data->irq;
186 struct intc_desc_int *d = get_intc_desc(irq); 193 struct intc_desc_int *d = get_intc_desc(irq);
187 unsigned char value = intc_irq_sense_table[type & IRQ_TYPE_SENSE_MASK]; 194 unsigned char value = intc_irq_sense_table[type & IRQ_TYPE_SENSE_MASK];
188 struct intc_handle_int *ihp; 195 struct intc_handle_int *ihp;
@@ -201,15 +208,15 @@ static int intc_set_type(unsigned int irq, unsigned int type)
201} 208}
202 209
203struct irq_chip intc_irq_chip = { 210struct irq_chip intc_irq_chip = {
204 .mask = intc_disable, 211 .irq_mask = intc_disable,
205 .unmask = intc_enable, 212 .irq_unmask = intc_enable,
206 .mask_ack = intc_mask_ack, 213 .irq_mask_ack = intc_mask_ack,
207 .enable = intc_enable, 214 .irq_enable = intc_enable,
208 .disable = intc_disable, 215 .irq_disable = intc_disable,
209 .shutdown = intc_disable, 216 .irq_shutdown = intc_disable,
210 .set_type = intc_set_type, 217 .irq_set_type = intc_set_type,
211 .set_wake = intc_set_wake, 218 .irq_set_wake = intc_set_wake,
212#ifdef CONFIG_SMP 219#ifdef CONFIG_SMP
213 .set_affinity = intc_set_affinity, 220 .irq_set_affinity = intc_set_affinity,
214#endif 221#endif
215}; 222};