aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@atmel.com>2011-04-30 10:57:45 -0400
committerVinod Koul <vinod.koul@intel.com>2011-05-02 06:12:09 -0400
commit9b3aa589eaa1366200062ce1f9cc7ddca8d1d578 (patch)
tree31237c0bfbea0a79548fd4a3e18e2260f97de6fb /drivers/dma
parent364de77831213be20f7f33c39ca1c194593b5c11 (diff)
dmaengine: at_hdmac: modify way to use interrupts
Now we use Buffer Transfer Completed interrupts. If we want a chained buffer completed information, we setup the ATC_IEN bit in CTRLB register in the lli. This is done by set_desc_eol() function and used by memcpy/slave_sg functions. Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/at_hdmac.c4
-rw-r--r--drivers/dma/at_hdmac_regs.h11
2 files changed, 10 insertions, 5 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 3d7d705f026f..13050e646f8e 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -464,7 +464,7 @@ static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
464 464
465 for (i = 0; i < atdma->dma_common.chancnt; i++) { 465 for (i = 0; i < atdma->dma_common.chancnt; i++) {
466 atchan = &atdma->chan[i]; 466 atchan = &atdma->chan[i];
467 if (pending & (AT_DMA_CBTC(i) | AT_DMA_ERR(i))) { 467 if (pending & (AT_DMA_BTC(i) | AT_DMA_ERR(i))) {
468 if (pending & AT_DMA_ERR(i)) { 468 if (pending & AT_DMA_ERR(i)) {
469 /* Disable channel on AHB error */ 469 /* Disable channel on AHB error */
470 dma_writel(atdma, CHDR, atchan->mask); 470 dma_writel(atdma, CHDR, atchan->mask);
@@ -549,7 +549,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
549 } 549 }
550 550
551 ctrla = ATC_DEFAULT_CTRLA; 551 ctrla = ATC_DEFAULT_CTRLA;
552 ctrlb = ATC_DEFAULT_CTRLB 552 ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN
553 | ATC_SRC_ADDR_MODE_INCR 553 | ATC_SRC_ADDR_MODE_INCR
554 | ATC_DST_ADDR_MODE_INCR 554 | ATC_DST_ADDR_MODE_INCR
555 | ATC_FC_MEM2MEM; 555 | ATC_FC_MEM2MEM;
diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index 495457e3dc4b..8303306ea825 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -309,8 +309,8 @@ static void atc_setup_irq(struct at_dma_chan *atchan, int on)
309 struct at_dma *atdma = to_at_dma(atchan->chan_common.device); 309 struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
310 u32 ebci; 310 u32 ebci;
311 311
312 /* enable interrupts on buffer chain completion & error */ 312 /* enable interrupts on buffer transfer completion & error */
313 ebci = AT_DMA_CBTC(atchan->chan_common.chan_id) 313 ebci = AT_DMA_BTC(atchan->chan_common.chan_id)
314 | AT_DMA_ERR(atchan->chan_common.chan_id); 314 | AT_DMA_ERR(atchan->chan_common.chan_id);
315 if (on) 315 if (on)
316 dma_writel(atdma, EBCIER, ebci); 316 dma_writel(atdma, EBCIER, ebci);
@@ -347,7 +347,12 @@ static inline int atc_chan_is_enabled(struct at_dma_chan *atchan)
347 */ 347 */
348static void set_desc_eol(struct at_desc *desc) 348static void set_desc_eol(struct at_desc *desc)
349{ 349{
350 desc->lli.ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS; 350 u32 ctrlb = desc->lli.ctrlb;
351
352 ctrlb &= ~ATC_IEN;
353 ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
354
355 desc->lli.ctrlb = ctrlb;
351 desc->lli.dscr = 0; 356 desc->lli.dscr = 0;
352} 357}
353 358