]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
twl4030: Set irq number based upon cpu type rather than requiring #define in board...
authorSteve Sakoman <steve@sakoman.com>
Tue, 6 May 2008 19:14:04 +0000 (12:14 -0700)
committerTony Lindgren <tony@atomide.com>
Tue, 6 May 2008 23:33:04 +0000 (16:33 -0700)
Set twl4030 irq number based upon cpu type rather than requiring
#define in board.h files

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/i2c/chips/twl4030-core.c
include/asm-arm/arch-omap/board-2430osk.h
include/asm-arm/arch-omap/board-2430sdp.h
include/asm-arm/arch-omap/board-3430sdp.h
include/asm-arm/arch-omap/board-omap3beagle.h
include/asm-arm/arch-omap/board-omap3evm.h

index 1a4c4683c316db351351a4b9024da90651519032..b8ee8e15689f569b3065b62faade9273bd177234 100644 (file)
@@ -716,6 +716,7 @@ static void twl_init_irq(void)
        int     i = 0;
        int     res = 0;
        char    *msg = "Unable to register interrupt subsystem";
+       unsigned int irq_num;
 
        /*
         * We end up with interrupts from other modules before
@@ -880,10 +881,12 @@ static void twl_init_irq(void)
                set_irq_flags(i, IRQF_VALID);
        }
 
+       irq_num = (cpu_is_omap2430()) ? INT_24XX_SYS_NIRQ : INT_34XX_SYS_NIRQ;
+
        /* install an irq handler to demultiplex the TWL4030 interrupt */
-       set_irq_data(TWL4030_IRQNUM, start_twl4030_irq_thread(TWL4030_IRQNUM));
-       set_irq_type(TWL4030_IRQNUM, IRQT_FALLING);
-       set_irq_chained_handler(TWL4030_IRQNUM, do_twl4030_irq);
+       set_irq_data(irq_num, start_twl4030_irq_thread(irq_num));
+       set_irq_type(irq_num, IRQT_FALLING);
+       set_irq_chained_handler(irq_num, do_twl4030_irq);
 
        res = power_companion_init();
        if (res < 0)
index f7dddc6dea8f2fce6b1ddc6fb9f6446c3a8f2a77..3b61bc1b0fb22731557ad55deb2832f8dd3b3cb0 100644 (file)
@@ -33,6 +33,4 @@
 #define OMAP24XX_ETHR_START            0x08000300
 #define OMAP24XX_ETHR_GPIO_IRQ         149
 
-#define TWL4030_IRQNUM                 INT_24XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP_2430OSK_H */
index b308e883caf2b4ca7fad63d2f1f06c3748b8827c..fde6915b3008e2798276f7f80a95b2efdbbbfc9f 100644 (file)
@@ -34,8 +34,6 @@
 #define OMAP24XX_ETHR_GPIO_IRQ         149
 #define SDP2430_CS0_BASE               0x04000000
 
-#define TWL4030_IRQNUM                 INT_24XX_SYS_NIRQ
-
 /* Function prototypes */
 extern void sdp2430_flash_init(void);
 extern void sdp2430_usb_init(void);
index 77f8647ea23ca485819a86cae7cffdf30ee2d25e..8c166c2233cf591c8644aef253a19b1f23f4f7a1 100644 (file)
@@ -66,7 +66,5 @@ extern void sdp3430_usb_init(void);
 #define FLASH_SIZE_SDPV1       SZ_64M
 #define FLASH_SIZE_SDPV2       SZ_128M
 
-#define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP_3430SDP_H */
 
index 14db589caafa02a97a31011cf7c05808ccb81299..46dff31032e1611cfc72092c0a6d3ddc162429e5 100644 (file)
@@ -29,7 +29,5 @@
 #ifndef __ASM_ARCH_OMAP3_BEAGLE_H
 #define __ASM_ARCH_OMAP3_BEAGLE_H
 
-#define TWL4030_IRQNUM         INT_34XX_SYS_NIRQ
-
 #endif /* __ASM_ARCH_OMAP3_BEAGLE_H */
 
index c8f2446b7df419cbcbe3744eb9536927d12ad271..b9d37521ef952bb8481e102370880bb715dd3a5a 100644 (file)
@@ -31,8 +31,6 @@
 
 extern void omap3evm_flash_init(void);
 
-#define TWL4030_IRQNUM         INT_34XX_SYS_NIRQ
-
 #define ONENAND_MAP            0x20000000
 
 #endif /* __ASM_ARCH_OMAP3_EVM_H */