diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-09-15 09:57:00 +0200 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-10-15 04:03:17 +0200 |
commit | 73930eb31b2ecb0177c9bf81a35b4d2d73716951 (patch) | |
tree | 0a341a992eb4f6b986a6fc665b4b48e049a3cbe3 /arch/arm/mach-imx/devices | |
parent | dma: imx-dma: use devm_kzalloc and devm_request_irq (diff) | |
download | linux-73930eb31b2ecb0177c9bf81a35b4d2d73716951.tar.xz linux-73930eb31b2ecb0177c9bf81a35b4d2d73716951.zip |
dma: imx-dma: retrieve MEM and IRQ from resources
Retrieve MEM and IRQ from resources rather than directly using the
value by including machine header.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'arch/arm/mach-imx/devices')
-rw-r--r-- | arch/arm/mach-imx/devices/devices-common.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices/platform-imx-dma.c | 21 |
2 files changed, 21 insertions, 3 deletions
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index 1472f0fc325c..e4368f6c5fb4 100644 --- a/arch/arm/mach-imx/devices/devices-common.h +++ b/arch/arm/mach-imx/devices/devices-common.h @@ -329,7 +329,8 @@ struct platform_device *__init imx_add_spi_imx( const struct imx_spi_imx_data *data, const struct spi_imx_master *pdata); -struct platform_device *imx_add_imx_dma(void); +struct platform_device *imx_add_imx_dma(resource_size_t iobase, + int irq, int irq_err); struct platform_device *imx_add_imx_sdma(char *name, resource_size_t iobase, int irq, struct sdma_platform_data *pdata); diff --git a/arch/arm/mach-imx/devices/platform-imx-dma.c b/arch/arm/mach-imx/devices/platform-imx-dma.c index c35c99d21820..f9003e4d0f57 100644 --- a/arch/arm/mach-imx/devices/platform-imx-dma.c +++ b/arch/arm/mach-imx/devices/platform-imx-dma.c @@ -8,10 +8,27 @@ */ #include "devices-common.h" -struct platform_device __init __maybe_unused *imx_add_imx_dma(void) +struct platform_device __init __maybe_unused *imx_add_imx_dma( + resource_size_t iobase, int irq, int irq_err) { + struct resource res[] = { + { + .start = iobase, + .end = iobase + SZ_4K - 1, + .flags = IORESOURCE_MEM, + }, { + .start = irq, + .end = irq, + .flags = IORESOURCE_IRQ, + }, { + .start = irq_err, + .end = irq_err, + .flags = IORESOURCE_IRQ, + }, + }; + return platform_device_register_resndata(&mxc_ahb_bus, - "imx-dma", -1, NULL, 0, NULL, 0); + "imx-dma", -1, res, ARRAY_SIZE(res), NULL, 0); } struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name, |