diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-12-02 02:31:11 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:50:09 -0400 |
commit | 84715dd6c19e058557ab173d327ea65eac0ccb02 (patch) | |
tree | 16aabd33b4ca5a677e7fc34fb4adb6f3d60fecdb /arch/arm | |
parent | cfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff) |
ARM: imx: eliminate macro IMX_GPIO_TO_IRQ()
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>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-imx/mach-cpuimx35.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-cpuimx51sd.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx35_3ds.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx53_ard.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-vpr200.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx51_efika.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/hardware.h | 2 |
8 files changed, 15 insertions, 10 deletions
diff --git a/arch/arm/mach-imx/mach-cpuimx35.c b/arch/arm/mach-imx/mach-cpuimx35.c index c515f8ede1a1..73c4b65ebbe4 100644 --- a/arch/arm/mach-imx/mach-cpuimx35.c +++ b/arch/arm/mach-imx/mach-cpuimx35.c | |||
@@ -72,7 +72,7 @@ static struct i2c_board_info eukrea_cpuimx35_i2c_devices[] = { | |||
72 | I2C_BOARD_INFO("tsc2007", 0x48), | 72 | I2C_BOARD_INFO("tsc2007", 0x48), |
73 | .type = "tsc2007", | 73 | .type = "tsc2007", |
74 | .platform_data = &tsc2007_info, | 74 | .platform_data = &tsc2007_info, |
75 | .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO), | 75 | /* irq number is run-time assigned */ |
76 | }, | 76 | }, |
77 | }; | 77 | }; |
78 | 78 | ||
@@ -173,6 +173,7 @@ static void __init eukrea_cpuimx35_init(void) | |||
173 | imx35_add_imx_uart0(&uart_pdata); | 173 | imx35_add_imx_uart0(&uart_pdata); |
174 | imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); | 174 | imx35_add_mxc_nand(&eukrea_cpuimx35_nand_board_info); |
175 | 175 | ||
176 | eukrea_cpuimx35_i2c_devices[1].irq = gpio_to_irq(TSC2007_IRQGPIO); | ||
176 | i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices, | 177 | i2c_register_board_info(0, eukrea_cpuimx35_i2c_devices, |
177 | ARRAY_SIZE(eukrea_cpuimx35_i2c_devices)); | 178 | ARRAY_SIZE(eukrea_cpuimx35_i2c_devices)); |
178 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); | 179 | imx35_add_imx_i2c0(&eukrea_cpuimx35_i2c0_data); |
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c index ac50f1671e38..e42c6f8bed70 100644 --- a/arch/arm/mach-imx/mach-cpuimx51sd.c +++ b/arch/arm/mach-imx/mach-cpuimx51sd.c | |||
@@ -259,7 +259,7 @@ static struct spi_board_info cpuimx51sd_spi_device[] = { | |||
259 | .mode = SPI_MODE_0, | 259 | .mode = SPI_MODE_0, |
260 | .chip_select = 0, | 260 | .chip_select = 0, |
261 | .platform_data = &mcp251x_info, | 261 | .platform_data = &mcp251x_info, |
262 | .irq = IMX_GPIO_TO_IRQ(CAN_IRQGPIO) | 262 | /* irq number is run-time assigned */ |
263 | }, | 263 | }, |
264 | }; | 264 | }; |
265 | 265 | ||
@@ -310,6 +310,7 @@ static void __init eukrea_cpuimx51sd_init(void) | |||
310 | msleep(20); | 310 | msleep(20); |
311 | gpio_set_value(CAN_RST, 1); | 311 | gpio_set_value(CAN_RST, 1); |
312 | imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata); | 312 | imx51_add_ecspi(0, &cpuimx51sd_ecspi1_pdata); |
313 | cpuimx51sd_spi_device[0].irq = gpio_to_irq(CAN_IRQGPIO); | ||
313 | spi_register_board_info(cpuimx51sd_spi_device, | 314 | spi_register_board_info(cpuimx51sd_spi_device, |
314 | ARRAY_SIZE(cpuimx51sd_spi_device)); | 315 | ARRAY_SIZE(cpuimx51sd_spi_device)); |
315 | 316 | ||
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index c6d385c52257..18b9bcaa40e3 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -445,7 +445,7 @@ static struct spi_board_info mx27_3ds_spi_devs[] __initdata = { | |||
445 | .bus_num = 1, | 445 | .bus_num = 1, |
446 | .chip_select = 0, /* SS0 */ | 446 | .chip_select = 0, /* SS0 */ |
447 | .platform_data = &mc13783_pdata, | 447 | .platform_data = &mc13783_pdata, |
448 | .irq = IMX_GPIO_TO_IRQ(PMIC_INT), | 448 | /* irq number is run-time assigned */ |
449 | .mode = SPI_CS_HIGH, | 449 | .mode = SPI_CS_HIGH, |
450 | }, { | 450 | }, { |
451 | .modalias = "l4f00242t03", | 451 | .modalias = "l4f00242t03", |
@@ -496,6 +496,7 @@ static void __init mx27pdk_init(void) | |||
496 | 496 | ||
497 | imx27_add_spi_imx1(&spi2_pdata); | 497 | imx27_add_spi_imx1(&spi2_pdata); |
498 | imx27_add_spi_imx0(&spi1_pdata); | 498 | imx27_add_spi_imx0(&spi1_pdata); |
499 | mx27_3ds_spi_devs[0].irq = gpio_to_irq(PMIC_INT); | ||
499 | spi_register_board_info(mx27_3ds_spi_devs, | 500 | spi_register_board_info(mx27_3ds_spi_devs, |
500 | ARRAY_SIZE(mx27_3ds_spi_devs)); | 501 | ARRAY_SIZE(mx27_3ds_spi_devs)); |
501 | 502 | ||
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index 28aa19476de7..fa1ea74dfdd3 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c | |||
@@ -492,7 +492,7 @@ static struct i2c_board_info mx35_3ds_i2c_mc13892 = { | |||
492 | 492 | ||
493 | I2C_BOARD_INFO("mc13892", 0x08), | 493 | I2C_BOARD_INFO("mc13892", 0x08), |
494 | .platform_data = &mx35_3ds_mc13892_data, | 494 | .platform_data = &mx35_3ds_mc13892_data, |
495 | .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), | 495 | /* irq number is run-time assigned */ |
496 | }; | 496 | }; |
497 | 497 | ||
498 | static void __init imx35_3ds_init_mc13892(void) | 498 | static void __init imx35_3ds_init_mc13892(void) |
@@ -504,6 +504,7 @@ static void __init imx35_3ds_init_mc13892(void) | |||
504 | return; | 504 | return; |
505 | } | 505 | } |
506 | 506 | ||
507 | mx35_3ds_i2c_mc13892.irq = gpio_to_irq(GPIO_PMIC_INT); | ||
507 | i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1); | 508 | i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1); |
508 | } | 509 | } |
509 | 510 | ||
diff --git a/arch/arm/mach-imx/mach-mx53_ard.c b/arch/arm/mach-imx/mach-mx53_ard.c index 05641980dc5e..fe3f3969cf1d 100644 --- a/arch/arm/mach-imx/mach-mx53_ard.c +++ b/arch/arm/mach-imx/mach-mx53_ard.c | |||
@@ -135,8 +135,7 @@ static struct resource ard_smsc911x_resources[] = { | |||
135 | .flags = IORESOURCE_MEM, | 135 | .flags = IORESOURCE_MEM, |
136 | }, | 136 | }, |
137 | { | 137 | { |
138 | .start = IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B), | 138 | /* irq number is run-time assigned */ |
139 | .end = IMX_GPIO_TO_IRQ(ARD_ETHERNET_INT_B), | ||
140 | .flags = IORESOURCE_IRQ, | 139 | .flags = IORESOURCE_IRQ, |
141 | }, | 140 | }, |
142 | }; | 141 | }; |
@@ -240,6 +239,8 @@ static void __init mx53_ard_board_init(void) | |||
240 | imx53_ard_common_init(); | 239 | imx53_ard_common_init(); |
241 | mx53_ard_io_init(); | 240 | mx53_ard_io_init(); |
242 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 241 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
242 | ard_smsc911x_resources[1].start = gpio_to_irq(ARD_ETHERNET_INT_B); | ||
243 | ard_smsc911x_resources[1].end = gpio_to_irq(ARD_ETHERNET_INT_B); | ||
243 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 244 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
244 | 245 | ||
245 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); | 246 | imx53_add_sdhci_esdhc_imx(0, &mx53_ard_sd1_data); |
diff --git a/arch/arm/mach-imx/mach-vpr200.c b/arch/arm/mach-imx/mach-vpr200.c index add8c69c6c1a..e36eb2c40f41 100644 --- a/arch/arm/mach-imx/mach-vpr200.c +++ b/arch/arm/mach-imx/mach-vpr200.c | |||
@@ -162,7 +162,7 @@ static struct i2c_board_info vpr200_i2c_devices[] = { | |||
162 | }, { | 162 | }, { |
163 | I2C_BOARD_INFO("mc13892", 0x08), | 163 | I2C_BOARD_INFO("mc13892", 0x08), |
164 | .platform_data = &vpr200_pmic, | 164 | .platform_data = &vpr200_pmic, |
165 | .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT), | 165 | /* irq number is run-time assigned */ |
166 | } | 166 | } |
167 | }; | 167 | }; |
168 | 168 | ||
@@ -299,6 +299,7 @@ static void __init vpr200_board_init(void) | |||
299 | imx35_add_mxc_nand(&vpr200_nand_board_info); | 299 | imx35_add_mxc_nand(&vpr200_nand_board_info); |
300 | imx35_add_sdhci_esdhc_imx(0, NULL); | 300 | imx35_add_sdhci_esdhc_imx(0, NULL); |
301 | 301 | ||
302 | vpr200_i2c_devices[1].irq = gpio_to_irq(GPIO_PMIC_INT); | ||
302 | i2c_register_board_info(0, vpr200_i2c_devices, | 303 | i2c_register_board_info(0, vpr200_i2c_devices, |
303 | ARRAY_SIZE(vpr200_i2c_devices)); | 304 | ARRAY_SIZE(vpr200_i2c_devices)); |
304 | 305 | ||
diff --git a/arch/arm/mach-imx/mx51_efika.c b/arch/arm/mach-imx/mx51_efika.c index ec6ca91b299b..ee870c49bc63 100644 --- a/arch/arm/mach-imx/mx51_efika.c +++ b/arch/arm/mach-imx/mx51_efika.c | |||
@@ -587,7 +587,7 @@ static struct spi_board_info mx51_efika_spi_board_info[] __initdata = { | |||
587 | .bus_num = 0, | 587 | .bus_num = 0, |
588 | .chip_select = 0, | 588 | .chip_select = 0, |
589 | .platform_data = &mx51_efika_mc13892_data, | 589 | .platform_data = &mx51_efika_mc13892_data, |
590 | .irq = IMX_GPIO_TO_IRQ(EFIKAMX_PMIC), | 590 | /* irq number is run-time assigned */ |
591 | }, | 591 | }, |
592 | }; | 592 | }; |
593 | 593 | ||
@@ -620,6 +620,7 @@ void __init efika_board_common_init(void) | |||
620 | 620 | ||
621 | gpio_request(EFIKAMX_PMIC, "pmic irq"); | 621 | gpio_request(EFIKAMX_PMIC, "pmic irq"); |
622 | gpio_direction_input(EFIKAMX_PMIC); | 622 | gpio_direction_input(EFIKAMX_PMIC); |
623 | mx51_efika_spi_board_info[1].irq = gpio_to_irq(EFIKAMX_PMIC); | ||
623 | spi_register_board_info(mx51_efika_spi_board_info, | 624 | spi_register_board_info(mx51_efika_spi_board_info, |
624 | ARRAY_SIZE(mx51_efika_spi_board_info)); | 625 | ARRAY_SIZE(mx51_efika_spi_board_info)); |
625 | imx51_add_ecspi(0, &mx51_efika_spi_pdata); | 626 | imx51_add_ecspi(0, &mx51_efika_spi_pdata); |
diff --git a/arch/arm/plat-mxc/include/mach/hardware.h b/arch/arm/plat-mxc/include/mach/hardware.h index 0630513554de..1d432a75e409 100644 --- a/arch/arm/plat-mxc/include/mach/hardware.h +++ b/arch/arm/plat-mxc/include/mach/hardware.h | |||
@@ -128,6 +128,4 @@ | |||
128 | /* range e.g. GPIO_1_5 is gpio 5 under linux */ | 128 | /* range e.g. GPIO_1_5 is gpio 5 under linux */ |
129 | #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) | 129 | #define IMX_GPIO_NR(bank, nr) (((bank) - 1) * 32 + (nr)) |
130 | 130 | ||
131 | #define IMX_GPIO_TO_IRQ(gpio) (MXC_GPIO_IRQ_START + (gpio)) | ||
132 | |||
133 | #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ | 131 | #endif /* __ASM_ARCH_MXC_HARDWARE_H__ */ |