diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-01-25 04:48:01 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2013-01-28 07:04:36 -0500 |
commit | 30d38a3286b140ae8cea84a93cde1f112e352aaf (patch) | |
tree | b8b08a5ffacdfad43531ef38227db39cdbb69fcb /drivers/dma | |
parent | fdf475fa40f1468cf43a72b270f74dc6a4a5c905 (diff) |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/dw_dmac.c | 12 | ||||
-rw-r--r-- | drivers/dma/dw_dmac_regs.h | 1 |
2 files changed, 7 insertions, 6 deletions
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c index 721beafe8f7a..7f9f3324de17 100644 --- a/drivers/dma/dw_dmac.c +++ b/drivers/dma/dw_dmac.c | |||
@@ -333,18 +333,18 @@ dwc_descriptor_complete(struct dw_dma_chan *dwc, struct dw_desc *desc, | |||
333 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { | 333 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { |
334 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) | 334 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) |
335 | dma_unmap_single(parent, desc->lli.dar, | 335 | dma_unmap_single(parent, desc->lli.dar, |
336 | desc->len, DMA_FROM_DEVICE); | 336 | desc->total_len, DMA_FROM_DEVICE); |
337 | else | 337 | else |
338 | dma_unmap_page(parent, desc->lli.dar, | 338 | dma_unmap_page(parent, desc->lli.dar, |
339 | desc->len, DMA_FROM_DEVICE); | 339 | desc->total_len, DMA_FROM_DEVICE); |
340 | } | 340 | } |
341 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { | 341 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { |
342 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) | 342 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) |
343 | dma_unmap_single(parent, desc->lli.sar, | 343 | dma_unmap_single(parent, desc->lli.sar, |
344 | desc->len, DMA_TO_DEVICE); | 344 | desc->total_len, DMA_TO_DEVICE); |
345 | else | 345 | else |
346 | dma_unmap_page(parent, desc->lli.sar, | 346 | dma_unmap_page(parent, desc->lli.sar, |
347 | desc->len, DMA_TO_DEVICE); | 347 | desc->total_len, DMA_TO_DEVICE); |
348 | } | 348 | } |
349 | } | 349 | } |
350 | 350 | ||
@@ -774,7 +774,7 @@ dwc_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, | |||
774 | 774 | ||
775 | prev->lli.llp = 0; | 775 | prev->lli.llp = 0; |
776 | first->txd.flags = flags; | 776 | first->txd.flags = flags; |
777 | first->len = len; | 777 | first->total_len = len; |
778 | 778 | ||
779 | return &first->txd; | 779 | return &first->txd; |
780 | 780 | ||
@@ -937,7 +937,7 @@ slave_sg_fromdev_fill_desc: | |||
937 | prev->lli.ctllo |= DWC_CTLL_INT_EN; | 937 | prev->lli.ctllo |= DWC_CTLL_INT_EN; |
938 | 938 | ||
939 | prev->lli.llp = 0; | 939 | prev->lli.llp = 0; |
940 | first->len = total_len; | 940 | first->total_len = total_len; |
941 | 941 | ||
942 | return &first->txd; | 942 | return &first->txd; |
943 | 943 | ||
diff --git a/drivers/dma/dw_dmac_regs.h b/drivers/dma/dw_dmac_regs.h index 13000d2b3352..833b4cf9843d 100644 --- a/drivers/dma/dw_dmac_regs.h +++ b/drivers/dma/dw_dmac_regs.h | |||
@@ -296,6 +296,7 @@ struct dw_desc { | |||
296 | struct list_head tx_list; | 296 | struct list_head tx_list; |
297 | struct dma_async_tx_descriptor txd; | 297 | struct dma_async_tx_descriptor txd; |
298 | size_t len; | 298 | size_t len; |
299 | size_t total_len; | ||
299 | }; | 300 | }; |
300 | 301 | ||
301 | #define to_dw_desc(h) list_entry(h, struct dw_desc, desc_node) | 302 | #define to_dw_desc(h) list_entry(h, struct dw_desc, desc_node) |