Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: OMAP: Clean up interrupt lines to fix warnings for multi-omap

If boards with different NR_IRQS are compiled together, tons of
compiler warnings are emitted about redefining NR_IRQS.

This patch fixes the problem by adding up NR_IRQS in a common place.

Patch also removes quite a bit of now unnecessary code.

Signed-off-by: Tony Lindgren <tony@atomide.com>

+64 -59
+5 -5
arch/arm/mach-omap1/fpga.c
··· 32 32 33 33 static void fpga_mask_irq(unsigned int irq) 34 34 { 35 - irq -= OMAP1510_IH_FPGA_BASE; 35 + irq -= OMAP_FPGA_IRQ_BASE; 36 36 37 37 if (irq < 8) 38 38 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) ··· 65 65 66 66 static void fpga_unmask_irq(unsigned int irq) 67 67 { 68 - irq -= OMAP1510_IH_FPGA_BASE; 68 + irq -= OMAP_FPGA_IRQ_BASE; 69 69 70 70 if (irq < 8) 71 71 __raw_writeb((__raw_readb(OMAP1510_FPGA_IMR_LO) | (1 << irq)), ··· 95 95 if (!stat) 96 96 return; 97 97 98 - for (fpga_irq = OMAP1510_IH_FPGA_BASE; 99 - (fpga_irq < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS)) && stat; 98 + for (fpga_irq = OMAP_FPGA_IRQ_BASE; 99 + (fpga_irq < OMAP_FPGA_IRQ_END) && stat; 100 100 fpga_irq++, stat >>= 1) { 101 101 if (stat & 1) { 102 102 d = irq_desc + fpga_irq; ··· 151 151 __raw_writeb(0, OMAP1510_FPGA_IMR_HI); 152 152 __raw_writeb(0, INNOVATOR_FPGA_IMR2); 153 153 154 - for (i = OMAP1510_IH_FPGA_BASE; i < (OMAP1510_IH_FPGA_BASE + NR_FPGA_IRQS); i++) { 154 + for (i = OMAP_FPGA_IRQ_BASE; i < OMAP_FPGA_IRQ_END; i++) { 155 155 156 156 if (i == OMAP1510_INT_FPGA_TS) { 157 157 /*
-5
include/asm-arm/arch-omap/board-2430sdp.h
··· 36 36 37 37 #define TWL4030_IRQNUM INT_24XX_SYS_NIRQ 38 38 39 - /* TWL4030 Primary Interrupt Handler (PIH) interrupts */ 40 - #define IH_TWL4030_BASE IH_BOARD_BASE 41 - #define IH_TWL4030_END (IH_TWL4030_BASE+8) 42 - #define NR_IRQS (IH_TWL4030_END) 43 - 44 39 #endif /* __ASM_ARCH_OMAP_2430SDP_H */
-6
include/asm-arm/arch-omap/board-h3.h
··· 30 30 /* In OMAP1710 H3 the Ethernet is directly connected to CS1 */ 31 31 #define OMAP1710_ETHR_START 0x04000300 32 32 33 - #define MAXIRQNUM (IH_BOARD_BASE) 34 - #define MAXFIQNUM MAXIRQNUM 35 - #define MAXSWINUM MAXIRQNUM 36 - 37 - #define NR_IRQS (MAXIRQNUM + 1) 38 - 39 33 extern void h3_mmc_init(void); 40 34 extern void h3_mmc_slot_cover_handler(void *arg, int state); 41 35
-3
include/asm-arm/arch-omap/board-innovator.h
··· 36 36 #define OMAP1510P1_EMIFS_PRI_VALUE 0x00 37 37 #define OMAP1510P1_EMIFF_PRI_VALUE 0x00 38 38 39 - #define NR_FPGA_IRQS 24 40 - #define NR_IRQS (IH_BOARD_BASE + NR_FPGA_IRQS) 41 - 42 39 #ifndef __ASSEMBLY__ 43 40 void fpga_write(unsigned char val, int reg); 44 41 unsigned char fpga_read(int reg);
-6
include/asm-arm/arch-omap/board-perseus2.h
··· 36 36 #define OMAP_SDRAM_DEVICE D256M_1X16_4B 37 37 #endif 38 38 39 - #define MAXIRQNUM IH_BOARD_BASE 40 - #define MAXFIQNUM MAXIRQNUM 41 - #define MAXSWINUM MAXIRQNUM 42 - 43 - #define NR_IRQS (MAXIRQNUM + 1) 44 - 45 39 #endif
+24 -25
include/asm-arm/arch-omap/fpga.h
··· 169 169 #define OMAP1510_INT_FPGA (IH_GPIO_BASE + 13) 170 170 171 171 /* IRQ Numbers for interrupts muxed through the FPGA */ 172 - #define OMAP1510_IH_FPGA_BASE IH_BOARD_BASE 173 - #define OMAP1510_INT_FPGA_ATN (OMAP1510_IH_FPGA_BASE + 0) 174 - #define OMAP1510_INT_FPGA_ACK (OMAP1510_IH_FPGA_BASE + 1) 175 - #define OMAP1510_INT_FPGA2 (OMAP1510_IH_FPGA_BASE + 2) 176 - #define OMAP1510_INT_FPGA3 (OMAP1510_IH_FPGA_BASE + 3) 177 - #define OMAP1510_INT_FPGA4 (OMAP1510_IH_FPGA_BASE + 4) 178 - #define OMAP1510_INT_FPGA5 (OMAP1510_IH_FPGA_BASE + 5) 179 - #define OMAP1510_INT_FPGA6 (OMAP1510_IH_FPGA_BASE + 6) 180 - #define OMAP1510_INT_FPGA7 (OMAP1510_IH_FPGA_BASE + 7) 181 - #define OMAP1510_INT_FPGA8 (OMAP1510_IH_FPGA_BASE + 8) 182 - #define OMAP1510_INT_FPGA9 (OMAP1510_IH_FPGA_BASE + 9) 183 - #define OMAP1510_INT_FPGA10 (OMAP1510_IH_FPGA_BASE + 10) 184 - #define OMAP1510_INT_FPGA11 (OMAP1510_IH_FPGA_BASE + 11) 185 - #define OMAP1510_INT_FPGA12 (OMAP1510_IH_FPGA_BASE + 12) 186 - #define OMAP1510_INT_ETHER (OMAP1510_IH_FPGA_BASE + 13) 187 - #define OMAP1510_INT_FPGAUART1 (OMAP1510_IH_FPGA_BASE + 14) 188 - #define OMAP1510_INT_FPGAUART2 (OMAP1510_IH_FPGA_BASE + 15) 189 - #define OMAP1510_INT_FPGA_TS (OMAP1510_IH_FPGA_BASE + 16) 190 - #define OMAP1510_INT_FPGA17 (OMAP1510_IH_FPGA_BASE + 17) 191 - #define OMAP1510_INT_FPGA_CAM (OMAP1510_IH_FPGA_BASE + 18) 192 - #define OMAP1510_INT_FPGA_RTC_A (OMAP1510_IH_FPGA_BASE + 19) 193 - #define OMAP1510_INT_FPGA_RTC_B (OMAP1510_IH_FPGA_BASE + 20) 194 - #define OMAP1510_INT_FPGA_CD (OMAP1510_IH_FPGA_BASE + 21) 195 - #define OMAP1510_INT_FPGA22 (OMAP1510_IH_FPGA_BASE + 22) 196 - #define OMAP1510_INT_FPGA23 (OMAP1510_IH_FPGA_BASE + 23) 172 + #define OMAP1510_INT_FPGA_ATN (OMAP_FPGA_IRQ_BASE + 0) 173 + #define OMAP1510_INT_FPGA_ACK (OMAP_FPGA_IRQ_BASE + 1) 174 + #define OMAP1510_INT_FPGA2 (OMAP_FPGA_IRQ_BASE + 2) 175 + #define OMAP1510_INT_FPGA3 (OMAP_FPGA_IRQ_BASE + 3) 176 + #define OMAP1510_INT_FPGA4 (OMAP_FPGA_IRQ_BASE + 4) 177 + #define OMAP1510_INT_FPGA5 (OMAP_FPGA_IRQ_BASE + 5) 178 + #define OMAP1510_INT_FPGA6 (OMAP_FPGA_IRQ_BASE + 6) 179 + #define OMAP1510_INT_FPGA7 (OMAP_FPGA_IRQ_BASE + 7) 180 + #define OMAP1510_INT_FPGA8 (OMAP_FPGA_IRQ_BASE + 8) 181 + #define OMAP1510_INT_FPGA9 (OMAP_FPGA_IRQ_BASE + 9) 182 + #define OMAP1510_INT_FPGA10 (OMAP_FPGA_IRQ_BASE + 10) 183 + #define OMAP1510_INT_FPGA11 (OMAP_FPGA_IRQ_BASE + 11) 184 + #define OMAP1510_INT_FPGA12 (OMAP_FPGA_IRQ_BASE + 12) 185 + #define OMAP1510_INT_ETHER (OMAP_FPGA_IRQ_BASE + 13) 186 + #define OMAP1510_INT_FPGAUART1 (OMAP_FPGA_IRQ_BASE + 14) 187 + #define OMAP1510_INT_FPGAUART2 (OMAP_FPGA_IRQ_BASE + 15) 188 + #define OMAP1510_INT_FPGA_TS (OMAP_FPGA_IRQ_BASE + 16) 189 + #define OMAP1510_INT_FPGA17 (OMAP_FPGA_IRQ_BASE + 17) 190 + #define OMAP1510_INT_FPGA_CAM (OMAP_FPGA_IRQ_BASE + 18) 191 + #define OMAP1510_INT_FPGA_RTC_A (OMAP_FPGA_IRQ_BASE + 19) 192 + #define OMAP1510_INT_FPGA_RTC_B (OMAP_FPGA_IRQ_BASE + 20) 193 + #define OMAP1510_INT_FPGA_CD (OMAP_FPGA_IRQ_BASE + 21) 194 + #define OMAP1510_INT_FPGA22 (OMAP_FPGA_IRQ_BASE + 22) 195 + #define OMAP1510_INT_FPGA23 (OMAP_FPGA_IRQ_BASE + 23) 197 196 198 197 #endif
+35 -9
include/asm-arm/arch-omap/irqs.h
··· 285 285 #define OMAP_MAX_GPIO_LINES 192 286 286 #define IH_GPIO_BASE (128 + IH2_BASE) 287 287 #define IH_MPUIO_BASE (OMAP_MAX_GPIO_LINES + IH_GPIO_BASE) 288 - #define IH_BOARD_BASE (16 + IH_MPUIO_BASE) 288 + #define OMAP_IRQ_END (IH_MPUIO_BASE + 16) 289 + 290 + /* External FPGA handles interrupts on Innovator boards */ 291 + #define OMAP_FPGA_IRQ_BASE (OMAP_IRQ_END) 292 + #ifdef CONFIG_MACH_OMAP_INNOVATOR 293 + #define OMAP_FPGA_NR_IRQS 24 294 + #else 295 + #define OMAP_FPGA_NR_IRQS 0 296 + #endif 297 + #define OMAP_FPGA_IRQ_END (OMAP_FPGA_IRQ_BASE + OMAP_FPGA_NR_IRQS) 298 + 299 + /* External TWL4030 can handle interrupts on 2430 and 34xx boards */ 300 + #define TWL4030_IRQ_BASE (OMAP_FPGA_IRQ_END) 301 + #ifdef CONFIG_TWL4030_CORE 302 + #define TWL4030_BASE_NR_IRQS 8 303 + #define TWL4030_PWR_NR_IRQS 8 304 + #else 305 + #define TWL4030_BASE_NR_IRQS 0 306 + #define TWL4030_PWR_NR_IRQS 0 307 + #endif 308 + #define TWL4030_IRQ_END (TWL4030_IRQ_BASE + TWL4030_BASE_NR_IRQS) 309 + #define TWL4030_PWR_IRQ_BASE TWL4030_IRQ_END 310 + #define TWL4030_PWR_IRQ_END (TWL4030_PWR_IRQ_BASE + TWL4030_PWR_NR_IRQS) 311 + 312 + /* External TWL4030 gpio interrupts are optional */ 313 + #define TWL4030_GPIO_IRQ_BASE TWL4030_PWR_IRQ_END 314 + #ifdef CONFIG_TWL4030_GPIO 315 + #define TWL4030_GPIO_NR_IRQS 18 316 + #else 317 + #define TWL4030_GPIO_NR_IRQS 0 318 + #endif 319 + #define TWL4030_GPIO_IRQ_END (TWL4030_GPIO_IRQ_BASE + TWL4030_GPIO_NR_IRQS) 320 + 321 + /* Total number of interrupts depends on the enabled blocks above */ 322 + #define NR_IRQS TWL4030_GPIO_IRQ_END 289 323 290 324 #define OMAP_IRQ_BIT(irq) (1 << ((irq) % 32)) 291 325 ··· 327 293 extern void omap_init_irq(void); 328 294 #endif 329 295 330 - /* 331 - * The definition of NR_IRQS is in board-specific header file, which is 332 - * included via hardware.h 333 - */ 334 296 #include <asm/hardware.h> 335 - 336 - #ifndef NR_IRQS 337 - #define NR_IRQS IH_BOARD_BASE 338 - #endif 339 297 340 298 #endif