diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-12-04 21:12:28 -0500 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-07-01 09:57:16 -0400 |
commit | 438196c371cb32f0eacaf2a44166d9a0cf37c4a8 (patch) | |
tree | 8e502f38302ba1226444c73aaa84aae86464583f | |
parent | ed175343b4b53d686e30b1e37fb94e142f56fa2f (diff) |
ARM: imx: eliminate macro IRQ_GPIOx()
This patch changes all the static gpio irq number assigning with
IRQ_GPIOA() ... IRQ_GPIOF() to run-time assigning with gpio_to_irq
call, and in turn eliminates these macros.
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>
-rw-r--r-- | arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-apf9328.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-cpuimx27.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx21ads.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mx27ads.c | 12 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-mxt_td60.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pca100.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pcm038.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-scb9328.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/pcm970-baseboard.c | 13 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/iomux-v1.h | 7 |
12 files changed, 55 insertions, 43 deletions
diff --git a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c index b46cab0ced53..fd3177f9e79a 100644 --- a/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c +++ b/arch/arm/mach-imx/eukrea_mbimx27-baseboard.c | |||
@@ -266,7 +266,7 @@ static struct spi_board_info __maybe_unused | |||
266 | .bus_num = 0, | 266 | .bus_num = 0, |
267 | .chip_select = 0, | 267 | .chip_select = 0, |
268 | .max_speed_hz = 1500000, | 268 | .max_speed_hz = 1500000, |
269 | .irq = IRQ_GPIOD(25), | 269 | /* irq number is run-time assigned */ |
270 | .platform_data = &ads7846_config, | 270 | .platform_data = &ads7846_config, |
271 | .mode = SPI_MODE_2, | 271 | .mode = SPI_MODE_2, |
272 | }, | 272 | }, |
@@ -329,6 +329,7 @@ void __init eukrea_mbimx27_baseboard_init(void) | |||
329 | /* SPI_CS0 init */ | 329 | /* SPI_CS0 init */ |
330 | mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); | 330 | mxc_gpio_mode(GPIO_PORTD | 28 | GPIO_GPIO | GPIO_OUT); |
331 | imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data); | 331 | imx27_add_spi_imx0(&eukrea_mbimx27_spi0_data); |
332 | eukrea_mbimx27_spi_board_info[0].irq = gpio_to_irq(IMX_GPIO_NR(4, 25)); | ||
332 | spi_register_board_info(eukrea_mbimx27_spi_board_info, | 333 | spi_register_board_info(eukrea_mbimx27_spi_board_info, |
333 | ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); | 334 | ARRAY_SIZE(eukrea_mbimx27_spi_board_info)); |
334 | 335 | ||
diff --git a/arch/arm/mach-imx/mach-apf9328.c b/arch/arm/mach-imx/mach-apf9328.c index f4a63ee9e217..5062fcb88498 100644 --- a/arch/arm/mach-imx/mach-apf9328.c +++ b/arch/arm/mach-imx/mach-apf9328.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/mtd/physmap.h> | 19 | #include <linux/mtd/physmap.h> |
20 | #include <linux/dm9000.h> | 20 | #include <linux/dm9000.h> |
21 | #include <linux/gpio.h> | ||
21 | #include <linux/i2c.h> | 22 | #include <linux/i2c.h> |
22 | 23 | ||
23 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
@@ -87,8 +88,7 @@ static struct resource dm9000_resources[] = { | |||
87 | .end = MX1_CS4_PHYS + 0x00C00003, | 88 | .end = MX1_CS4_PHYS + 0x00C00003, |
88 | .flags = IORESOURCE_MEM, | 89 | .flags = IORESOURCE_MEM, |
89 | }, { | 90 | }, { |
90 | .start = IRQ_GPIOB(14), | 91 | /* irq number is run-time assigned */ |
91 | .end = IRQ_GPIOB(14), | ||
92 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | 92 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
93 | }, | 93 | }, |
94 | }; | 94 | }; |
@@ -129,6 +129,8 @@ static void __init apf9328_init(void) | |||
129 | 129 | ||
130 | imx1_add_imx_i2c(&apf9328_i2c_data); | 130 | imx1_add_imx_i2c(&apf9328_i2c_data); |
131 | 131 | ||
132 | dm9000_resources[2].start = gpio_to_irq(IMX_GPIO_NR(2, 14)); | ||
133 | dm9000_resources[2].end = gpio_to_irq(IMX_GPIO_NR(2, 14)); | ||
132 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 134 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
133 | } | 135 | } |
134 | 136 | ||
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index d085aea08709..fe74c84a1f4e 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -169,28 +169,28 @@ static struct i2c_board_info eukrea_cpuimx27_i2c_devices[] = { | |||
169 | static struct plat_serial8250_port serial_platform_data[] = { | 169 | static struct plat_serial8250_port serial_platform_data[] = { |
170 | { | 170 | { |
171 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000), | 171 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x200000), |
172 | .irq = IRQ_GPIOB(23), | 172 | /* irq number is run-time assigned */ |
173 | .uartclk = 14745600, | 173 | .uartclk = 14745600, |
174 | .regshift = 1, | 174 | .regshift = 1, |
175 | .iotype = UPIO_MEM, | 175 | .iotype = UPIO_MEM, |
176 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, | 176 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, |
177 | }, { | 177 | }, { |
178 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000), | 178 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x400000), |
179 | .irq = IRQ_GPIOB(22), | 179 | /* irq number is run-time assigned */ |
180 | .uartclk = 14745600, | 180 | .uartclk = 14745600, |
181 | .regshift = 1, | 181 | .regshift = 1, |
182 | .iotype = UPIO_MEM, | 182 | .iotype = UPIO_MEM, |
183 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, | 183 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, |
184 | }, { | 184 | }, { |
185 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000), | 185 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x800000), |
186 | .irq = IRQ_GPIOB(27), | 186 | /* irq number is run-time assigned */ |
187 | .uartclk = 14745600, | 187 | .uartclk = 14745600, |
188 | .regshift = 1, | 188 | .regshift = 1, |
189 | .iotype = UPIO_MEM, | 189 | .iotype = UPIO_MEM, |
190 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, | 190 | .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP, |
191 | }, { | 191 | }, { |
192 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000), | 192 | .mapbase = (unsigned long)(MX27_CS3_BASE_ADDR + 0x1000000), |
193 | .irq = IRQ_GPIOB(30), | 193 | /* irq number is run-time assigned */ |
194 | .uartclk = 14745600, | 194 | .uartclk = 14745600, |
195 | .regshift = 1, | 195 | .regshift = 1, |
196 | .iotype = UPIO_MEM, | 196 | .iotype = UPIO_MEM, |
@@ -279,6 +279,10 @@ static void __init eukrea_cpuimx27_init(void) | |||
279 | #endif | 279 | #endif |
280 | 280 | ||
281 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) | 281 | #if defined(CONFIG_SERIAL_8250) || defined(CONFIG_SERIAL_8250_MODULE) |
282 | serial_platform_data[0].irq = IMX_GPIO_NR(2, 23); | ||
283 | serial_platform_data[1].irq = IMX_GPIO_NR(2, 22); | ||
284 | serial_platform_data[2].irq = IMX_GPIO_NR(2, 27); | ||
285 | serial_platform_data[3].irq = IMX_GPIO_NR(2, 30); | ||
282 | platform_device_register(&serial_device); | 286 | platform_device_register(&serial_device); |
283 | #endif | 287 | #endif |
284 | 288 | ||
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index dff82eb57cd9..54c34a6f92c7 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -40,6 +40,7 @@ | |||
40 | #include <asm/mach/time.h> | 40 | #include <asm/mach/time.h> |
41 | #include <asm/system.h> | 41 | #include <asm/system.h> |
42 | #include <mach/common.h> | 42 | #include <mach/common.h> |
43 | #include <mach/hardware.h> | ||
43 | #include <mach/iomux-mx27.h> | 44 | #include <mach/iomux-mx27.h> |
44 | 45 | ||
45 | #include "devices-imx27.h" | 46 | #include "devices-imx27.h" |
@@ -47,7 +48,7 @@ | |||
47 | #define TVP5150_RSTN (GPIO_PORTC + 18) | 48 | #define TVP5150_RSTN (GPIO_PORTC + 18) |
48 | #define TVP5150_PWDN (GPIO_PORTC + 19) | 49 | #define TVP5150_PWDN (GPIO_PORTC + 19) |
49 | #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) | 50 | #define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) |
50 | #define SDHC1_IRQ IRQ_GPIOB(25) | 51 | #define SDHC1_IRQ_GPIO IMX_GPIO_NR(2, 25) |
51 | 52 | ||
52 | #define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) | 53 | #define MOTHERBOARD_BIT2 (GPIO_PORTD + 31) |
53 | #define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) | 54 | #define MOTHERBOARD_BIT1 (GPIO_PORTD + 30) |
@@ -294,14 +295,14 @@ static int visstrim_m10_sdhc1_init(struct device *dev, | |||
294 | { | 295 | { |
295 | int ret; | 296 | int ret; |
296 | 297 | ||
297 | ret = request_irq(SDHC1_IRQ, detect_irq, IRQF_TRIGGER_FALLING, | 298 | ret = request_irq(gpio_to_irq(SDHC1_IRQ_GPIO), detect_irq, |
298 | "mmc-detect", data); | 299 | IRQF_TRIGGER_FALLING, "mmc-detect", data); |
299 | return ret; | 300 | return ret; |
300 | } | 301 | } |
301 | 302 | ||
302 | static void visstrim_m10_sdhc1_exit(struct device *dev, void *data) | 303 | static void visstrim_m10_sdhc1_exit(struct device *dev, void *data) |
303 | { | 304 | { |
304 | free_irq(SDHC1_IRQ, data); | 305 | free_irq(gpio_to_irq(SDHC1_IRQ_GPIO), data); |
305 | } | 306 | } |
306 | 307 | ||
307 | static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = { | 308 | static const struct imxmmc_platform_data visstrim_m10_sdhc_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-mx21ads.c b/arch/arm/mach-imx/mach-mx21ads.c index d14bbe949a4f..ab3bdf738f53 100644 --- a/arch/arm/mach-imx/mach-mx21ads.c +++ b/arch/arm/mach-imx/mach-mx21ads.c | |||
@@ -38,7 +38,7 @@ | |||
38 | (MX21ADS_MMIO_BASE_ADDR + (offset)) | 38 | (MX21ADS_MMIO_BASE_ADDR + (offset)) |
39 | 39 | ||
40 | #define MX21ADS_CS8900A_MMIO_SIZE 0x200000 | 40 | #define MX21ADS_CS8900A_MMIO_SIZE 0x200000 |
41 | #define MX21ADS_CS8900A_IRQ IRQ_GPIOE(11) | 41 | #define MX21ADS_CS8900A_IRQ_GPIO IMX_GPIO_NR(5, 11) |
42 | #define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000) | 42 | #define MX21ADS_ST16C255_IOBASE_REG MX21ADS_REG_ADDR(0x200000) |
43 | #define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000) | 43 | #define MX21ADS_VERSION_REG MX21ADS_REG_ADDR(0x400000) |
44 | #define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000) | 44 | #define MX21ADS_IO_REG MX21ADS_REG_ADDR(0x800000) |
@@ -159,9 +159,10 @@ static struct platform_device mx21ads_nor_mtd_device = { | |||
159 | .resource = &mx21ads_flash_resource, | 159 | .resource = &mx21ads_flash_resource, |
160 | }; | 160 | }; |
161 | 161 | ||
162 | static const struct resource mx21ads_cs8900_resources[] __initconst = { | 162 | static struct resource mx21ads_cs8900_resources[] __initdata = { |
163 | DEFINE_RES_MEM(MX21_CS1_BASE_ADDR, MX21ADS_CS8900A_MMIO_SIZE), | 163 | DEFINE_RES_MEM(MX21_CS1_BASE_ADDR, MX21ADS_CS8900A_MMIO_SIZE), |
164 | DEFINE_RES_IRQ(MX21ADS_CS8900A_IRQ), | 164 | /* irq number is run-time assigned */ |
165 | DEFINE_RES_IRQ(-1), | ||
165 | }; | 166 | }; |
166 | 167 | ||
167 | static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = { | 168 | static const struct platform_device_info mx21ads_cs8900_devinfo __initconst = { |
@@ -241,13 +242,13 @@ static int mx21ads_sdhc_get_ro(struct device *dev) | |||
241 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, | 242 | static int mx21ads_sdhc_init(struct device *dev, irq_handler_t detect_irq, |
242 | void *data) | 243 | void *data) |
243 | { | 244 | { |
244 | return request_irq(IRQ_GPIOD(25), detect_irq, | 245 | return request_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), detect_irq, |
245 | IRQF_TRIGGER_FALLING, "mmc-detect", data); | 246 | IRQF_TRIGGER_FALLING, "mmc-detect", data); |
246 | } | 247 | } |
247 | 248 | ||
248 | static void mx21ads_sdhc_exit(struct device *dev, void *data) | 249 | static void mx21ads_sdhc_exit(struct device *dev, void *data) |
249 | { | 250 | { |
250 | free_irq(IRQ_GPIOD(25), data); | 251 | free_irq(gpio_to_irq(IMX_GPIO_NR(4, 25)), data); |
251 | } | 252 | } |
252 | 253 | ||
253 | static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = { | 254 | static const struct imxmmc_platform_data mx21ads_sdhc_pdata __initconst = { |
@@ -304,6 +305,11 @@ static void __init mx21ads_board_init(void) | |||
304 | imx21_add_mxc_nand(&mx21ads_nand_board_info); | 305 | imx21_add_mxc_nand(&mx21ads_nand_board_info); |
305 | 306 | ||
306 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 307 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
308 | |||
309 | mx21ads_cs8900_resources[1].start = | ||
310 | gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO); | ||
311 | mx21ads_cs8900_resources[1].end = | ||
312 | gpio_to_irq(MX21ADS_CS8900A_IRQ_GPIO); | ||
307 | platform_device_register_full(&mx21ads_cs8900_devinfo); | 313 | platform_device_register_full(&mx21ads_cs8900_devinfo); |
308 | } | 314 | } |
309 | 315 | ||
diff --git a/arch/arm/mach-imx/mach-mx27ads.c b/arch/arm/mach-imx/mach-mx27ads.c index 0228d2e07fe0..78b6bb5fcc6a 100644 --- a/arch/arm/mach-imx/mach-mx27ads.c +++ b/arch/arm/mach-imx/mach-mx27ads.c | |||
@@ -246,25 +246,25 @@ static const struct imx_fb_platform_data mx27ads_fb_data __initconst = { | |||
246 | static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | 246 | static int mx27ads_sdhc1_init(struct device *dev, irq_handler_t detect_irq, |
247 | void *data) | 247 | void *data) |
248 | { | 248 | { |
249 | return request_irq(IRQ_GPIOE(21), detect_irq, IRQF_TRIGGER_RISING, | 249 | return request_irq(gpio_to_irq(IMX_GPIO_NR(5, 21)), detect_irq, |
250 | "sdhc1-card-detect", data); | 250 | IRQF_TRIGGER_RISING, "sdhc1-card-detect", data); |
251 | } | 251 | } |
252 | 252 | ||
253 | static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq, | 253 | static int mx27ads_sdhc2_init(struct device *dev, irq_handler_t detect_irq, |
254 | void *data) | 254 | void *data) |
255 | { | 255 | { |
256 | return request_irq(IRQ_GPIOB(7), detect_irq, IRQF_TRIGGER_RISING, | 256 | return request_irq(gpio_to_irq(IMX_GPIO_NR(2, 7)), detect_irq, |
257 | "sdhc2-card-detect", data); | 257 | IRQF_TRIGGER_RISING, "sdhc2-card-detect", data); |
258 | } | 258 | } |
259 | 259 | ||
260 | static void mx27ads_sdhc1_exit(struct device *dev, void *data) | 260 | static void mx27ads_sdhc1_exit(struct device *dev, void *data) |
261 | { | 261 | { |
262 | free_irq(IRQ_GPIOE(21), data); | 262 | free_irq(gpio_to_irq(IMX_GPIO_NR(5, 21)), data); |
263 | } | 263 | } |
264 | 264 | ||
265 | static void mx27ads_sdhc2_exit(struct device *dev, void *data) | 265 | static void mx27ads_sdhc2_exit(struct device *dev, void *data) |
266 | { | 266 | { |
267 | free_irq(IRQ_GPIOB(7), data); | 267 | free_irq(gpio_to_irq(IMX_GPIO_NR(2, 7)), data); |
268 | } | 268 | } |
269 | 269 | ||
270 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { | 270 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-mxt_td60.c b/arch/arm/mach-imx/mach-mxt_td60.c index 8b3d3f07d894..0bf6d30aa32d 100644 --- a/arch/arm/mach-imx/mach-mxt_td60.c +++ b/arch/arm/mach-imx/mach-mxt_td60.c | |||
@@ -213,13 +213,13 @@ static const struct imx_fb_platform_data mxt_td60_fb_data __initconst = { | |||
213 | static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq, | 213 | static int mxt_td60_sdhc1_init(struct device *dev, irq_handler_t detect_irq, |
214 | void *data) | 214 | void *data) |
215 | { | 215 | { |
216 | return request_irq(IRQ_GPIOF(8), detect_irq, IRQF_TRIGGER_FALLING, | 216 | return request_irq(gpio_to_irq(IMX_GPIO_NR(6, 8)), detect_irq, |
217 | "sdhc1-card-detect", data); | 217 | IRQF_TRIGGER_FALLING, "sdhc1-card-detect", data); |
218 | } | 218 | } |
219 | 219 | ||
220 | static void mxt_td60_sdhc1_exit(struct device *dev, void *data) | 220 | static void mxt_td60_sdhc1_exit(struct device *dev, void *data) |
221 | { | 221 | { |
222 | free_irq(IRQ_GPIOF(8), data); | 222 | free_irq(gpio_to_irq(IMX_GPIO_NR(6, 8)), data); |
223 | } | 223 | } |
224 | 224 | ||
225 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { | 225 | static const struct imxmmc_platform_data sdhc1_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index 541152e450c4..8b1dfa277fd5 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -245,7 +245,7 @@ static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq, | |||
245 | { | 245 | { |
246 | int ret; | 246 | int ret; |
247 | 247 | ||
248 | ret = request_irq(IRQ_GPIOC(29), detect_irq, | 248 | ret = request_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), detect_irq, |
249 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, | 249 | IRQF_DISABLED | IRQF_TRIGGER_FALLING, |
250 | "imx-mmc-detect", data); | 250 | "imx-mmc-detect", data); |
251 | if (ret) | 251 | if (ret) |
@@ -257,7 +257,7 @@ static int pca100_sdhc2_init(struct device *dev, irq_handler_t detect_irq, | |||
257 | 257 | ||
258 | static void pca100_sdhc2_exit(struct device *dev, void *data) | 258 | static void pca100_sdhc2_exit(struct device *dev, void *data) |
259 | { | 259 | { |
260 | free_irq(IRQ_GPIOC(29), data); | 260 | free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data); |
261 | } | 261 | } |
262 | 262 | ||
263 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { | 263 | static const struct imxmmc_platform_data sdhc_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 2f3debe2a113..cfb39037b203 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mfd/mc13783.h> | 27 | #include <linux/mfd/mc13783.h> |
28 | #include <linux/spi/spi.h> | 28 | #include <linux/spi/spi.h> |
29 | #include <linux/irq.h> | 29 | #include <linux/irq.h> |
30 | #include <linux/gpio.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -274,7 +275,7 @@ static struct mc13xxx_platform_data pcm038_pmic = { | |||
274 | static struct spi_board_info pcm038_spi_board_info[] __initdata = { | 275 | static struct spi_board_info pcm038_spi_board_info[] __initdata = { |
275 | { | 276 | { |
276 | .modalias = "mc13783", | 277 | .modalias = "mc13783", |
277 | .irq = IRQ_GPIOB(23), | 278 | /* irq number is run-time assigned */ |
278 | .max_speed_hz = 300000, | 279 | .max_speed_hz = 300000, |
279 | .bus_num = 0, | 280 | .bus_num = 0, |
280 | .chip_select = 0, | 281 | .chip_select = 0, |
@@ -325,6 +326,7 @@ static void __init pcm038_init(void) | |||
325 | mxc_gpio_mode(GPIO_PORTB | 23 | GPIO_GPIO | GPIO_IN); | 326 | mxc_gpio_mode(GPIO_PORTB | 23 | GPIO_GPIO | GPIO_IN); |
326 | 327 | ||
327 | imx27_add_spi_imx0(&pcm038_spi0_data); | 328 | imx27_add_spi_imx0(&pcm038_spi0_data); |
329 | pcm038_spi_board_info[0].irq = gpio_to_irq(IMX_GPIO_NR(2, 23)); | ||
328 | spi_register_board_info(pcm038_spi_board_info, | 330 | spi_register_board_info(pcm038_spi_board_info, |
329 | ARRAY_SIZE(pcm038_spi_board_info)); | 331 | ARRAY_SIZE(pcm038_spi_board_info)); |
330 | 332 | ||
diff --git a/arch/arm/mach-imx/mach-scb9328.c b/arch/arm/mach-imx/mach-scb9328.c index cb9ceae2f648..500116498698 100644 --- a/arch/arm/mach-imx/mach-scb9328.c +++ b/arch/arm/mach-imx/mach-scb9328.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/mtd/physmap.h> | 14 | #include <linux/mtd/physmap.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <linux/dm9000.h> | 16 | #include <linux/dm9000.h> |
17 | #include <linux/gpio.h> | ||
17 | 18 | ||
18 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
19 | #include <asm/mach/arch.h> | 20 | #include <asm/mach/arch.h> |
@@ -78,8 +79,7 @@ static struct resource dm9000x_resources[] = { | |||
78 | .end = MX1_CS5_PHYS + 5, | 79 | .end = MX1_CS5_PHYS + 5, |
79 | .flags = IORESOURCE_MEM, /* data access */ | 80 | .flags = IORESOURCE_MEM, /* data access */ |
80 | }, { | 81 | }, { |
81 | .start = IRQ_GPIOC(3), | 82 | /* irq number is run-time assigned */ |
82 | .end = IRQ_GPIOC(3), | ||
83 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, | 83 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWLEVEL, |
84 | }, | 84 | }, |
85 | }; | 85 | }; |
@@ -123,6 +123,8 @@ static void __init scb9328_init(void) | |||
123 | imx1_add_imx_uart0(&uart_pdata); | 123 | imx1_add_imx_uart0(&uart_pdata); |
124 | 124 | ||
125 | printk(KERN_INFO"Scb9328: Adding devices\n"); | 125 | printk(KERN_INFO"Scb9328: Adding devices\n"); |
126 | dm9000x_resources[2].start = gpio_to_irq(IMX_GPIO_NR(3, 3)); | ||
127 | dm9000x_resources[2].end = gpio_to_irq(IMX_GPIO_NR(3, 3)); | ||
126 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 128 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
127 | } | 129 | } |
128 | 130 | ||
diff --git a/arch/arm/mach-imx/pcm970-baseboard.c b/arch/arm/mach-imx/pcm970-baseboard.c index 99afbc3f43a3..9917e2ff51da 100644 --- a/arch/arm/mach-imx/pcm970-baseboard.c +++ b/arch/arm/mach-imx/pcm970-baseboard.c | |||
@@ -95,14 +95,14 @@ static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void | |||
95 | { | 95 | { |
96 | int ret; | 96 | int ret; |
97 | 97 | ||
98 | ret = request_irq(IRQ_GPIOC(29), detect_irq, IRQF_TRIGGER_FALLING, | 98 | ret = request_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), detect_irq, |
99 | "imx-mmc-detect", data); | 99 | IRQF_TRIGGER_FALLING, "imx-mmc-detect", data); |
100 | if (ret) | 100 | if (ret) |
101 | return ret; | 101 | return ret; |
102 | 102 | ||
103 | ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); | 103 | ret = gpio_request(GPIO_PORTC + 28, "imx-mmc-ro"); |
104 | if (ret) { | 104 | if (ret) { |
105 | free_irq(IRQ_GPIOC(29), data); | 105 | free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data); |
106 | return ret; | 106 | return ret; |
107 | } | 107 | } |
108 | 108 | ||
@@ -113,7 +113,7 @@ static int pcm970_sdhc2_init(struct device *dev, irq_handler_t detect_irq, void | |||
113 | 113 | ||
114 | static void pcm970_sdhc2_exit(struct device *dev, void *data) | 114 | static void pcm970_sdhc2_exit(struct device *dev, void *data) |
115 | { | 115 | { |
116 | free_irq(IRQ_GPIOC(29), data); | 116 | free_irq(gpio_to_irq(IMX_GPIO_NR(3, 29)), data); |
117 | gpio_free(GPIO_PORTC + 28); | 117 | gpio_free(GPIO_PORTC + 28); |
118 | } | 118 | } |
119 | 119 | ||
@@ -192,8 +192,7 @@ static struct resource pcm970_sja1000_resources[] = { | |||
192 | .end = MX27_CS4_BASE_ADDR + 0x100 - 1, | 192 | .end = MX27_CS4_BASE_ADDR + 0x100 - 1, |
193 | .flags = IORESOURCE_MEM, | 193 | .flags = IORESOURCE_MEM, |
194 | }, { | 194 | }, { |
195 | .start = IRQ_GPIOE(19), | 195 | /* irq number is run-time assigned */ |
196 | .end = IRQ_GPIOE(19), | ||
197 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, | 196 | .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_LOWEDGE, |
198 | }, | 197 | }, |
199 | }; | 198 | }; |
@@ -227,5 +226,7 @@ void __init pcm970_baseboard_init(void) | |||
227 | imx27_add_imx_fb(&pcm038_fb_data); | 226 | imx27_add_imx_fb(&pcm038_fb_data); |
228 | mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); | 227 | mxc_gpio_mode(GPIO_PORTC | 28 | GPIO_GPIO | GPIO_IN); |
229 | imx27_add_mxc_mmc(1, &sdhc_pdata); | 228 | imx27_add_mxc_mmc(1, &sdhc_pdata); |
229 | pcm970_sja1000_resources[1].start = gpio_to_irq(IMX_GPIO_NR(5, 19)); | ||
230 | pcm970_sja1000_resources[1].end = gpio_to_irq(IMX_GPIO_NR(5, 19)); | ||
230 | platform_device_register(&pcm970_sja1000); | 231 | platform_device_register(&pcm970_sja1000); |
231 | } | 232 | } |
diff --git a/arch/arm/plat-mxc/include/mach/iomux-v1.h b/arch/arm/plat-mxc/include/mach/iomux-v1.h index f7d18046c04f..02651a40fe23 100644 --- a/arch/arm/plat-mxc/include/mach/iomux-v1.h +++ b/arch/arm/plat-mxc/include/mach/iomux-v1.h | |||
@@ -85,13 +85,6 @@ | |||
85 | #define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT) | 85 | #define GPIO_BOUT_0 (2 << GPIO_BOUT_SHIFT) |
86 | #define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT) | 86 | #define GPIO_BOUT_1 (3 << GPIO_BOUT_SHIFT) |
87 | 87 | ||
88 | #define IRQ_GPIOA(x) (MXC_GPIO_IRQ_START + x) | ||
89 | #define IRQ_GPIOB(x) (IRQ_GPIOA(32) + x) | ||
90 | #define IRQ_GPIOC(x) (IRQ_GPIOB(32) + x) | ||
91 | #define IRQ_GPIOD(x) (IRQ_GPIOC(32) + x) | ||
92 | #define IRQ_GPIOE(x) (IRQ_GPIOD(32) + x) | ||
93 | #define IRQ_GPIOF(x) (IRQ_GPIOE(32) + x) | ||
94 | |||
95 | extern int mxc_gpio_mode(int gpio_mode); | 88 | extern int mxc_gpio_mode(int gpio_mode); |
96 | extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, | 89 | extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count, |
97 | const char *label); | 90 | const char *label); |