aboutsummaryrefslogtreecommitdiffstats
path: root/arch/unicore32/kernel
diff options
context:
space:
mode:
authorGuanXuetao <gxt@mprc.pku.edu.cn>2011-02-17 06:15:36 -0500
committerGuanXuetao <gxt@mprc.pku.edu.cn>2011-03-16 21:19:17 -0400
commit36a8b8c399480b5388ddd198ead78c9dd0e50df0 (patch)
tree65bc3c63e75606275449381b218e4009384be586 /arch/unicore32/kernel
parent3ab457cadd15bb388b200813222af1d5fb71c9d6 (diff)
unicore32: modify function names and parameters for irq_chips
-- by advice with Thomas Gleixner Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Diffstat (limited to 'arch/unicore32/kernel')
-rw-r--r--arch/unicore32/kernel/irq.c82
1 files changed, 41 insertions, 41 deletions
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c
index 7c211f59783..38e30897dea 100644
--- a/arch/unicore32/kernel/irq.c
+++ b/arch/unicore32/kernel/irq.c
@@ -42,14 +42,14 @@ static int GPIO_IRQ_mask = 0;
42 42
43#define GPIO_MASK(irq) (1 << (irq - IRQ_GPIO0)) 43#define GPIO_MASK(irq) (1 << (irq - IRQ_GPIO0))
44 44
45static int puv3_gpio_type(unsigned int irq, unsigned int type) 45static int puv3_gpio_type(struct irq_data *d, unsigned int type)
46{ 46{
47 unsigned int mask; 47 unsigned int mask;
48 48
49 if (irq < IRQ_GPIOHIGH) 49 if (d->irq < IRQ_GPIOHIGH)
50 mask = 1 << irq; 50 mask = 1 << d->irq;
51 else 51 else
52 mask = GPIO_MASK(irq); 52 mask = GPIO_MASK(d->irq);
53 53
54 if (type == IRQ_TYPE_PROBE) { 54 if (type == IRQ_TYPE_PROBE) {
55 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask) 55 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
@@ -75,37 +75,37 @@ static int puv3_gpio_type(unsigned int irq, unsigned int type)
75/* 75/*
76 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 7. 76 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 7.
77 */ 77 */
78static void puv3_low_gpio_ack(unsigned int irq) 78static void puv3_low_gpio_ack(struct irq_data *d)
79{ 79{
80 GPIO_GEDR = (1 << irq); 80 GPIO_GEDR = (1 << d->irq);
81} 81}
82 82
83static void puv3_low_gpio_mask(unsigned int irq) 83static void puv3_low_gpio_mask(struct irq_data *d)
84{ 84{
85 INTC_ICMR &= ~(1 << irq); 85 INTC_ICMR &= ~(1 << d->irq);
86} 86}
87 87
88static void puv3_low_gpio_unmask(unsigned int irq) 88static void puv3_low_gpio_unmask(struct irq_data *d)
89{ 89{
90 INTC_ICMR |= 1 << irq; 90 INTC_ICMR |= 1 << d->irq;
91} 91}
92 92
93static int puv3_low_gpio_wake(unsigned int irq, unsigned int on) 93static int puv3_low_gpio_wake(struct irq_data *d, unsigned int on)
94{ 94{
95 if (on) 95 if (on)
96 PM_PWER |= 1 << irq; 96 PM_PWER |= 1 << d->irq;
97 else 97 else
98 PM_PWER &= ~(1 << irq); 98 PM_PWER &= ~(1 << d->irq);
99 return 0; 99 return 0;
100} 100}
101 101
102static struct irq_chip puv3_low_gpio_chip = { 102static struct irq_chip puv3_low_gpio_chip = {
103 .name = "GPIO-low", 103 .name = "GPIO-low",
104 .ack = puv3_low_gpio_ack, 104 .irq_ack = puv3_low_gpio_ack,
105 .mask = puv3_low_gpio_mask, 105 .irq_mask = puv3_low_gpio_mask,
106 .unmask = puv3_low_gpio_unmask, 106 .irq_unmask = puv3_low_gpio_unmask,
107 .set_type = puv3_gpio_type, 107 .irq_set_type = puv3_gpio_type,
108 .set_wake = puv3_low_gpio_wake, 108 .irq_set_wake = puv3_low_gpio_wake,
109}; 109};
110 110
111/* 111/*
@@ -142,16 +142,16 @@ puv3_gpio_handler(unsigned int irq, struct irq_desc *desc)
142 * In addition, the IRQs are all collected up into one bit in the 142 * In addition, the IRQs are all collected up into one bit in the
143 * interrupt controller registers. 143 * interrupt controller registers.
144 */ 144 */
145static void puv3_high_gpio_ack(unsigned int irq) 145static void puv3_high_gpio_ack(struct irq_data *d)
146{ 146{
147 unsigned int mask = GPIO_MASK(irq); 147 unsigned int mask = GPIO_MASK(d->irq);
148 148
149 GPIO_GEDR = mask; 149 GPIO_GEDR = mask;
150} 150}
151 151
152static void puv3_high_gpio_mask(unsigned int irq) 152static void puv3_high_gpio_mask(struct irq_data *d)
153{ 153{
154 unsigned int mask = GPIO_MASK(irq); 154 unsigned int mask = GPIO_MASK(d->irq);
155 155
156 GPIO_IRQ_mask &= ~mask; 156 GPIO_IRQ_mask &= ~mask;
157 157
@@ -159,9 +159,9 @@ static void puv3_high_gpio_mask(unsigned int irq)
159 GPIO_GFER &= ~mask; 159 GPIO_GFER &= ~mask;
160} 160}
161 161
162static void puv3_high_gpio_unmask(unsigned int irq) 162static void puv3_high_gpio_unmask(struct irq_data *d)
163{ 163{
164 unsigned int mask = GPIO_MASK(irq); 164 unsigned int mask = GPIO_MASK(d->irq);
165 165
166 GPIO_IRQ_mask |= mask; 166 GPIO_IRQ_mask |= mask;
167 167
@@ -169,7 +169,7 @@ static void puv3_high_gpio_unmask(unsigned int irq)
169 GPIO_GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask; 169 GPIO_GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
170} 170}
171 171
172static int puv3_high_gpio_wake(unsigned int irq, unsigned int on) 172static int puv3_high_gpio_wake(struct irq_data *d, unsigned int on)
173{ 173{
174 if (on) 174 if (on)
175 PM_PWER |= PM_PWER_GPIOHIGH; 175 PM_PWER |= PM_PWER_GPIOHIGH;
@@ -180,33 +180,33 @@ static int puv3_high_gpio_wake(unsigned int irq, unsigned int on)
180 180
181static struct irq_chip puv3_high_gpio_chip = { 181static struct irq_chip puv3_high_gpio_chip = {
182 .name = "GPIO-high", 182 .name = "GPIO-high",
183 .ack = puv3_high_gpio_ack, 183 .irq_ack = puv3_high_gpio_ack,
184 .mask = puv3_high_gpio_mask, 184 .irq_mask = puv3_high_gpio_mask,
185 .unmask = puv3_high_gpio_unmask, 185 .irq_unmask = puv3_high_gpio_unmask,
186 .set_type = puv3_gpio_type, 186 .irq_set_type = puv3_gpio_type,
187 .set_wake = puv3_high_gpio_wake, 187 .irq_set_wake = puv3_high_gpio_wake,
188}; 188};
189 189
190/* 190/*
191 * We don't need to ACK IRQs on the PKUnity unless they're GPIOs 191 * We don't need to ACK IRQs on the PKUnity unless they're GPIOs
192 * this is for internal IRQs i.e. from 8 to 31. 192 * this is for internal IRQs i.e. from 8 to 31.
193 */ 193 */
194static void puv3_mask_irq(unsigned int irq) 194static void puv3_mask_irq(struct irq_data *d)
195{ 195{
196 INTC_ICMR &= ~(1 << irq); 196 INTC_ICMR &= ~(1 << d->irq);
197} 197}
198 198
199static void puv3_unmask_irq(unsigned int irq) 199static void puv3_unmask_irq(struct irq_data *d)
200{ 200{
201 INTC_ICMR |= (1 << irq); 201 INTC_ICMR |= (1 << d->irq);
202} 202}
203 203
204/* 204/*
205 * Apart form GPIOs, only the RTC alarm can be a wakeup event. 205 * Apart form GPIOs, only the RTC alarm can be a wakeup event.
206 */ 206 */
207static int puv3_set_wake(unsigned int irq, unsigned int on) 207static int puv3_set_wake(struct irq_data *d, unsigned int on)
208{ 208{
209 if (irq == IRQ_RTCAlarm) { 209 if (d->irq == IRQ_RTCAlarm) {
210 if (on) 210 if (on)
211 PM_PWER |= PM_PWER_RTC; 211 PM_PWER |= PM_PWER_RTC;
212 else 212 else
@@ -218,10 +218,10 @@ static int puv3_set_wake(unsigned int irq, unsigned int on)
218 218
219static struct irq_chip puv3_normal_chip = { 219static struct irq_chip puv3_normal_chip = {
220 .name = "PKUnity-v3", 220 .name = "PKUnity-v3",
221 .ack = puv3_mask_irq, 221 .irq_ack = puv3_mask_irq,
222 .mask = puv3_mask_irq, 222 .irq_mask = puv3_mask_irq,
223 .unmask = puv3_unmask_irq, 223 .irq_unmask = puv3_unmask_irq,
224 .set_wake = puv3_set_wake, 224 .irq_set_wake = puv3_set_wake,
225}; 225};
226 226
227static struct resource irq_resource = { 227static struct resource irq_resource = {
@@ -383,7 +383,7 @@ int show_interrupts(struct seq_file *p, void *v)
383 seq_printf(p, "%3d: ", i); 383 seq_printf(p, "%3d: ", i);
384 for_each_present_cpu(cpu) 384 for_each_present_cpu(cpu)
385 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); 385 seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu));
386 seq_printf(p, " %10s", desc->chip->name ? : "-"); 386 seq_printf(p, " %10s", desc->irq_data.chip->name ? : "-");
387 seq_printf(p, " %s", action->name); 387 seq_printf(p, " %s", action->name);
388 for (action = action->next; action; action = action->next) 388 for (action = action->next; action; action = action->next)
389 seq_printf(p, ", %s", action->name); 389 seq_printf(p, ", %s", action->name);