diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-13 03:58:08 -0400 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:58:08 -0400 |
commit | ed4a7fb01a467f5d264fe12f17eb981f21c7bbcd (patch) | |
tree | 5c7e553d820e844391df0c23c4238d6f046bb5e4 /arch | |
parent | 1595f16c5e537cb33e118e7ae18dff139f22bdb1 (diff) |
ARM: imx: pass gpio than irq number into mxc_expio_init
Change mxc_expio_init interface a little bit to have gpio than irq
number passed in. With the change, gpio_to_irq can be called inside
mxc_expio_init to get irq number, so that MXC_IRQ_TO_GPIO can be
removed.
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')
-rw-r--r-- | arch/arm/mach-imx/mach-mx27_3ds.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx31_3ds.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx35_3ds.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx51_3ds.c | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/3ds_debugboard.c | 8 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/3ds_debugboard.h | 2 |
6 files changed, 9 insertions, 14 deletions
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index 18b9bcaa40e3..eeff0b6aaba3 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -48,7 +48,6 @@ | |||
48 | #define SD1_EN_GPIO IMX_GPIO_NR(2, 25) | 48 | #define SD1_EN_GPIO IMX_GPIO_NR(2, 25) |
49 | #define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23) | 49 | #define OTG_PHY_RESET_GPIO IMX_GPIO_NR(2, 23) |
50 | #define SPI2_SS0 IMX_GPIO_NR(4, 21) | 50 | #define SPI2_SS0 IMX_GPIO_NR(4, 21) |
51 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(3, 28)) | ||
52 | #define PMIC_INT IMX_GPIO_NR(3, 14) | 51 | #define PMIC_INT IMX_GPIO_NR(3, 14) |
53 | #define SPI1_SS0 IMX_GPIO_NR(4, 28) | 52 | #define SPI1_SS0 IMX_GPIO_NR(4, 28) |
54 | #define SD1_CD IMX_GPIO_NR(2, 26) | 53 | #define SD1_CD IMX_GPIO_NR(2, 26) |
@@ -500,7 +499,7 @@ static void __init mx27pdk_init(void) | |||
500 | spi_register_board_info(mx27_3ds_spi_devs, | 499 | spi_register_board_info(mx27_3ds_spi_devs, |
501 | ARRAY_SIZE(mx27_3ds_spi_devs)); | 500 | ARRAY_SIZE(mx27_3ds_spi_devs)); |
502 | 501 | ||
503 | if (mxc_expio_init(MX27_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 502 | if (mxc_expio_init(MX27_CS5_BASE_ADDR, IMX_GPIO_NR(3, 28))) |
504 | pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); | 503 | pr_warn("Init of the debugboard failed, all devices on the debugboard are unusable.\n"); |
505 | imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); | 504 | imx27_add_imx_i2c(0, &mx27_3ds_i2c0_data); |
506 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 505 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
diff --git a/arch/arm/mach-imx/mach-mx31_3ds.c b/arch/arm/mach-imx/mach-mx31_3ds.c index 618935e1e325..f37d9b5774ab 100644 --- a/arch/arm/mach-imx/mach-mx31_3ds.c +++ b/arch/arm/mach-imx/mach-mx31_3ds.c | |||
@@ -730,8 +730,7 @@ static void __init mx31_3ds_init(void) | |||
730 | if (!otg_mode_host) | 730 | if (!otg_mode_host) |
731 | imx31_add_fsl_usb2_udc(&usbotg_pdata); | 731 | imx31_add_fsl_usb2_udc(&usbotg_pdata); |
732 | 732 | ||
733 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, | 733 | if (mxc_expio_init(MX31_CS5_BASE_ADDR, IOMUX_TO_GPIO(MX31_PIN_GPIO1_1))) |
734 | gpio_to_irq(IOMUX_TO_GPIO(MX31_PIN_GPIO1_1)))) | ||
735 | printk(KERN_WARNING "Init of the debug board failed, all " | 734 | printk(KERN_WARNING "Init of the debug board failed, all " |
736 | "devices on the debug board are unusable.\n"); | 735 | "devices on the debug board are unusable.\n"); |
737 | imx31_add_imx2_wdt(NULL); | 736 | imx31_add_imx2_wdt(NULL); |
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c index ad63e6ebee6d..596f237c0d0e 100644 --- a/arch/arm/mach-imx/mach-mx35_3ds.c +++ b/arch/arm/mach-imx/mach-mx35_3ds.c | |||
@@ -132,8 +132,6 @@ static struct platform_device mx35_3ds_lcd = { | |||
132 | .dev.platform_data = &mx35_3ds_lcd_data, | 132 | .dev.platform_data = &mx35_3ds_lcd_data, |
133 | }; | 133 | }; |
134 | 134 | ||
135 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 1)) | ||
136 | |||
137 | static const struct imxuart_platform_data uart_pdata __initconst = { | 135 | static const struct imxuart_platform_data uart_pdata __initconst = { |
138 | .flags = IMXUART_HAVE_RTSCTS, | 136 | .flags = IMXUART_HAVE_RTSCTS, |
139 | }; | 137 | }; |
@@ -580,7 +578,7 @@ static void __init mx35_3ds_init(void) | |||
580 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); | 578 | imx35_add_mxc_nand(&mx35pdk_nand_board_info); |
581 | imx35_add_sdhci_esdhc_imx(0, NULL); | 579 | imx35_add_sdhci_esdhc_imx(0, NULL); |
582 | 580 | ||
583 | if (mxc_expio_init(MX35_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 581 | if (mxc_expio_init(MX35_CS5_BASE_ADDR, IMX_GPIO_NR(1, 1))) |
584 | pr_warn("Init of the debugboard failed, all " | 582 | pr_warn("Init of the debugboard failed, all " |
585 | "devices on the debugboard are unusable.\n"); | 583 | "devices on the debugboard are unusable.\n"); |
586 | imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); | 584 | imx35_add_imx_i2c0(&mx35_3ds_i2c0_data); |
diff --git a/arch/arm/mach-imx/mach-mx51_3ds.c b/arch/arm/mach-imx/mach-mx51_3ds.c index 3c5b163923f6..ebb91882ae63 100644 --- a/arch/arm/mach-imx/mach-mx51_3ds.c +++ b/arch/arm/mach-imx/mach-mx51_3ds.c | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include "devices-imx51.h" | 27 | #include "devices-imx51.h" |
28 | 28 | ||
29 | #define EXPIO_PARENT_INT gpio_to_irq(IMX_GPIO_NR(1, 6)) | ||
30 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) | 29 | #define MX51_3DS_ECSPI2_CS (GPIO_PORTC + 28) |
31 | 30 | ||
32 | static iomux_v3_cfg_t mx51_3ds_pads[] = { | 31 | static iomux_v3_cfg_t mx51_3ds_pads[] = { |
@@ -148,7 +147,7 @@ static void __init mx51_3ds_init(void) | |||
148 | spi_register_board_info(mx51_3ds_spi_nor_device, | 147 | spi_register_board_info(mx51_3ds_spi_nor_device, |
149 | ARRAY_SIZE(mx51_3ds_spi_nor_device)); | 148 | ARRAY_SIZE(mx51_3ds_spi_nor_device)); |
150 | 149 | ||
151 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, EXPIO_PARENT_INT)) | 150 | if (mxc_expio_init(MX51_CS5_BASE_ADDR, IMX_GPIO_NR(1, 6))) |
152 | printk(KERN_WARNING "Init of the debugboard failed, all " | 151 | printk(KERN_WARNING "Init of the debugboard failed, all " |
153 | "devices on the board are unusable.\n"); | 152 | "devices on the board are unusable.\n"); |
154 | 153 | ||
diff --git a/arch/arm/plat-mxc/3ds_debugboard.c b/arch/arm/plat-mxc/3ds_debugboard.c index 5cac2c540f4f..3b48a08c165a 100644 --- a/arch/arm/plat-mxc/3ds_debugboard.c +++ b/arch/arm/plat-mxc/3ds_debugboard.c | |||
@@ -49,7 +49,6 @@ | |||
49 | #define MCU_BOARD_ID_REG 0x68 | 49 | #define MCU_BOARD_ID_REG 0x68 |
50 | 50 | ||
51 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_BOARD_IRQ_START) | 51 | #define MXC_IRQ_TO_EXPIO(irq) ((irq) - MXC_BOARD_IRQ_START) |
52 | #define MXC_IRQ_TO_GPIO(irq) ((irq) - MXC_INTERNAL_IRQS) | ||
53 | 52 | ||
54 | #define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START) | 53 | #define MXC_EXP_IO_BASE (MXC_BOARD_IRQ_START) |
55 | #define MXC_MAX_EXP_IO_LINES 16 | 54 | #define MXC_MAX_EXP_IO_LINES 16 |
@@ -155,8 +154,9 @@ static struct regulator_consumer_supply dummy_supplies[] = { | |||
155 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | 154 | REGULATOR_SUPPLY("vddvario", "smsc911x"), |
156 | }; | 155 | }; |
157 | 156 | ||
158 | int __init mxc_expio_init(u32 base, u32 p_irq) | 157 | int __init mxc_expio_init(u32 base, u32 intr_gpio) |
159 | { | 158 | { |
159 | u32 p_irq = gpio_to_irq(intr_gpio); | ||
160 | int i; | 160 | int i; |
161 | 161 | ||
162 | brd_io = ioremap(BOARD_IO_ADDR(base), SZ_4K); | 162 | brd_io = ioremap(BOARD_IO_ADDR(base), SZ_4K); |
@@ -178,8 +178,8 @@ int __init mxc_expio_init(u32 base, u32 p_irq) | |||
178 | /* | 178 | /* |
179 | * Configure INT line as GPIO input | 179 | * Configure INT line as GPIO input |
180 | */ | 180 | */ |
181 | gpio_request(MXC_IRQ_TO_GPIO(p_irq), "expio_pirq"); | 181 | gpio_request(intr_gpio, "expio_pirq"); |
182 | gpio_direction_input(MXC_IRQ_TO_GPIO(p_irq)); | 182 | gpio_direction_input(intr_gpio); |
183 | 183 | ||
184 | /* disable the interrupt and clear the status */ | 184 | /* disable the interrupt and clear the status */ |
185 | __raw_writew(0, brd_io + INTR_MASK_REG); | 185 | __raw_writew(0, brd_io + INTR_MASK_REG); |
diff --git a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h b/arch/arm/plat-mxc/include/mach/3ds_debugboard.h index a384fdd49c62..9fd6cb3f8fad 100644 --- a/arch/arm/plat-mxc/include/mach/3ds_debugboard.h +++ b/arch/arm/plat-mxc/include/mach/3ds_debugboard.h | |||
@@ -13,6 +13,6 @@ | |||
13 | #ifndef __ASM_ARCH_MXC_3DS_DB_H__ | 13 | #ifndef __ASM_ARCH_MXC_3DS_DB_H__ |
14 | #define __ASM_ARCH_MXC_3DS_DB_H__ | 14 | #define __ASM_ARCH_MXC_3DS_DB_H__ |
15 | 15 | ||
16 | extern int __init mxc_expio_init(u32 base, u32 p_irq); | 16 | extern int __init mxc_expio_init(u32 base, u32 intr_gpio); |
17 | 17 | ||
18 | #endif /* __ASM_ARCH_MXC_3DS_DB_H__ */ | 18 | #endif /* __ASM_ARCH_MXC_3DS_DB_H__ */ |