aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mach-pcm037.c
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2011-12-02 07:00:33 -0500
committerShawn Guo <shawn.guo@linaro.org>2012-07-01 09:57:06 -0400
commited175343b4b53d686e30b1e37fb94e142f56fa2f (patch)
treec7d8c37edafa9d6f9c06034bbb6a9c7bf00dfe7f /arch/arm/mach-imx/mach-pcm037.c
parent84715dd6c19e058557ab173d327ea65eac0ccb02 (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/mach-pcm037.c')
-rw-r--r--arch/arm/mach-imx/mach-pcm037.c18
1 files changed, 12 insertions, 6 deletions
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
392static void pcm970_sdhc1_exit(struct device *dev, void *data) 391static 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) {