diff options
Diffstat (limited to 'arch/arm/plat-mxc/dma-mx1-mx2.c')
-rw-r--r-- | arch/arm/plat-mxc/dma-mx1-mx2.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/arm/plat-mxc/dma-mx1-mx2.c b/arch/arm/plat-mxc/dma-mx1-mx2.c index b296f19fd89a..2905ec758758 100644 --- a/arch/arm/plat-mxc/dma-mx1-mx2.c +++ b/arch/arm/plat-mxc/dma-mx1-mx2.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <asm/system.h> | 34 | #include <asm/system.h> |
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | #include <mach/hardware.h> | 36 | #include <mach/hardware.h> |
37 | #include <asm/dma.h> | ||
38 | #include <mach/dma-mx1-mx2.h> | 37 | #include <mach/dma-mx1-mx2.h> |
39 | 38 | ||
40 | #define DMA_DCR 0x00 /* Control Register */ | 39 | #define DMA_DCR 0x00 /* Control Register */ |
@@ -114,7 +113,7 @@ struct imx_dma_channel { | |||
114 | void (*err_handler) (int, void *, int errcode); | 113 | void (*err_handler) (int, void *, int errcode); |
115 | void (*prog_handler) (int, void *, struct scatterlist *); | 114 | void (*prog_handler) (int, void *, struct scatterlist *); |
116 | void *data; | 115 | void *data; |
117 | dmamode_t dma_mode; | 116 | unsigned int dma_mode; |
118 | struct scatterlist *sg; | 117 | struct scatterlist *sg; |
119 | unsigned int resbytes; | 118 | unsigned int resbytes; |
120 | int dma_num; | 119 | int dma_num; |
@@ -193,7 +192,7 @@ static inline int imx_dma_sg_next(int channel, struct scatterlist *sg) | |||
193 | int | 192 | int |
194 | imx_dma_setup_single(int channel, dma_addr_t dma_address, | 193 | imx_dma_setup_single(int channel, dma_addr_t dma_address, |
195 | unsigned int dma_length, unsigned int dev_addr, | 194 | unsigned int dma_length, unsigned int dev_addr, |
196 | dmamode_t dmamode) | 195 | unsigned int dmamode) |
197 | { | 196 | { |
198 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; | 197 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; |
199 | 198 | ||
@@ -288,7 +287,7 @@ int | |||
288 | imx_dma_setup_sg(int channel, | 287 | imx_dma_setup_sg(int channel, |
289 | struct scatterlist *sg, unsigned int sgcount, | 288 | struct scatterlist *sg, unsigned int sgcount, |
290 | unsigned int dma_length, unsigned int dev_addr, | 289 | unsigned int dma_length, unsigned int dev_addr, |
291 | dmamode_t dmamode) | 290 | unsigned int dmamode) |
292 | { | 291 | { |
293 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; | 292 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; |
294 | 293 | ||
@@ -512,6 +511,7 @@ void imx_dma_disable(int channel) | |||
512 | } | 511 | } |
513 | EXPORT_SYMBOL(imx_dma_disable); | 512 | EXPORT_SYMBOL(imx_dma_disable); |
514 | 513 | ||
514 | #ifdef CONFIG_ARCH_MX2 | ||
515 | static void imx_dma_watchdog(unsigned long chno) | 515 | static void imx_dma_watchdog(unsigned long chno) |
516 | { | 516 | { |
517 | struct imx_dma_channel *imxdma = &imx_dma_channels[chno]; | 517 | struct imx_dma_channel *imxdma = &imx_dma_channels[chno]; |
@@ -523,6 +523,7 @@ static void imx_dma_watchdog(unsigned long chno) | |||
523 | if (imxdma->err_handler) | 523 | if (imxdma->err_handler) |
524 | imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT); | 524 | imxdma->err_handler(chno, imxdma->data, IMX_DMA_ERR_TIMEOUT); |
525 | } | 525 | } |
526 | #endif | ||
526 | 527 | ||
527 | static irqreturn_t dma_err_handler(int irq, void *dev_id) | 528 | static irqreturn_t dma_err_handler(int irq, void *dev_id) |
528 | { | 529 | { |
@@ -675,7 +676,7 @@ int imx_dma_request(int channel, const char *name) | |||
675 | { | 676 | { |
676 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; | 677 | struct imx_dma_channel *imxdma = &imx_dma_channels[channel]; |
677 | unsigned long flags; | 678 | unsigned long flags; |
678 | int ret; | 679 | int ret = 0; |
679 | 680 | ||
680 | /* basic sanity checks */ | 681 | /* basic sanity checks */ |
681 | if (!name) | 682 | if (!name) |
@@ -697,6 +698,7 @@ int imx_dma_request(int channel, const char *name) | |||
697 | ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", | 698 | ret = request_irq(MXC_INT_DMACH0 + channel, dma_irq_handler, 0, "DMA", |
698 | NULL); | 699 | NULL); |
699 | if (ret) { | 700 | if (ret) { |
701 | local_irq_restore(flags); | ||
700 | printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", | 702 | printk(KERN_CRIT "Can't register IRQ %d for DMA channel %d\n", |
701 | MXC_INT_DMACH0 + channel, channel); | 703 | MXC_INT_DMACH0 + channel, channel); |
702 | return ret; | 704 | return ret; |
@@ -713,7 +715,7 @@ int imx_dma_request(int channel, const char *name) | |||
713 | imxdma->sg = NULL; | 715 | imxdma->sg = NULL; |
714 | 716 | ||
715 | local_irq_restore(flags); | 717 | local_irq_restore(flags); |
716 | return 0; | 718 | return ret; |
717 | } | 719 | } |
718 | EXPORT_SYMBOL(imx_dma_request); | 720 | EXPORT_SYMBOL(imx_dma_request); |
719 | 721 | ||