Commit 8735fde2 authored by Uwe Kleine-König's avatar Uwe Kleine-König

arm/imx/dma-v1: protect #ifdef'd blocks additionally by cpu_is_...

This is necessary for a multi-SoC kernel.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
parent e9f49d41
...@@ -476,7 +476,8 @@ void imx_dma_enable(int channel) ...@@ -476,7 +476,8 @@ void imx_dma_enable(int channel)
CCR_ACRPT, DMA_CCR(channel)); CCR_ACRPT, DMA_CCR(channel));
#ifdef CONFIG_ARCH_MX2 #ifdef CONFIG_ARCH_MX2
if (imxdma->sg && imx_dma_hw_chain(imxdma)) { if ((cpu_is_mx21() || cpu_is_mx27()) &&
imxdma->sg && imx_dma_hw_chain(imxdma)) {
imxdma->sg = sg_next(imxdma->sg); imxdma->sg = sg_next(imxdma->sg);
if (imxdma->sg) { if (imxdma->sg) {
u32 tmp; u32 tmp;
...@@ -654,7 +655,8 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id) ...@@ -654,7 +655,8 @@ static irqreturn_t dma_irq_handler(int irq, void *dev_id)
int i, disr; int i, disr;
#ifdef CONFIG_ARCH_MX2 #ifdef CONFIG_ARCH_MX2
dma_err_handler(irq, dev_id); if (cpu_is_mx21() || cpu_is_mx27())
dma_err_handler(irq, dev_id);
#endif #endif
disr = imx_dmav1_readl(DMA_DISR); disr = imx_dmav1_readl(DMA_DISR);
...@@ -702,17 +704,19 @@ int imx_dma_request(int channel, const char *name) ...@@ -702,17 +704,19 @@ int imx_dma_request(int channel, const char *name)
local_irq_restore(flags); /* request_irq() can block */ local_irq_restore(flags); /* request_irq() can block */
#ifdef CONFIG_ARCH_MX2 #ifdef CONFIG_ARCH_MX2
ret = request_irq(MX2x_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", if (cpu_is_mx21() || cpu_is_mx27()) {
NULL); ret = request_irq(MX2x_INT_DMACH0 + channel,
if (ret) { dma_irq_handler, 0, "DMA", NULL);
imxdma->name = NULL; if (ret) {
printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", imxdma->name = NULL;
MX2x_INT_DMACH0 + channel, channel); pr_crit("Can't register IRQ %d for DMA channel %d\n",
return ret; MX2x_INT_DMACH0 + channel, channel);
return ret;
}
init_timer(&imxdma->watchdog);
imxdma->watchdog.function = &imx_dma_watchdog;
imxdma->watchdog.data = channel;
} }
init_timer(&imxdma->watchdog);
imxdma->watchdog.function = &imx_dma_watchdog;
imxdma->watchdog.data = channel;
#endif #endif
return ret; return ret;
...@@ -741,7 +745,8 @@ void imx_dma_free(int channel) ...@@ -741,7 +745,8 @@ void imx_dma_free(int channel)
imxdma->name = NULL; imxdma->name = NULL;
#ifdef CONFIG_ARCH_MX2 #ifdef CONFIG_ARCH_MX2
free_irq(MX2x_INT_DMACH0 + channel, NULL); if (cpu_is_mx21() || cpu_is_mx27())
free_irq(MX2x_INT_DMACH0 + channel, NULL);
#endif #endif
local_irq_restore(flags); local_irq_restore(flags);
...@@ -823,17 +828,19 @@ static int __init imx_dma_init(void) ...@@ -823,17 +828,19 @@ static int __init imx_dma_init(void)
imx_dmav1_writel(DCR_DRST, DMA_DCR); imx_dmav1_writel(DCR_DRST, DMA_DCR);
#ifdef CONFIG_ARCH_MX1 #ifdef CONFIG_ARCH_MX1
ret = request_irq(DMA_INT, dma_irq_handler, 0, "DMA", NULL); if (cpu_is_mx1()) {
if (ret) { ret = request_irq(MX1_DMA_INT, dma_irq_handler, 0, "DMA", NULL);
printk(KERN_CRIT "Wow! Can't register IRQ for DMA\n"); if (ret) {
return ret; pr_crit("Wow! Can't register IRQ for DMA\n");
} return ret;
}
ret = request_irq(DMA_ERR, dma_err_handler, 0, "DMA", NULL); ret = request_irq(MX1_DMA_ERR, dma_err_handler, 0, "DMA", NULL);
if (ret) { if (ret) {
printk(KERN_CRIT "Wow! Can't register ERRIRQ for DMA\n"); pr_crit("Wow! Can't register ERRIRQ for DMA\n");
free_irq(DMA_INT, NULL); free_irq(MX1_DMA_INT, NULL);
return ret; return ret;
}
} }
#endif #endif
/* enable DMA module */ /* enable DMA module */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment