diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-09-15 15:57:00 +0800 |
---|---|---|
committer | Shawn Guo <shawn.guo@linaro.org> | 2012-10-15 10:03:17 +0800 |
commit | 73930eb31b2ecb0177c9bf81a35b4d2d73716951 (patch) | |
tree | 0a341a992eb4f6b986a6fc665b4b48e049a3cbe3 /arch | |
parent | 04bbd8ef533fed260ea8cc249b534c1cbbc7f9d0 (diff) | |
download | op-kernel-dev-73930eb31b2ecb0177c9bf81a35b4d2d73716951.zip op-kernel-dev-73930eb31b2ecb0177c9bf81a35b4d2d73716951.tar.gz |
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')
-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 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx1.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx21.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-imx/mm-imx27.c | 2 |
5 files changed, 25 insertions, 5 deletions
diff --git a/arch/arm/mach-imx/devices/devices-common.h b/arch/arm/mach-imx/devices/devices-common.h index 1472f0f..e4368f6 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 c35c99d..f9003e4 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, diff --git a/arch/arm/mach-imx/mm-imx1.c b/arch/arm/mach-imx/mm-imx1.c index 118aa92..9de81bf 100644 --- a/arch/arm/mach-imx/mm-imx1.c +++ b/arch/arm/mach-imx/mm-imx1.c @@ -25,6 +25,7 @@ #include <mach/hardware.h> #include "common.h" +#include "devices/devices-common.h" #include "iomux-v1.h" static struct map_desc imx_io_desc[] __initdata = { @@ -59,5 +60,6 @@ void __init imx1_soc_init(void) MX1_GPIO_INT_PORTC, 0); mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256, MX1_GPIO_INT_PORTD, 0); + imx_add_imx_dma(MX1_DMA_BASE_ADDR, MX1_DMA_INT, MX1_DMA_ERR); pinctrl_provide_dummies(); } diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c index 0c24556..1c29515 100644 --- a/arch/arm/mach-imx/mm-imx21.c +++ b/arch/arm/mach-imx/mm-imx21.c @@ -90,7 +90,7 @@ void __init imx21_soc_init(void) mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); pinctrl_provide_dummies(); - imx_add_imx_dma(); + imx_add_imx_dma(MX21_DMA_BASE_ADDR, MX21_INT_DMACH0, 0); /* No ERR irq */ platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res, ARRAY_SIZE(imx21_audmux_res)); } diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c index 3241314..d389f4a 100644 --- a/arch/arm/mach-imx/mm-imx27.c +++ b/arch/arm/mach-imx/mm-imx27.c @@ -91,7 +91,7 @@ void __init imx27_soc_init(void) mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); pinctrl_provide_dummies(); - imx_add_imx_dma(); + imx_add_imx_dma(MX27_DMA_BASE_ADDR, MX27_INT_DMACH0, 0); /* No ERR irq */ /* imx27 has the imx21 type audmux */ platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res, ARRAY_SIZE(imx27_audmux_res)); |