[MIPS] Vr41xx: Fix after GENERIC_HARDIRQS_NO__DO_IRQ change

Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by Yoichi Yuasa and committed by Ralf Baechle 364ca8a8 ac8be955

+61 -65
+9 -3
arch/mips/vr41xx/common/irq.c
··· 1 /* 2 * Interrupt handing routines for NEC VR4100 series. 3 * 4 - * Copyright (C) 2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by ··· 73 if (cascade->get_irq != NULL) { 74 unsigned int source_irq = irq; 75 desc = irq_desc + source_irq; 76 - desc->chip->ack(source_irq); 77 irq = cascade->get_irq(irq); 78 if (irq < 0) 79 atomic_inc(&irq_err_count); 80 else 81 irq_dispatch(irq); 82 - desc->chip->end(source_irq); 83 } else 84 do_IRQ(irq); 85 }
··· 1 /* 2 * Interrupt handing routines for NEC VR4100 series. 3 * 4 + * Copyright (C) 2005-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by ··· 73 if (cascade->get_irq != NULL) { 74 unsigned int source_irq = irq; 75 desc = irq_desc + source_irq; 76 + if (desc->chip->mask_ack) 77 + desc->chip->mask_ack(source_irq); 78 + else { 79 + desc->chip->mask(source_irq); 80 + desc->chip->ack(source_irq); 81 + } 82 irq = cascade->get_irq(irq); 83 if (irq < 0) 84 atomic_inc(&irq_err_count); 85 else 86 irq_dispatch(irq); 87 + if (!(desc->status & IRQ_DISABLED) && desc->chip->unmask) 88 + desc->chip->unmask(source_irq); 89 } else 90 do_IRQ(irq); 91 }
+52 -62
drivers/char/vr41xx_giu.c
··· 3 * 4 * Copyright (C) 2002 MontaVista Software Inc. 5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 6 - * Copyright (C) 2003-2005 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by ··· 125 return data; 126 } 127 128 - static unsigned int startup_giuint_low_irq(unsigned int irq) 129 { 130 - unsigned int pin; 131 - 132 - pin = GPIO_PIN_OF_IRQ(irq); 133 - giu_write(GIUINTSTATL, 1 << pin); 134 - giu_set(GIUINTENL, 1 << pin); 135 - 136 - return 0; 137 } 138 139 - static void shutdown_giuint_low_irq(unsigned int irq) 140 { 141 giu_clear(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); 142 } 143 144 - static void enable_giuint_low_irq(unsigned int irq) 145 - { 146 - giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); 147 - } 148 - 149 - #define disable_giuint_low_irq shutdown_giuint_low_irq 150 - 151 - static void ack_giuint_low_irq(unsigned int irq) 152 { 153 unsigned int pin; 154 ··· 144 giu_write(GIUINTSTATL, 1 << pin); 145 } 146 147 - static void end_giuint_low_irq(unsigned int irq) 148 { 149 - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 150 - giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); 151 } 152 153 - static struct hw_interrupt_type giuint_low_irq_type = { 154 - .typename = "GIUINTL", 155 - .startup = startup_giuint_low_irq, 156 - .shutdown = shutdown_giuint_low_irq, 157 - .enable = enable_giuint_low_irq, 158 - .disable = disable_giuint_low_irq, 159 - .ack = ack_giuint_low_irq, 160 - .end = end_giuint_low_irq, 161 }; 162 163 - static unsigned int startup_giuint_high_irq(unsigned int irq) 164 { 165 - unsigned int pin; 166 - 167 - pin = GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET; 168 - giu_write(GIUINTSTATH, 1 << pin); 169 - giu_set(GIUINTENH, 1 << pin); 170 - 171 - return 0; 172 } 173 174 - static void shutdown_giuint_high_irq(unsigned int irq) 175 { 176 giu_clear(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 177 } 178 179 - static void enable_giuint_high_irq(unsigned int irq) 180 - { 181 - giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 182 - } 183 - 184 - #define disable_giuint_high_irq shutdown_giuint_high_irq 185 - 186 - static void ack_giuint_high_irq(unsigned int irq) 187 { 188 unsigned int pin; 189 ··· 176 giu_write(GIUINTSTATH, 1 << pin); 177 } 178 179 - static void end_giuint_high_irq(unsigned int irq) 180 { 181 - if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) 182 - giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 183 } 184 185 - static struct hw_interrupt_type giuint_high_irq_type = { 186 - .typename = "GIUINTH", 187 - .startup = startup_giuint_high_irq, 188 - .shutdown = shutdown_giuint_high_irq, 189 - .enable = enable_giuint_high_irq, 190 - .disable = disable_giuint_high_irq, 191 - .ack = ack_giuint_high_irq, 192 - .end = end_giuint_high_irq, 193 }; 194 195 static int giu_get_irq(unsigned int irq) ··· 250 break; 251 } 252 } 253 } else { 254 giu_clear(GIUINTTYPL, mask); 255 giu_clear(GIUINTHTSELL, mask); 256 } 257 giu_write(GIUINTSTATL, mask); 258 } else if (pin < GIUINT_HIGH_MAX) { ··· 285 break; 286 } 287 } 288 } else { 289 giu_clear(GIUINTTYPH, mask); 290 giu_clear(GIUINTHTSELH, mask); 291 } 292 giu_write(GIUINTSTATH, mask); 293 } ··· 597 static int __devinit giu_probe(struct platform_device *dev) 598 { 599 unsigned long start, size, flags = 0; 600 - unsigned int nr_pins = 0; 601 struct resource *res1, *res2 = NULL; 602 void *base; 603 - int retval, i; 604 605 switch (current_cpu_data.cputype) { 606 case CPU_VR4111: ··· 669 giu_write(GIUINTENL, 0); 670 giu_write(GIUINTENH, 0); 671 672 for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) { 673 - if (i < GIU_IRQ(GIUINT_HIGH_OFFSET)) 674 - irq_desc[i].chip = &giuint_low_irq_type; 675 else 676 - irq_desc[i].chip = &giuint_high_irq_type; 677 } 678 679 return cascade_irq(GIUINT_IRQ, giu_get_irq);
··· 3 * 4 * Copyright (C) 2002 MontaVista Software Inc. 5 * Author: Yoichi Yuasa <yyuasa@mvista.com or source@mvista.com> 6 + * Copyright (C) 2003-2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by ··· 125 return data; 126 } 127 128 + static void ack_giuint_low(unsigned int irq) 129 { 130 + giu_write(GIUINTSTATL, 1 << GPIO_PIN_OF_IRQ(irq)); 131 } 132 133 + static void mask_giuint_low(unsigned int irq) 134 { 135 giu_clear(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); 136 } 137 138 + static void mask_ack_giuint_low(unsigned int irq) 139 { 140 unsigned int pin; 141 ··· 157 giu_write(GIUINTSTATL, 1 << pin); 158 } 159 160 + static void unmask_giuint_low(unsigned int irq) 161 { 162 + giu_set(GIUINTENL, 1 << GPIO_PIN_OF_IRQ(irq)); 163 } 164 165 + static struct irq_chip giuint_low_irq_chip = { 166 + .name = "GIUINTL", 167 + .ack = ack_giuint_low, 168 + .mask = mask_giuint_low, 169 + .mask_ack = mask_ack_giuint_low, 170 + .unmask = unmask_giuint_low, 171 }; 172 173 + static void ack_giuint_high(unsigned int irq) 174 { 175 + giu_write(GIUINTSTATH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 176 } 177 178 + static void mask_giuint_high(unsigned int irq) 179 { 180 giu_clear(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 181 } 182 183 + static void mask_ack_giuint_high(unsigned int irq) 184 { 185 unsigned int pin; 186 ··· 205 giu_write(GIUINTSTATH, 1 << pin); 206 } 207 208 + static void unmask_giuint_high(unsigned int irq) 209 { 210 + giu_set(GIUINTENH, 1 << (GPIO_PIN_OF_IRQ(irq) - GIUINT_HIGH_OFFSET)); 211 } 212 213 + static struct irq_chip giuint_high_irq_chip = { 214 + .name = "GIUINTH", 215 + .ack = ack_giuint_high, 216 + .mask = mask_giuint_high, 217 + .mask_ack = mask_ack_giuint_high, 218 + .unmask = unmask_giuint_high, 219 }; 220 221 static int giu_get_irq(unsigned int irq) ··· 282 break; 283 } 284 } 285 + set_irq_chip_and_handler(GIU_IRQ(pin), 286 + &giuint_low_irq_chip, 287 + handle_edge_irq); 288 } else { 289 giu_clear(GIUINTTYPL, mask); 290 giu_clear(GIUINTHTSELL, mask); 291 + set_irq_chip_and_handler(GIU_IRQ(pin), 292 + &giuint_low_irq_chip, 293 + handle_level_irq); 294 } 295 giu_write(GIUINTSTATL, mask); 296 } else if (pin < GIUINT_HIGH_MAX) { ··· 311 break; 312 } 313 } 314 + set_irq_chip_and_handler(GIU_IRQ(pin), 315 + &giuint_high_irq_chip, 316 + handle_edge_irq); 317 } else { 318 giu_clear(GIUINTTYPH, mask); 319 giu_clear(GIUINTHTSELH, mask); 320 + set_irq_chip_and_handler(GIU_IRQ(pin), 321 + &giuint_high_irq_chip, 322 + handle_level_irq); 323 } 324 giu_write(GIUINTSTATH, mask); 325 } ··· 617 static int __devinit giu_probe(struct platform_device *dev) 618 { 619 unsigned long start, size, flags = 0; 620 + unsigned int nr_pins = 0, trigger, i, pin; 621 struct resource *res1, *res2 = NULL; 622 void *base; 623 + struct irq_chip *chip; 624 + int retval; 625 626 switch (current_cpu_data.cputype) { 627 case CPU_VR4111: ··· 688 giu_write(GIUINTENL, 0); 689 giu_write(GIUINTENH, 0); 690 691 + trigger = giu_read(GIUINTTYPH) << 16; 692 + trigger |= giu_read(GIUINTTYPL); 693 for (i = GIU_IRQ_BASE; i <= GIU_IRQ_LAST; i++) { 694 + pin = GPIO_PIN_OF_IRQ(i); 695 + if (pin < GIUINT_HIGH_OFFSET) 696 + chip = &giuint_low_irq_chip; 697 else 698 + chip = &giuint_high_irq_chip; 699 + 700 + if (trigger & (1 << pin)) 701 + set_irq_chip_and_handler(i, chip, handle_edge_irq); 702 + else 703 + set_irq_chip_and_handler(i, chip, handle_level_irq); 704 + 705 } 706 707 return cascade_irq(GIUINT_IRQ, giu_get_irq);