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

dmaengine: at_hdmac: use descriptor chaining help function

A little function helps to chain descriptors:
it is already used in cyclic dma operations, now use it in memcpy and slave_sg
preparation functions.
Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 23b5e3ad
...@@ -626,16 +626,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, ...@@ -626,16 +626,7 @@ atc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
desc->txd.cookie = 0; desc->txd.cookie = 0;
if (!first) { atc_desc_chain(&first, &prev, desc);
first = desc;
} else {
/* inform the HW lli about chaining */
prev->lli.dscr = desc->txd.phys;
/* insert the link descriptor to the LD ring */
list_add_tail(&desc->desc_node,
&first->tx_list);
}
prev = desc;
} }
/* First descriptor of the chain embedds additional information */ /* First descriptor of the chain embedds additional information */
...@@ -726,16 +717,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -726,16 +717,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
| len >> mem_width; | len >> mem_width;
desc->lli.ctrlb = ctrlb; desc->lli.ctrlb = ctrlb;
if (!first) { atc_desc_chain(&first, &prev, desc);
first = desc;
} else {
/* inform the HW lli about chaining */
prev->lli.dscr = desc->txd.phys;
/* insert the link descriptor to the LD ring */
list_add_tail(&desc->desc_node,
&first->tx_list);
}
prev = desc;
total_len += len; total_len += len;
} }
break; break;
...@@ -769,16 +751,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -769,16 +751,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
| len >> reg_width; | len >> reg_width;
desc->lli.ctrlb = ctrlb; desc->lli.ctrlb = ctrlb;
if (!first) { atc_desc_chain(&first, &prev, desc);
first = desc;
} else {
/* inform the HW lli about chaining */
prev->lli.dscr = desc->txd.phys;
/* insert the link descriptor to the LD ring */
list_add_tail(&desc->desc_node,
&first->tx_list);
}
prev = desc;
total_len += len; total_len += len;
} }
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册