Commit 36a8b8c399480b5388ddd198ead78c9dd0e50df0

Authored by GuanXuetao
1 parent 3ab457cadd

unicore32: modify function names and parameters for irq_chips

-- by advice with Thomas Gleixner

Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>

Showing 2 changed files with 42 additions and 41 deletions Side-by-side Diff

arch/unicore32/Kconfig
... ... @@ -10,6 +10,7 @@
10 10 select HAVE_KERNEL_LZMA
11 11 select GENERIC_FIND_FIRST_BIT
12 12 select GENERIC_IRQ_PROBE
  13 + select GENERIC_HARDIRQS_NO_DEPRECATED
13 14 select ARCH_WANT_FRAME_POINTERS
14 15 help
15 16 UniCore-32 is 32-bit Instruction Set Architecture,
arch/unicore32/kernel/irq.c
... ... @@ -42,14 +42,14 @@
42 42  
43 43 #define GPIO_MASK(irq) (1 << (irq - IRQ_GPIO0))
44 44  
45   -static int puv3_gpio_type(unsigned int irq, unsigned int type)
  45 +static int puv3_gpio_type(struct irq_data *d, unsigned int type)
46 46 {
47 47 unsigned int mask;
48 48  
49   - if (irq < IRQ_GPIOHIGH)
50   - mask = 1 << irq;
  49 + if (d->irq < IRQ_GPIOHIGH)
  50 + mask = 1 << d->irq;
51 51 else
52   - mask = GPIO_MASK(irq);
  52 + mask = GPIO_MASK(d->irq);
53 53  
54 54 if (type == IRQ_TYPE_PROBE) {
55 55 if ((GPIO_IRQ_rising_edge | GPIO_IRQ_falling_edge) & mask)
56 56  
57 57  
58 58  
59 59  
60 60  
61 61  
62 62  
63 63  
64 64  
... ... @@ -75,37 +75,37 @@
75 75 /*
76 76 * GPIO IRQs must be acknowledged. This is for IRQs from 0 to 7.
77 77 */
78   -static void puv3_low_gpio_ack(unsigned int irq)
  78 +static 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  
83   -static void puv3_low_gpio_mask(unsigned int irq)
  83 +static 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  
88   -static void puv3_low_gpio_unmask(unsigned int irq)
  88 +static 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  
93   -static int puv3_low_gpio_wake(unsigned int irq, unsigned int on)
  93 +static int puv3_low_gpio_wake(struct irq_data *d, unsigned int on)
94 94 {
95 95 if (on)
96   - PM_PWER |= 1 << irq;
  96 + PM_PWER |= 1 << d->irq;
97 97 else
98   - PM_PWER &= ~(1 << irq);
  98 + PM_PWER &= ~(1 << d->irq);
99 99 return 0;
100 100 }
101 101  
102 102 static struct irq_chip puv3_low_gpio_chip = {
103 103 .name = "GPIO-low",
104   - .ack = puv3_low_gpio_ack,
105   - .mask = puv3_low_gpio_mask,
106   - .unmask = puv3_low_gpio_unmask,
107   - .set_type = puv3_gpio_type,
108   - .set_wake = puv3_low_gpio_wake,
  104 + .irq_ack = puv3_low_gpio_ack,
  105 + .irq_mask = puv3_low_gpio_mask,
  106 + .irq_unmask = puv3_low_gpio_unmask,
  107 + .irq_set_type = puv3_gpio_type,
  108 + .irq_set_wake = puv3_low_gpio_wake,
109 109 };
110 110  
111 111 /*
112 112  
113 113  
114 114  
... ... @@ -142,16 +142,16 @@
142 142 * In addition, the IRQs are all collected up into one bit in the
143 143 * interrupt controller registers.
144 144 */
145   -static void puv3_high_gpio_ack(unsigned int irq)
  145 +static 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 149 GPIO_GEDR = mask;
150 150 }
151 151  
152   -static void puv3_high_gpio_mask(unsigned int irq)
  152 +static 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 156 GPIO_IRQ_mask &= ~mask;
157 157  
158 158  
... ... @@ -159,9 +159,9 @@
159 159 GPIO_GFER &= ~mask;
160 160 }
161 161  
162   -static void puv3_high_gpio_unmask(unsigned int irq)
  162 +static 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 166 GPIO_IRQ_mask |= mask;
167 167  
... ... @@ -169,7 +169,7 @@
169 169 GPIO_GFER = GPIO_IRQ_falling_edge & GPIO_IRQ_mask;
170 170 }
171 171  
172   -static int puv3_high_gpio_wake(unsigned int irq, unsigned int on)
  172 +static int puv3_high_gpio_wake(struct irq_data *d, unsigned int on)
173 173 {
174 174 if (on)
175 175 PM_PWER |= PM_PWER_GPIOHIGH;
176 176  
177 177  
178 178  
179 179  
180 180  
181 181  
... ... @@ -180,33 +180,33 @@
180 180  
181 181 static struct irq_chip puv3_high_gpio_chip = {
182 182 .name = "GPIO-high",
183   - .ack = puv3_high_gpio_ack,
184   - .mask = puv3_high_gpio_mask,
185   - .unmask = puv3_high_gpio_unmask,
186   - .set_type = puv3_gpio_type,
187   - .set_wake = puv3_high_gpio_wake,
  183 + .irq_ack = puv3_high_gpio_ack,
  184 + .irq_mask = puv3_high_gpio_mask,
  185 + .irq_unmask = puv3_high_gpio_unmask,
  186 + .irq_set_type = puv3_gpio_type,
  187 + .irq_set_wake = puv3_high_gpio_wake,
188 188 };
189 189  
190 190 /*
191 191 * We don't need to ACK IRQs on the PKUnity unless they're GPIOs
192 192 * this is for internal IRQs i.e. from 8 to 31.
193 193 */
194   -static void puv3_mask_irq(unsigned int irq)
  194 +static 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  
199   -static void puv3_unmask_irq(unsigned int irq)
  199 +static 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 205 * Apart form GPIOs, only the RTC alarm can be a wakeup event.
206 206 */
207   -static int puv3_set_wake(unsigned int irq, unsigned int on)
  207 +static 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 210 if (on)
211 211 PM_PWER |= PM_PWER_RTC;
212 212 else
... ... @@ -218,10 +218,10 @@
218 218  
219 219 static struct irq_chip puv3_normal_chip = {
220 220 .name = "PKUnity-v3",
221   - .ack = puv3_mask_irq,
222   - .mask = puv3_mask_irq,
223   - .unmask = puv3_unmask_irq,
224   - .set_wake = puv3_set_wake,
  221 + .irq_ack = puv3_mask_irq,
  222 + .irq_mask = puv3_mask_irq,
  223 + .irq_unmask = puv3_unmask_irq,
  224 + .irq_set_wake = puv3_set_wake,
225 225 };
226 226  
227 227 static struct resource irq_resource = {
... ... @@ -383,7 +383,7 @@
383 383 seq_printf(p, "%3d: ", i);
384 384 for_each_present_cpu(cpu)
385 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 387 seq_printf(p, " %s", action->name);
388 388 for (action = action->next; action; action = action->next)
389 389 seq_printf(p, ", %s", action->name);