aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-09-15 03:57:00 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-10-14 22:03:17 -0400
commit73930eb31b2ecb0177c9bf81a35b4d2d73716951 (patch)
tree0a341a992eb4f6b986a6fc665b4b48e049a3cbe3 /arch/arm
parent04bbd8ef533fed260ea8cc249b534c1cbbc7f9d0 (diff)
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')
-rw-r--r--arch/arm/mach-imx/devices/devices-common.h3
-rw-r--r--arch/arm/mach-imx/devices/platform-imx-dma.c21
-rw-r--r--arch/arm/mach-imx/mm-imx1.c2
-rw-r--r--arch/arm/mach-imx/mm-imx21.c2
-rw-r--r--arch/arm/mach-imx/mm-imx27.c2
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 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(
329 const struct imx_spi_imx_data *data, 329 const struct imx_spi_imx_data *data,
330 const struct spi_imx_master *pdata); 330 const struct spi_imx_master *pdata);
331 331
332struct platform_device *imx_add_imx_dma(void); 332struct platform_device *imx_add_imx_dma(resource_size_t iobase,
333 int irq, int irq_err);
333struct platform_device *imx_add_imx_sdma(char *name, 334struct platform_device *imx_add_imx_sdma(char *name,
334 resource_size_t iobase, int irq, struct sdma_platform_data *pdata); 335 resource_size_t iobase, int irq, struct sdma_platform_data *pdata);
335 336
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 @@
8 */ 8 */
9#include "devices-common.h" 9#include "devices-common.h"
10 10
11struct platform_device __init __maybe_unused *imx_add_imx_dma(void) 11struct platform_device __init __maybe_unused *imx_add_imx_dma(
12 resource_size_t iobase, int irq, int irq_err)
12{ 13{
14 struct resource res[] = {
15 {
16 .start = iobase,
17 .end = iobase + SZ_4K - 1,
18 .flags = IORESOURCE_MEM,
19 }, {
20 .start = irq,
21 .end = irq,
22 .flags = IORESOURCE_IRQ,
23 }, {
24 .start = irq_err,
25 .end = irq_err,
26 .flags = IORESOURCE_IRQ,
27 },
28 };
29
13 return platform_device_register_resndata(&mxc_ahb_bus, 30 return platform_device_register_resndata(&mxc_ahb_bus,
14 "imx-dma", -1, NULL, 0, NULL, 0); 31 "imx-dma", -1, res, ARRAY_SIZE(res), NULL, 0);
15} 32}
16 33
17struct platform_device __init __maybe_unused *imx_add_imx_sdma(char *name, 34struct 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 118aa928cd8b..9de81bf6de96 100644
--- a/arch/arm/mach-imx/mm-imx1.c
+++ b/arch/arm/mach-imx/mm-imx1.c
@@ -25,6 +25,7 @@
25#include <mach/hardware.h> 25#include <mach/hardware.h>
26 26
27#include "common.h" 27#include "common.h"
28#include "devices/devices-common.h"
28#include "iomux-v1.h" 29#include "iomux-v1.h"
29 30
30static struct map_desc imx_io_desc[] __initdata = { 31static struct map_desc imx_io_desc[] __initdata = {
@@ -59,5 +60,6 @@ void __init imx1_soc_init(void)
59 MX1_GPIO_INT_PORTC, 0); 60 MX1_GPIO_INT_PORTC, 0);
60 mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256, 61 mxc_register_gpio("imx1-gpio", 3, MX1_GPIO4_BASE_ADDR, SZ_256,
61 MX1_GPIO_INT_PORTD, 0); 62 MX1_GPIO_INT_PORTD, 0);
63 imx_add_imx_dma(MX1_DMA_BASE_ADDR, MX1_DMA_INT, MX1_DMA_ERR);
62 pinctrl_provide_dummies(); 64 pinctrl_provide_dummies();
63} 65}
diff --git a/arch/arm/mach-imx/mm-imx21.c b/arch/arm/mach-imx/mm-imx21.c
index 0c24556f299b..1c295154c296 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)
90 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0); 90 mxc_register_gpio("imx21-gpio", 5, MX21_GPIO6_BASE_ADDR, SZ_256, MX21_INT_GPIO, 0);
91 91
92 pinctrl_provide_dummies(); 92 pinctrl_provide_dummies();
93 imx_add_imx_dma(); 93 imx_add_imx_dma(MX21_DMA_BASE_ADDR, MX21_INT_DMACH0, 0); /* No ERR irq */
94 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res, 94 platform_device_register_simple("imx21-audmux", 0, imx21_audmux_res,
95 ARRAY_SIZE(imx21_audmux_res)); 95 ARRAY_SIZE(imx21_audmux_res));
96} 96}
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 3241314b4f2f..d389f4af33c0 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)
91 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0); 91 mxc_register_gpio("imx21-gpio", 5, MX27_GPIO6_BASE_ADDR, SZ_256, MX27_INT_GPIO, 0);
92 92
93 pinctrl_provide_dummies(); 93 pinctrl_provide_dummies();
94 imx_add_imx_dma(); 94 imx_add_imx_dma(MX27_DMA_BASE_ADDR, MX27_INT_DMACH0, 0); /* No ERR irq */
95 /* imx27 has the imx21 type audmux */ 95 /* imx27 has the imx21 type audmux */
96 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res, 96 platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
97 ARRAY_SIZE(imx27_audmux_res)); 97 ARRAY_SIZE(imx27_audmux_res));