ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
authorShawn Guo <shawn.guo@linaro.org>
Fri, 2 Dec 2011 07:31:11 +0000 (15:31 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Sun, 1 Jul 2012 13:50:09 +0000 (21:50 +0800)
This patch changes all the static gpio irq number assigning with
IMX_GPIO_TO_IRQ() to run-time assigning with gpio_to_irq call, and
in turn eliminates the macro IMX_GPIO_TO_IRQ().

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
arch/arm/mach-imx/mach-cpuimx35.c
arch/arm/mach-imx/mach-cpuimx51sd.c
arch/arm/mach-imx/mach-mx27_3ds.c
arch/arm/mach-imx/mach-mx35_3ds.c
arch/arm/mach-imx/mach-mx53_ard.c
arch/arm/mach-imx/mach-vpr200.c
arch/arm/mach-imx/mx51_efika.c
arch/arm/plat-mxc/include/mach/hardware.h

index c515f8ede1a145a68a0345ae2d503e02949a9d14..73c4b65ebbe43ddca9dc9a4ba9d5c2973608757b 100644 (file)
@@ -72,7 +72,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = {
                I2C_BOARD_INFO("tsc2007", 0x48),
                .type           = "tsc2007",
                .platform_data  = &tsc2007_info,
-               .irq            = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
+               /* irq number is run-time assigned */
        },
 };
 
@@ -173,6 +173,7 @@ static void __init eukrea_cpuimx35_init(void)
        imx35_add_imx_uart0(&uart_pdata);
        imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info);
 
+       eukrea_cpuimx35_i2c_devices[1].irq = gpio_to_irq(TSC2007_IRQGPIO);
        i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices,
                        ARRAY_SIZE(eukrea_cpuimx35_i2c_devices));
        imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data);
index ac50f1671e381447d7fda9335d32cac33432b7ca..e42c6f8bed702a2540fd9874fbe65c0b36a467d8 100644 (file)
@@ -259,7 +259,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = {
                .mode           = SPI_MODE_0,
                .chip_select     = 0,
                .platform_data   = &mcp251x_info,
-               .irq             = IMX_GPIO_TO_IRQ(CAN_IRQGPIO)
+               /* irq number is run-time assigned */
        },
 };
 
@@ -310,6 +310,7 @@ static void __init eukrea_cpuimx51sd_init(void)
        msleep(20);
        gpio_set_value(CAN_RST, 1);
        imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata);
+       cpuimx51sd_spi_device[0].irq = gpio_to_irq(CAN_IRQGPIO);
        spi_register_board_info(cpuimx51sd_spi_device,
                                ARRAY_SIZE(cpuimx51sd_spi_device));
 
index c6d385c522576f1052eeb474fc2d69a86faa7a0e..18b9bcaa40e323f3def44fd84d4447e9cc5a0683 100644 (file)
@@ -445,7 +445,7 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = {
                .bus_num        = 1,
                .chip_select    = 0, /* SS0 */
                .platform_data  = &mc13783_pdata,
-               .irq = IMX_GPIO_TO_IRQ(PMIC_INT),
+               /* irq number is run-time assigned */
                .mode = SPI_CS_HIGH,
        }, {
                .modalias       = "l4f00242t03",
@@ -496,6 +496,7 @@ static void __init mx27pdk_init(void)
 
        imx27_add_spi_imx1(&spi2_pdata);
        imx27_add_spi_imx0(&spi1_pdata);
+       mx27_3ds_spi_devs[0].irq = gpio_to_irq(PMIC_INT);
        spi_register_board_info(mx27_3ds_spi_devs,
                                                ARRAY_SIZE(mx27_3ds_spi_devs));
 
index 28aa19476de73dc47ea40eaec323e71e1623b7e7..fa1ea74dfdd3ec1d0714153b39bfbd2a9e8191bd 100644 (file)
@@ -492,7 +492,7 @@ static struct i2c_board_info mx35_3ds_i2c_mc13892 = {
 
        I2C_BOARD_INFO("mc13892", 0x08),
        .platform_data = &mx35_3ds_mc13892_data,
-       .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT),
+       /* irq number is run-time assigned */
 };
 
 static void __init imx35_3ds_init_mc13892(void)
@@ -504,6 +504,7 @@ static void __init imx35_3ds_init_mc13892(void)
                return;
        }
 
+       mx35_3ds_i2c_mc13892.irq = gpio_to_irq(GPIO_PMIC_INT);
        i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1);
 }
 
index 05641980dc5e7c86ede296ef01129be70fea653b..fe3f3969cf1d80dbb5d57eaef44b768e0f7d9d20 100644 (file)
@@ -135,8 +135,7 @@ static struct resource ard_smsc911x_resources[] = {
                .flags = IORESOURCE_MEM,
        },
        {
-               .start =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
-               .end =  IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B),
+               /* irq number is run-time assigned */
                .flags = IORESOURCE_IRQ,
        },
 };
@@ -240,6 +239,8 @@ static void __init mx53_ard_board_init(void)
        imx53_ard_common_init();
        mx53_ard_io_init();
        regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
+       ard_smsc911x_resources[1].start = gpio_to_irq(ARD_ETHERNET_INT_B);
+       ard_smsc911x_resources[1].end = gpio_to_irq(ARD_ETHERNET_INT_B);
        platform_add_devices(devices, ARRAY_SIZE(devices));
 
        imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data);
index add8c69c6c1ade1e8c020d03166d25365cf7e532..e36eb2c40f415c854b5c3fe3a2a8c4d3f1722e47 100644 (file)
@@ -162,7 +162,7 @@ static struct i2c_board_info vpr200_i2c_devices[] = {
        }, {
                I2C_BOARD_INFO("mc13892", 0x08),
                .platform_data = &vpr200_pmic,
-               .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT),
+               /* irq number is run-time assigned */
        }
 };
 
@@ -299,6 +299,7 @@ static void __init vpr200_board_init(void)
        imx35_add_mxc_nand(&vpr200_nand_board_info);
        imx35_add_sdhci_esdhc_imx(0, NULL);
 
+       vpr200_i2c_devices[1].irq = gpio_to_irq(GPIO_PMIC_INT);
        i2c_register_board_info(0, vpr200_i2c_devices,
                        ARRAY_SIZE(vpr200_i2c_devices));
 
index ec6ca91b299b629039ff3ac13ed7942494b3b830..ee870c49bc636c5f95f3aa01bd6cc1602fb6d1c5 100644 (file)
@@ -587,7 +587,7 @@ static struct spi_board_info mx51_efika_spi_board_info[] __initdata = {
                .bus_num = 0,
                .chip_select = 0,
                .platform_data = &mx51_efika_mc13892_data,
-               .irq = IMX_GPIO_TO_IRQ(EFIKAMX_PMIC),
+               /* irq number is run-time assigned */
        },
 };
 
@@ -620,6 +620,7 @@ void __init efika_board_common_init(void)
 
        gpio_request(EFIKAMX_PMIC, "pmic irq");
        gpio_direction_input(EFIKAMX_PMIC);
+       mx51_efika_spi_board_info[1].irq = gpio_to_irq(EFIKAMX_PMIC);
        spi_register_board_info(mx51_efika_spi_board_info,
                ARRAY_SIZE(mx51_efika_spi_board_info));
        imx51_add_ecspi(0, &mx51_efika_spi_pdata);
index 0630513554def1f851ea708fabd484dbf50deec6..1d432a75e4092f6ebf27eb72615a9610198c560e 100644 (file)
 /* range e.g. GPIO_1_5 is gpio 5 under linux */
 #define IMX_GPIO_NR(bank, nr)          (((bank) - 1) * 32 + (nr))
 
-#define IMX_GPIO_TO_IRQ(gpio)  (MXC_GPIO_IRQ_START + (gpio))
-
 #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */