提交 9b3aa589 编写于 作者: N Nicolas Ferre 提交者: Vinod Koul

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: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 364de778
...@@ -464,7 +464,7 @@ static irqreturn_t at_dma_interrupt(int irq, void *dev_id) ...@@ -464,7 +464,7 @@ static irqreturn_t at_dma_interrupt(int irq, void *dev_id)
for (i = 0; i < atdma->dma_common.chancnt; i++) { for (i = 0; i < atdma->dma_common.chancnt; i++) {
atchan = &atdma->chan[i]; atchan = &atdma->chan[i];
if (pending & (AT_DMA_CBTC(i) | AT_DMA_ERR(i))) { if (pending & (AT_DMA_BTC(i) | AT_DMA_ERR(i))) {
if (pending & AT_DMA_ERR(i)) { if (pending & AT_DMA_ERR(i)) {
/* Disable channel on AHB error */ /* Disable channel on AHB error */
dma_writel(atdma, CHDR, atchan->mask); 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,7 +549,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
} }
ctrla = ATC_DEFAULT_CTRLA; ctrla = ATC_DEFAULT_CTRLA;
ctrlb = ATC_DEFAULT_CTRLB ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN
| ATC_SRC_ADDR_MODE_INCR | ATC_SRC_ADDR_MODE_INCR
| ATC_DST_ADDR_MODE_INCR | ATC_DST_ADDR_MODE_INCR
| ATC_FC_MEM2MEM; | ATC_FC_MEM2MEM;
......
...@@ -309,8 +309,8 @@ static void atc_setup_irq(struct at_dma_chan *atchan, int on) ...@@ -309,8 +309,8 @@ static void atc_setup_irq(struct at_dma_chan *atchan, int on)
struct at_dma *atdma = to_at_dma(atchan->chan_common.device); struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
u32 ebci; u32 ebci;
/* enable interrupts on buffer chain completion & error */ /* enable interrupts on buffer transfer completion & error */
ebci = AT_DMA_CBTC(atchan->chan_common.chan_id) ebci = AT_DMA_BTC(atchan->chan_common.chan_id)
| AT_DMA_ERR(atchan->chan_common.chan_id); | AT_DMA_ERR(atchan->chan_common.chan_id);
if (on) if (on)
dma_writel(atdma, EBCIER, ebci); dma_writel(atdma, EBCIER, ebci);
...@@ -347,7 +347,12 @@ static inline int atc_chan_is_enabled(struct at_dma_chan *atchan) ...@@ -347,7 +347,12 @@ static inline int atc_chan_is_enabled(struct at_dma_chan *atchan)
*/ */
static void set_desc_eol(struct at_desc *desc) static void set_desc_eol(struct at_desc *desc)
{ {
desc->lli.ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS; u32 ctrlb = desc->lli.ctrlb;
ctrlb &= ~ATC_IEN;
ctrlb |= ATC_SRC_DSCR_DIS | ATC_DST_DSCR_DIS;
desc->lli.ctrlb = ctrlb;
desc->lli.dscr = 0; desc->lli.dscr = 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册