Commit 30d38a32 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Vinod Koul

dw_dmac: introduce total_len field in struct dw_desc

By this new field we distinguish a total length of the chain and the individual
length of each descriptor in the chain.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent fdf475fa
...@@ -333,18 +333,18 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc, ...@@ -333,18 +333,18 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc,
if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) {
if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE)
dma_unmap_single(parent, desc->lli.dar, dma_unmap_single(parent, desc->lli.dar,
desc->len, DMA_FROM_DEVICE); desc->total_len, DMA_FROM_DEVICE);
else else
dma_unmap_page(parent, desc->lli.dar, dma_unmap_page(parent, desc->lli.dar,
desc->len, DMA_FROM_DEVICE); desc->total_len, DMA_FROM_DEVICE);
} }
if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) {
if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE)
dma_unmap_single(parent, desc->lli.sar, dma_unmap_single(parent, desc->lli.sar,
desc->len, DMA_TO_DEVICE); desc->total_len, DMA_TO_DEVICE);
else else
dma_unmap_page(parent, desc->lli.sar, dma_unmap_page(parent, desc->lli.sar,
desc->len, DMA_TO_DEVICE); desc->total_len, DMA_TO_DEVICE);
} }
} }
...@@ -774,7 +774,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, ...@@ -774,7 +774,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
prev->lli.llp = 0; prev->lli.llp = 0;
first->txd.flags = flags; first->txd.flags = flags;
first->len = len; first->total_len = len;
return &first->txd; return &first->txd;
...@@ -937,7 +937,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, ...@@ -937,7 +937,7 @@ dwc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
prev->lli.ctllo |= DWC_CTLL_INT_EN; prev->lli.ctllo |= DWC_CTLL_INT_EN;
prev->lli.llp = 0; prev->lli.llp = 0;
first->len = total_len; first->total_len = total_len;
return &first->txd; return &first->txd;
......
...@@ -296,6 +296,7 @@ struct dw_desc { ...@@ -296,6 +296,7 @@ struct dw_desc {
struct list_head tx_list; struct list_head tx_list;
struct dma_async_tx_descriptor txd; struct dma_async_tx_descriptor txd;
size_t len; size_t len;
size_t total_len;
}; };
#define to_dw_desc(h) list_entry(h, struct dw_desc, desc_node) #define to_dw_desc(h) list_entry(h, struct dw_desc, desc_node)
......
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