aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
-rw-r--r--drivers/dma/imx-dma.c35
6 files changed, 45 insertions, 20 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));
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c
index 1f2b79009d69..88e8a8d89b56 100644
--- a/drivers/dma/imx-dma.c
+++ b/drivers/dma/imx-dma.c
@@ -959,23 +959,22 @@ static void imxdma_issue_pending(struct dma_chan *chan)
959static int __init imxdma_probe(struct platform_device *pdev) 959static int __init imxdma_probe(struct platform_device *pdev)
960 { 960 {
961 struct imxdma_engine *imxdma; 961 struct imxdma_engine *imxdma;
962 struct resource *res;
962 int ret, i; 963 int ret, i;
963 964 int irq, irq_err;
964 965
965 imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL); 966 imxdma = devm_kzalloc(&pdev->dev, sizeof(*imxdma), GFP_KERNEL);
966 if (!imxdma) 967 if (!imxdma)
967 return -ENOMEM; 968 return -ENOMEM;
968 969
969 if (cpu_is_mx1()) { 970 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
970 imxdma->base = MX1_IO_ADDRESS(MX1_DMA_BASE_ADDR); 971 imxdma->base = devm_request_and_ioremap(&pdev->dev, res);
971 } else if (cpu_is_mx21()) { 972 if (!imxdma->base)
972 imxdma->base = MX21_IO_ADDRESS(MX21_DMA_BASE_ADDR); 973 return -EADDRNOTAVAIL;
973 } else if (cpu_is_mx27()) { 974
974 imxdma->base = MX27_IO_ADDRESS(MX27_DMA_BASE_ADDR); 975 irq = platform_get_irq(pdev, 0);
975 } else { 976 if (irq < 0)
976 kfree(imxdma); 977 return irq;
977 return 0;
978 }
979 978
980 imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg"); 979 imxdma->dma_ipg = devm_clk_get(&pdev->dev, "ipg");
981 if (IS_ERR(imxdma->dma_ipg)) 980 if (IS_ERR(imxdma->dma_ipg))
@@ -992,14 +991,20 @@ static int __init imxdma_probe(struct platform_device *pdev)
992 imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR); 991 imx_dmav1_writel(imxdma, DCR_DRST, DMA_DCR);
993 992
994 if (cpu_is_mx1()) { 993 if (cpu_is_mx1()) {
995 ret = devm_request_irq(&pdev->dev, MX1_DMA_INT, 994 ret = devm_request_irq(&pdev->dev, irq,
996 dma_irq_handler, 0, "DMA", imxdma); 995 dma_irq_handler, 0, "DMA", imxdma);
997 if (ret) { 996 if (ret) {
998 dev_warn(imxdma->dev, "Can't register IRQ for DMA\n"); 997 dev_warn(imxdma->dev, "Can't register IRQ for DMA\n");
999 goto err; 998 goto err;
1000 } 999 }
1001 1000
1002 ret = devm_request_irq(&pdev->dev, MX1_DMA_ERR, 1001 irq_err = platform_get_irq(pdev, 1);
1002 if (irq_err < 0) {
1003 ret = irq_err;
1004 goto err;
1005 }
1006
1007 ret = devm_request_irq(&pdev->dev, irq_err,
1003 imxdma_err_handler, 0, "DMA", imxdma); 1008 imxdma_err_handler, 0, "DMA", imxdma);
1004 if (ret) { 1009 if (ret) {
1005 dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n"); 1010 dev_warn(imxdma->dev, "Can't register ERRIRQ for DMA\n");
@@ -1034,12 +1039,12 @@ static int __init imxdma_probe(struct platform_device *pdev)
1034 struct imxdma_channel *imxdmac = &imxdma->channel[i]; 1039 struct imxdma_channel *imxdmac = &imxdma->channel[i];
1035 1040
1036 if (cpu_is_mx21() || cpu_is_mx27()) { 1041 if (cpu_is_mx21() || cpu_is_mx27()) {
1037 ret = devm_request_irq(&pdev->dev, MX2x_INT_DMACH0 + i, 1042 ret = devm_request_irq(&pdev->dev, irq + i,
1038 dma_irq_handler, 0, "DMA", imxdma); 1043 dma_irq_handler, 0, "DMA", imxdma);
1039 if (ret) { 1044 if (ret) {
1040 dev_warn(imxdma->dev, "Can't register IRQ %d " 1045 dev_warn(imxdma->dev, "Can't register IRQ %d "
1041 "for DMA channel %d\n", 1046 "for DMA channel %d\n",
1042 MX2x_INT_DMACH0 + i, i); 1047 irq + i, i);
1043 goto err; 1048 goto err;
1044 } 1049 }
1045 init_timer(&imxdmac->watchdog); 1050 init_timer(&imxdmac->watchdog);