diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-12-02 07:00:33 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:57:06 -0400 |
commit | ed175343b4b53d686e30b1e37fb94e142f56fa2f (patch) | |
tree | c7d8c37edafa9d6f9c06034bbb6a9c7bf00dfe7f /arch/arm/mach-imx | |
parent | 84715dd6c19e058557ab173d327ea65eac0ccb02 (diff) |
ARM: imx: eliminate macro IOMUX_TO_IRQ()
This patch changes all the static gpio irq number assigning with
IOMUX_TO_IRQ() to run-time assigning with gpio_to_irq call, and
in turn eliminates the macro IOMUX_TO_IRQ().
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Diffstat (limited to 'arch/arm/mach-imx')
-rw-r--r-- | arch/arm/mach-imx/mach-armadillo5x0.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-kzm_arm11_01.c | 20 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31_3ds.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31ads.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31lilly.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31lite.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31moboard.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pcm037.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-qong.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx31lilly-db.c | 5 | ||||
-rw-r--r-- | arch/arm/mach-imx/mx31lite-db.c | 5 |
11 files changed, 78 insertions, 42 deletions
diff --git a/arch/arm/mach-imx/mach-armadillo5x0.c b/arch/arm/mach-imx/mach-armadillo5x0.c index c650145d1646..f83c5c683575 100644 --- a/arch/arm/mach-imx/mach-armadillo5x0.c +++ b/arch/arm/mach-imx/mach-armadillo5x0.c | |||
@@ -408,7 +408,8 @@ static int armadillo5x0_sdhc1_init(struct device *dev, | |||
408 | gpio_direction_input(gpio_wp); | 408 | gpio_direction_input(gpio_wp); |
409 | 409 | ||
410 | /* When supported the trigger type have to be BOTH */ | 410 | /* When supported the trigger type have to be BOTH */ |
411 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), detect_irq, | 411 | ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)), |
412 | detect_irq, | ||
412 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, | 413 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, |
413 | "sdhc-detect", data); | 414 | "sdhc-detect", data); |
414 | 415 | ||
@@ -429,7 +430,7 @@ err_gpio_free: | |||
429 | 430 | ||
430 | static void armadillo5x0_sdhc1_exit(struct device *dev, void *data) | 431 | static void armadillo5x0_sdhc1_exit(struct device *dev, void *data) |
431 | { | 432 | { |
432 | free_irq(IOMUX_TO_IRQ(MX31_PIN_ATA_DMACK), data); | 433 | free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)), data); |
433 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)); | 434 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_DMACK)); |
434 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B)); | 435 | gpio_free(IOMUX_TO_GPIO(MX31_PIN_ATA_RESET_B)); |
435 | } | 436 | } |
@@ -450,8 +451,7 @@ static struct resource armadillo5x0_smc911x_resources[] = { | |||
450 | .end = MX31_CS3_BASE_ADDR + SZ_32M - 1, | 451 | .end = MX31_CS3_BASE_ADDR + SZ_32M - 1, |
451 | .flags = IORESOURCE_MEM, | 452 | .flags = IORESOURCE_MEM, |
452 | }, { | 453 | }, { |
453 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | 454 | /* irq number is run-time assigned */ |
454 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | ||
455 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | 455 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
456 | }, | 456 | }, |
457 | }; | 457 | }; |
@@ -498,6 +498,10 @@ static void __init armadillo5x0_init(void) | |||
498 | 498 | ||
499 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 499 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
500 | 500 | ||
501 | armadillo5x0_smc911x_resources[1].start = | ||
502 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); | ||
503 | armadillo5x0_smc911x_resources[1].end = | ||
504 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); | ||
501 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 505 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
502 | imx_add_gpio_keys(&armadillo5x0_button_data); | 506 | imx_add_gpio_keys(&armadillo5x0_button_data); |
503 | imx31_add_imx_i2c1(NULL); | 507 | imx31_add_imx_i2c1(NULL); |
diff --git a/arch/arm/mach-imx/mach-kzm_arm11_01.c b/arch/arm/mach-imx/mach-kzm_arm11_01.c index 15a26e908260..5d08533ab2c7 100644 --- a/arch/arm/mach-imx/mach-kzm_arm11_01.c +++ b/arch/arm/mach-imx/mach-kzm_arm11_01.c | |||
@@ -73,7 +73,7 @@ static struct plat_serial8250_port serial_platform_data[] = { | |||
73 | { | 73 | { |
74 | .membase = KZM_ARM11_IO_ADDRESS(KZM_ARM11_16550), | 74 | .membase = KZM_ARM11_IO_ADDRESS(KZM_ARM11_16550), |
75 | .mapbase = KZM_ARM11_16550, | 75 | .mapbase = KZM_ARM11_16550, |
76 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), | 76 | /* irq number is run-time assigned */ |
77 | .irqflags = IRQ_TYPE_EDGE_RISING, | 77 | .irqflags = IRQ_TYPE_EDGE_RISING, |
78 | .uartclk = 14745600, | 78 | .uartclk = 14745600, |
79 | .regshift = 0, | 79 | .regshift = 0, |
@@ -91,8 +91,7 @@ static struct resource serial8250_resources[] = { | |||
91 | .flags = IORESOURCE_MEM, | 91 | .flags = IORESOURCE_MEM, |
92 | }, | 92 | }, |
93 | { | 93 | { |
94 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), | 94 | /* irq number is run-time assigned */ |
95 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), | ||
96 | .flags = IORESOURCE_IRQ, | 95 | .flags = IORESOURCE_IRQ, |
97 | }, | 96 | }, |
98 | }; | 97 | }; |
@@ -125,6 +124,13 @@ static int __init kzm_init_ext_uart(void) | |||
125 | tmp |= 0x2; | 124 | tmp |= 0x2; |
126 | __raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1)); | 125 | __raw_writeb(tmp, KZM_ARM11_IO_ADDRESS(KZM_ARM11_CTL1)); |
127 | 126 | ||
127 | serial_platform_data[0].irq = | ||
128 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); | ||
129 | serial8250_resources[1].start = | ||
130 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); | ||
131 | serial8250_resources[1].end = | ||
132 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)); | ||
133 | |||
128 | return platform_device_register(&serial_device); | 134 | return platform_device_register(&serial_device); |
129 | } | 135 | } |
130 | #else | 136 | #else |
@@ -152,8 +158,7 @@ static struct resource kzm_smsc9118_resources[] = { | |||
152 | .flags = IORESOURCE_MEM, | 158 | .flags = IORESOURCE_MEM, |
153 | }, | 159 | }, |
154 | { | 160 | { |
155 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2), | 161 | /* irq number is run-time assigned */ |
156 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_2), | ||
157 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, | 162 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE, |
158 | }, | 163 | }, |
159 | }; | 164 | }; |
@@ -184,6 +189,11 @@ static int __init kzm_init_smsc9118(void) | |||
184 | 189 | ||
185 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 190 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
186 | 191 | ||
192 | kzm_smsc9118_resources[1].start = | ||
193 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); | ||
194 | kzm_smsc9118_resources[1].end = | ||
195 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_2)); | ||
196 | |||
187 | return platform_device_register(&kzm_smsc9118_device); | 197 | return platform_device_register(&kzm_smsc9118_device); |
188 | } | 198 | } |
189 | #else | 199 | #else |
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 4eafdf275ea2..ecdba0497e7e 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c | |||
@@ -44,9 +44,6 @@ | |||
44 | 44 | ||
45 | #include "devices-imx31.h" | 45 | #include "devices-imx31.h" |
46 | 46 | ||
47 | /* CPLD IRQ line for external uart, external ethernet etc */ | ||
48 | #define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_1) | ||
49 | |||
50 | static int mx31_3ds_pins[] = { | 47 | static int mx31_3ds_pins[] = { |
51 | /* UART1 */ | 48 | /* UART1 */ |
52 | MX31_PIN_CTS1__CTS1, | 49 | MX31_PIN_CTS1__CTS1, |
@@ -317,7 +314,7 @@ static int mx31_3ds_sdhc1_init(struct device *dev, | |||
317 | return ret; | 314 | return ret; |
318 | } | 315 | } |
319 | 316 | ||
320 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), | 317 | ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)), |
321 | detect_irq, IRQF_DISABLED | | 318 | detect_irq, IRQF_DISABLED | |
322 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, | 319 | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, |
323 | "sdhc1-detect", data); | 320 | "sdhc1-detect", data); |
@@ -336,7 +333,7 @@ gpio_free: | |||
336 | 333 | ||
337 | static void mx31_3ds_sdhc1_exit(struct device *dev, void *data) | 334 | static void mx31_3ds_sdhc1_exit(struct device *dev, void *data) |
338 | { | 335 | { |
339 | free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), data); | 336 | free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)), data); |
340 | gpio_free_array(mx31_3ds_sdhc1_gpios, | 337 | gpio_free_array(mx31_3ds_sdhc1_gpios, |
341 | ARRAY_SIZE(mx31_3ds_sdhc1_gpios)); | 338 | ARRAY_SIZE(mx31_3ds_sdhc1_gpios)); |
342 | } | 339 | } |
@@ -539,7 +536,7 @@ static struct spi_board_info mx31_3ds_spi_devs[] __initdata = { | |||
539 | .bus_num = 1, | 536 | .bus_num = 1, |
540 | .chip_select = 1, /* SS2 */ | 537 | .chip_select = 1, /* SS2 */ |
541 | .platform_data = &mc13783_pdata, | 538 | .platform_data = &mc13783_pdata, |
542 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | 539 | /* irq number is run-time assigned */ |
543 | .mode = SPI_CS_HIGH, | 540 | .mode = SPI_CS_HIGH, |
544 | }, { | 541 | }, { |
545 | .modalias = "l4f00242t03", | 542 | .modalias = "l4f00242t03", |
@@ -714,6 +711,7 @@ static void __init mx31_3ds_init(void) | |||
714 | imx31_add_mxc_nand(&mx31_3ds_nand_board_info); | 711 | imx31_add_mxc_nand(&mx31_3ds_nand_board_info); |
715 | 712 | ||
716 | imx31_add_spi_imx1(&spi1_pdata); | 713 | imx31_add_spi_imx1(&spi1_pdata); |
714 | mx31_3ds_spi_devs[0].irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | ||
717 | spi_register_board_info(mx31_3ds_spi_devs, | 715 | spi_register_board_info(mx31_3ds_spi_devs, |
718 | ARRAY_SIZE(mx31_3ds_spi_devs)); | 716 | ARRAY_SIZE(mx31_3ds_spi_devs)); |
719 | 717 | ||
@@ -736,7 +734,8 @@ static void __init mx31_3ds_init(void) | |||
736 | if (!otg_mode_host) | 734 | if (!otg_mode_host) |
737 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | 735 | imx31_add_fsl_usb2_udc(&usbotg_pdata); |
738 | 736 | ||
739 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 737 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, |
738 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)))) | ||
740 | printk(KERN_WARNING "Init of the debug board failed, all " | 739 | printk(KERN_WARNING "Init of the debug board failed, all " |
741 | "devices on the debug board are unusable.\n"); | 740 | "devices on the debug board are unusable.\n"); |
742 | imx31_add_imx2_wdt(NULL); | 741 | imx31_add_imx2_wdt(NULL); |
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index 4518e5448227..6f19f98ddbe9 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c | |||
@@ -62,7 +62,6 @@ | |||
62 | #define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) | 62 | #define PBC_INTSTATUS_REG (PBC_INTSTATUS + PBC_BASE_ADDRESS) |
63 | #define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS) | 63 | #define PBC_INTMASK_SET_REG (PBC_INTMASK_SET + PBC_BASE_ADDRESS) |
64 | #define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) | 64 | #define PBC_INTMASK_CLEAR_REG (PBC_INTMASK_CLEAR + PBC_BASE_ADDRESS) |
65 | #define EXPIO_PARENT_INT IOMUX_TO_IRQ(MX31_PIN_GPIO1_4) | ||
66 | 65 | ||
67 | #define MXC_EXP_IO_BASE MXC_BOARD_IRQ_START | 66 | #define MXC_EXP_IO_BASE MXC_BOARD_IRQ_START |
68 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) | 67 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_EXP_IO_BASE) |
@@ -209,7 +208,7 @@ static struct irq_chip expio_irq_chip = { | |||
209 | 208 | ||
210 | static void __init mx31ads_init_expio(void) | 209 | static void __init mx31ads_init_expio(void) |
211 | { | 210 | { |
212 | int i; | 211 | int i, irq; |
213 | 212 | ||
214 | printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n"); | 213 | printk(KERN_INFO "MX31ADS EXPIO(CPLD) hardware\n"); |
215 | 214 | ||
@@ -226,8 +225,9 @@ static void __init mx31ads_init_expio(void) | |||
226 | irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); | 225 | irq_set_chip_and_handler(i, &expio_irq_chip, handle_level_irq); |
227 | set_irq_flags(i, IRQF_VALID); | 226 | set_irq_flags(i, IRQF_VALID); |
228 | } | 227 | } |
229 | irq_set_irq_type(EXPIO_PARENT_INT, IRQ_TYPE_LEVEL_HIGH); | 228 | irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_4)); |
230 | irq_set_chained_handler(EXPIO_PARENT_INT, mx31ads_expio_irq_handler); | 229 | irq_set_irq_type(irq, IRQ_TYPE_LEVEL_HIGH); |
230 | irq_set_chained_handler(irq, mx31ads_expio_irq_handler); | ||
231 | } | 231 | } |
232 | 232 | ||
233 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | 233 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 |
@@ -488,13 +488,17 @@ static struct i2c_board_info __initdata mx31ads_i2c1_devices[] = { | |||
488 | { | 488 | { |
489 | I2C_BOARD_INFO("wm8350", 0x1a), | 489 | I2C_BOARD_INFO("wm8350", 0x1a), |
490 | .platform_data = &mx31_wm8350_pdata, | 490 | .platform_data = &mx31_wm8350_pdata, |
491 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | 491 | /* irq number is run-time assigned */ |
492 | }, | 492 | }, |
493 | #endif | 493 | #endif |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static void __init mxc_init_i2c(void) | 496 | static void __init mxc_init_i2c(void) |
497 | { | 497 | { |
498 | #ifdef CONFIG_MACH_MX31ADS_WM1133_EV1 | ||
499 | mx31ads_i2c1_devices[0].irq = | ||
500 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | ||
501 | #endif | ||
498 | i2c_register_board_info(1, mx31ads_i2c1_devices, | 502 | i2c_register_board_info(1, mx31ads_i2c1_devices, |
499 | ARRAY_SIZE(mx31ads_i2c1_devices)); | 503 | ARRAY_SIZE(mx31ads_i2c1_devices)); |
500 | 504 | ||
diff --git a/arch/arm/mach-imx/mach-mx31lilly.c b/arch/arm/mach-imx/mach-mx31lilly.c index 83714b0cc290..34b9bf075daf 100644 --- a/arch/arm/mach-imx/mach-mx31lilly.c +++ b/arch/arm/mach-imx/mach-mx31lilly.c | |||
@@ -65,8 +65,7 @@ static struct resource smsc91x_resources[] = { | |||
65 | .flags = IORESOURCE_MEM, | 65 | .flags = IORESOURCE_MEM, |
66 | }, | 66 | }, |
67 | { | 67 | { |
68 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | 68 | /* irq number is run-time assigned */ |
69 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO1_0), | ||
70 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, | 69 | .flags = IORESOURCE_IRQ | IRQF_TRIGGER_FALLING, |
71 | } | 70 | } |
72 | }; | 71 | }; |
@@ -233,7 +232,7 @@ static struct spi_board_info mc13783_dev __initdata = { | |||
233 | .bus_num = 1, | 232 | .bus_num = 1, |
234 | .chip_select = 0, | 233 | .chip_select = 0, |
235 | .platform_data = &mc13783_pdata, | 234 | .platform_data = &mc13783_pdata, |
236 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | 235 | /* irq number is run-time assigned */ |
237 | }; | 236 | }; |
238 | 237 | ||
239 | static struct platform_device *devices[] __initdata = { | 238 | static struct platform_device *devices[] __initdata = { |
@@ -285,10 +284,15 @@ static void __init mx31lilly_board_init(void) | |||
285 | 284 | ||
286 | imx31_add_spi_imx0(&spi0_pdata); | 285 | imx31_add_spi_imx0(&spi0_pdata); |
287 | imx31_add_spi_imx1(&spi1_pdata); | 286 | imx31_add_spi_imx1(&spi1_pdata); |
287 | mc13783_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | ||
288 | spi_register_board_info(&mc13783_dev, 1); | 288 | spi_register_board_info(&mc13783_dev, 1); |
289 | 289 | ||
290 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | 290 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); |
291 | 291 | ||
292 | smsc91x_resources[1].start = | ||
293 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); | ||
294 | smsc91x_resources[1].end = | ||
295 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_0)); | ||
292 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 296 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
293 | 297 | ||
294 | /* USB */ | 298 | /* USB */ |
diff --git a/arch/arm/mach-imx/mach-mx31lite.c b/arch/arm/mach-imx/mach-mx31lite.c index 686c60587980..4977378d2f60 100644 --- a/arch/arm/mach-imx/mach-mx31lite.c +++ b/arch/arm/mach-imx/mach-mx31lite.c | |||
@@ -83,8 +83,7 @@ static struct resource smsc911x_resources[] = { | |||
83 | .end = MX31_CS4_BASE_ADDR + 0x100, | 83 | .end = MX31_CS4_BASE_ADDR + 0x100, |
84 | .flags = IORESOURCE_MEM, | 84 | .flags = IORESOURCE_MEM, |
85 | }, { | 85 | }, { |
86 | .start = IOMUX_TO_IRQ(MX31_PIN_SFS6), | 86 | /* irq number is run-time assigned */ |
87 | .end = IOMUX_TO_IRQ(MX31_PIN_SFS6), | ||
88 | .flags = IORESOURCE_IRQ, | 87 | .flags = IORESOURCE_IRQ, |
89 | }, | 88 | }, |
90 | }; | 89 | }; |
@@ -124,7 +123,7 @@ static struct spi_board_info mc13783_spi_dev __initdata = { | |||
124 | .bus_num = 1, | 123 | .bus_num = 1, |
125 | .chip_select = 0, | 124 | .chip_select = 0, |
126 | .platform_data = &mc13783_pdata, | 125 | .platform_data = &mc13783_pdata, |
127 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | 126 | /* irq number is run-time assigned */ |
128 | }; | 127 | }; |
129 | 128 | ||
130 | /* | 129 | /* |
@@ -258,6 +257,7 @@ static void __init mx31lite_init(void) | |||
258 | imx31_add_mxc_nand(&mx31lite_nand_board_info); | 257 | imx31_add_mxc_nand(&mx31lite_nand_board_info); |
259 | 258 | ||
260 | imx31_add_spi_imx1(&spi1_pdata); | 259 | imx31_add_spi_imx1(&spi1_pdata); |
260 | mc13783_spi_dev.irq = gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | ||
261 | spi_register_board_info(&mc13783_spi_dev, 1); | 261 | spi_register_board_info(&mc13783_spi_dev, 1); |
262 | 262 | ||
263 | /* USB */ | 263 | /* USB */ |
@@ -274,6 +274,10 @@ static void __init mx31lite_init(void) | |||
274 | pr_warning("could not get LAN irq gpio\n"); | 274 | pr_warning("could not get LAN irq gpio\n"); |
275 | else { | 275 | else { |
276 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6)); | 276 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_SFS6)); |
277 | smsc911x_resources[1].start = | ||
278 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6)); | ||
279 | smsc911x_resources[1].end = | ||
280 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SFS6)); | ||
277 | platform_device_register(&smsc911x_device); | 281 | platform_device_register(&smsc911x_device); |
278 | } | 282 | } |
279 | } | 283 | } |
diff --git a/arch/arm/mach-imx/mach-mx31moboard.c b/arch/arm/mach-imx/mach-mx31moboard.c index 016791f038b0..f0d26db7719e 100644 --- a/arch/arm/mach-imx/mach-mx31moboard.c +++ b/arch/arm/mach-imx/mach-mx31moboard.c | |||
@@ -303,7 +303,7 @@ static struct imx_ssi_platform_data moboard_ssi_pdata = { | |||
303 | static struct spi_board_info moboard_spi_board_info[] __initdata = { | 303 | static struct spi_board_info moboard_spi_board_info[] __initdata = { |
304 | { | 304 | { |
305 | .modalias = "mc13783", | 305 | .modalias = "mc13783", |
306 | .irq = IOMUX_TO_IRQ(MX31_PIN_GPIO1_3), | 306 | /* irq number is run-time assigned */ |
307 | .max_speed_hz = 300000, | 307 | .max_speed_hz = 300000, |
308 | .bus_num = 1, | 308 | .bus_num = 1, |
309 | .chip_select = 0, | 309 | .chip_select = 0, |
@@ -557,6 +557,8 @@ static void __init mx31moboard_init(void) | |||
557 | 557 | ||
558 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); | 558 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3), "pmic-irq"); |
559 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | 559 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); |
560 | moboard_spi_board_info[0].irq = | ||
561 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_3)); | ||
560 | spi_register_board_info(moboard_spi_board_info, | 562 | spi_register_board_info(moboard_spi_board_info, |
561 | ARRAY_SIZE(moboard_spi_board_info)); | 563 | ARRAY_SIZE(moboard_spi_board_info)); |
562 | 564 | ||
diff --git a/arch/arm/mach-imx/mach-pcm037.c b/arch/arm/mach-imx/mach-pcm037.c index 0a40004154f2..551a035f0c2d 100644 --- a/arch/arm/mach-imx/mach-pcm037.c +++ b/arch/arm/mach-imx/mach-pcm037.c | |||
@@ -225,8 +225,7 @@ static struct resource smsc911x_resources[] = { | |||
225 | .end = MX31_CS1_BASE_ADDR + 0x300 + SZ_64K - 1, | 225 | .end = MX31_CS1_BASE_ADDR + 0x300 + SZ_64K - 1, |
226 | .flags = IORESOURCE_MEM, | 226 | .flags = IORESOURCE_MEM, |
227 | }, { | 227 | }, { |
228 | .start = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), | 228 | /* irq number is run-time assigned */ |
229 | .end = IOMUX_TO_IRQ(MX31_PIN_GPIO3_1), | ||
230 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | 229 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
231 | }, | 230 | }, |
232 | }; | 231 | }; |
@@ -371,7 +370,7 @@ static int pcm970_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | |||
371 | gpio_direction_input(SDHC1_GPIO_WP); | 370 | gpio_direction_input(SDHC1_GPIO_WP); |
372 | #endif | 371 | #endif |
373 | 372 | ||
374 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), detect_irq, | 373 | ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SCK6)), detect_irq, |
375 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, | 374 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, |
376 | "sdhc-detect", data); | 375 | "sdhc-detect", data); |
377 | if (ret) | 376 | if (ret) |
@@ -391,7 +390,7 @@ err_gpio_free: | |||
391 | 390 | ||
392 | static void pcm970_sdhc1_exit(struct device *dev, void *data) | 391 | static void pcm970_sdhc1_exit(struct device *dev, void *data) |
393 | { | 392 | { |
394 | free_irq(IOMUX_TO_IRQ(MX31_PIN_SCK6), data); | 393 | free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_SCK6)), data); |
395 | gpio_free(SDHC1_GPIO_DET); | 394 | gpio_free(SDHC1_GPIO_DET); |
396 | gpio_free(SDHC1_GPIO_WP); | 395 | gpio_free(SDHC1_GPIO_WP); |
397 | } | 396 | } |
@@ -511,8 +510,7 @@ static struct resource pcm970_sja1000_resources[] = { | |||
511 | .end = MX31_CS5_BASE_ADDR + 0x100 - 1, | 510 | .end = MX31_CS5_BASE_ADDR + 0x100 - 1, |
512 | .flags = IORESOURCE_MEM, | 511 | .flags = IORESOURCE_MEM, |
513 | }, { | 512 | }, { |
514 | .start = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)), | 513 | /* irq number is run-time assigned */ |
515 | .end = IOMUX_TO_IRQ(IOMUX_PIN(48, 105)), | ||
516 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, | 514 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, |
517 | }, | 515 | }, |
518 | }; | 516 | }; |
@@ -633,6 +631,10 @@ static void __init pcm037_init(void) | |||
633 | pr_warning("could not get LAN irq gpio\n"); | 631 | pr_warning("could not get LAN irq gpio\n"); |
634 | else { | 632 | else { |
635 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); | 633 | gpio_direction_input(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); |
634 | smsc911x_resources[1].start = | ||
635 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); | ||
636 | smsc911x_resources[1].end = | ||
637 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO3_1)); | ||
636 | platform_device_register(&pcm037_eth); | 638 | platform_device_register(&pcm037_eth); |
637 | } | 639 | } |
638 | 640 | ||
@@ -659,6 +661,10 @@ static void __init pcm037_init(void) | |||
659 | 661 | ||
660 | pcm037_init_camera(); | 662 | pcm037_init_camera(); |
661 | 663 | ||
664 | pcm970_sja1000_resources[1].start = | ||
665 | gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105))); | ||
666 | pcm970_sja1000_resources[1].end = | ||
667 | gpio_to_irq(IOMUX_TO_GPIO(IOMUX_PIN(48, 105))); | ||
662 | platform_device_register(&pcm970_sja1000); | 668 | platform_device_register(&pcm970_sja1000); |
663 | 669 | ||
664 | if (otg_mode_host) { | 670 | if (otg_mode_host) { |
diff --git a/arch/arm/mach-imx/mach-qong.c b/arch/arm/mach-imx/mach-qong.c index 260621055b6b..b6f11d25f25a 100644 --- a/arch/arm/mach-imx/mach-qong.c +++ b/arch/arm/mach-imx/mach-qong.c | |||
@@ -51,8 +51,6 @@ | |||
51 | (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE) | 51 | (QONG_FPGA_BASEADDR + QONG_DNET_ID * QONG_FPGA_PERIPH_SIZE) |
52 | #define QONG_DNET_SIZE 0x00001000 | 52 | #define QONG_DNET_SIZE 0x00001000 |
53 | 53 | ||
54 | #define QONG_FPGA_IRQ IOMUX_TO_IRQ(MX31_PIN_DTR_DCE1) | ||
55 | |||
56 | static const struct imxuart_platform_data uart_pdata __initconst = { | 54 | static const struct imxuart_platform_data uart_pdata __initconst = { |
57 | .flags = IMXUART_HAVE_RTSCTS, | 55 | .flags = IMXUART_HAVE_RTSCTS, |
58 | }; | 56 | }; |
@@ -78,8 +76,7 @@ static struct resource dnet_resources[] = { | |||
78 | .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1, | 76 | .end = QONG_DNET_BASEADDR + QONG_DNET_SIZE - 1, |
79 | .flags = IORESOURCE_MEM, | 77 | .flags = IORESOURCE_MEM, |
80 | }, { | 78 | }, { |
81 | .start = QONG_FPGA_IRQ, | 79 | /* irq number is run-time assigned */ |
82 | .end = QONG_FPGA_IRQ, | ||
83 | .flags = IORESOURCE_IRQ, | 80 | .flags = IORESOURCE_IRQ, |
84 | }, | 81 | }, |
85 | }; | 82 | }; |
@@ -95,6 +92,10 @@ static int __init qong_init_dnet(void) | |||
95 | { | 92 | { |
96 | int ret; | 93 | int ret; |
97 | 94 | ||
95 | dnet_resources[1].start = | ||
96 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)); | ||
97 | dnet_resources[1].end = | ||
98 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1)); | ||
98 | ret = platform_device_register(&dnet_device); | 99 | ret = platform_device_register(&dnet_device); |
99 | return ret; | 100 | return ret; |
100 | } | 101 | } |
diff --git a/arch/arm/mach-imx/mx31lilly-db.c b/arch/arm/mach-imx/mx31lilly-db.c index 7d26f766a4ee..2df625bdc71e 100644 --- a/arch/arm/mach-imx/mx31lilly-db.c +++ b/arch/arm/mach-imx/mx31lilly-db.c | |||
@@ -130,7 +130,8 @@ static int mxc_mmc1_init(struct device *dev, | |||
130 | gpio_direction_input(gpio_det); | 130 | gpio_direction_input(gpio_det); |
131 | gpio_direction_input(gpio_wp); | 131 | gpio_direction_input(gpio_wp); |
132 | 132 | ||
133 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), detect_irq, | 133 | ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)), |
134 | detect_irq, | ||
134 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, | 135 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, |
135 | "MMC detect", data); | 136 | "MMC detect", data); |
136 | if (ret) | 137 | if (ret) |
@@ -151,7 +152,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data) | |||
151 | { | 152 | { |
152 | gpio_free(gpio_det); | 153 | gpio_free(gpio_det); |
153 | gpio_free(gpio_wp); | 154 | gpio_free(gpio_wp); |
154 | free_irq(IOMUX_TO_IRQ(MX31_PIN_GPIO1_1), data); | 155 | free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)), data); |
155 | } | 156 | } |
156 | 157 | ||
157 | static const struct imxmmc_platform_data mmc_pdata __initconst = { | 158 | static const struct imxmmc_platform_data mmc_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mx31lite-db.c b/arch/arm/mach-imx/mx31lite-db.c index bf0fb87946ba..d639391a5841 100644 --- a/arch/arm/mach-imx/mx31lite-db.c +++ b/arch/arm/mach-imx/mx31lite-db.c | |||
@@ -116,7 +116,8 @@ static int mxc_mmc1_init(struct device *dev, | |||
116 | gpio_direction_input(gpio_det); | 116 | gpio_direction_input(gpio_det); |
117 | gpio_direction_input(gpio_wp); | 117 | gpio_direction_input(gpio_wp); |
118 | 118 | ||
119 | ret = request_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), detect_irq, | 119 | ret = request_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)), |
120 | detect_irq, | ||
120 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | 121 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, |
121 | "MMC detect", data); | 122 | "MMC detect", data); |
122 | if (ret) | 123 | if (ret) |
@@ -137,7 +138,7 @@ static void mxc_mmc1_exit(struct device *dev, void *data) | |||
137 | { | 138 | { |
138 | gpio_free(gpio_det); | 139 | gpio_free(gpio_det); |
139 | gpio_free(gpio_wp); | 140 | gpio_free(gpio_wp); |
140 | free_irq(IOMUX_TO_IRQ(MX31_PIN_DCD_DCE1), data); | 141 | free_irq(gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_DCD_DCE1)), data); |
141 | } | 142 | } |
142 | 143 | ||
143 | static const struct imxmmc_platform_data mmc_pdata __initconst = { | 144 | static const struct imxmmc_platform_data mmc_pdata __initconst = { |