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 /arch/arm/mach-imx/mach-mx21ads.c | |
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>
Diffstat (limited to 'arch/arm/mach-imx/mach-mx21ads.c')
-rw-r--r-- | arch/arm/mach-imx/mach-mx21ads.c | 16 |
1 files changed, 11 insertions, 5 deletions
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 | ||