diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-09-08 20:53:05 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-09-08 20:53:05 -0400 |
commit | 657a77fa7284d8ae28dfa48f1dc5d919bf5b2843 (patch) | |
tree | 74fd6b5c2c35dcea18928a600ff34c04f8626cb6 /drivers/dma/at_hdmac.c | |
parent | bbea0b6e0d214ef1511b9c6ccf3af26b38f0af7d (diff) |
dmaengine: Move all map_sg/unmap_sg for slave channel to its client
Dan Williams wrote:
... DMA-slave clients request specific channels and know the hardware
details at a low level, so it should not be too high an expectation to
push dma mapping responsibility to the client.
Also this patch includes DMA_COMPL_{SRC,DEST}_UNMAP_SINGLE support for
dw_dmac driver.
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r-- | drivers/dma/at_hdmac.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index da4e8b710a9b..0aeb578a24e3 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
@@ -253,25 +253,28 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) | |||
253 | list_move(&desc->desc_node, &atchan->free_list); | 253 | list_move(&desc->desc_node, &atchan->free_list); |
254 | 254 | ||
255 | /* unmap dma addresses */ | 255 | /* unmap dma addresses */ |
256 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { | 256 | if (!atchan->chan_common.private) { |
257 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) | 257 | struct device *parent = chan2parent(&atchan->chan_common); |
258 | dma_unmap_single(chan2parent(&atchan->chan_common), | 258 | if (!(txd->flags & DMA_COMPL_SKIP_DEST_UNMAP)) { |
259 | desc->lli.daddr, | 259 | if (txd->flags & DMA_COMPL_DEST_UNMAP_SINGLE) |
260 | desc->len, DMA_FROM_DEVICE); | 260 | dma_unmap_single(parent, |
261 | else | 261 | desc->lli.daddr, |
262 | dma_unmap_page(chan2parent(&atchan->chan_common), | 262 | desc->len, DMA_FROM_DEVICE); |
263 | desc->lli.daddr, | 263 | else |
264 | desc->len, DMA_FROM_DEVICE); | 264 | dma_unmap_page(parent, |
265 | } | 265 | desc->lli.daddr, |
266 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { | 266 | desc->len, DMA_FROM_DEVICE); |
267 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) | 267 | } |
268 | dma_unmap_single(chan2parent(&atchan->chan_common), | 268 | if (!(txd->flags & DMA_COMPL_SKIP_SRC_UNMAP)) { |
269 | desc->lli.saddr, | 269 | if (txd->flags & DMA_COMPL_SRC_UNMAP_SINGLE) |
270 | desc->len, DMA_TO_DEVICE); | 270 | dma_unmap_single(parent, |
271 | else | 271 | desc->lli.saddr, |
272 | dma_unmap_page(chan2parent(&atchan->chan_common), | 272 | desc->len, DMA_TO_DEVICE); |
273 | desc->lli.saddr, | 273 | else |
274 | desc->len, DMA_TO_DEVICE); | 274 | dma_unmap_page(parent, |
275 | desc->lli.saddr, | ||
276 | desc->len, DMA_TO_DEVICE); | ||
277 | } | ||
275 | } | 278 | } |
276 | 279 | ||
277 | /* | 280 | /* |
@@ -647,8 +650,6 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
647 | 650 | ||
648 | reg_width = atslave->reg_width; | 651 | reg_width = atslave->reg_width; |
649 | 652 | ||
650 | sg_len = dma_map_sg(chan2parent(chan), sgl, sg_len, direction); | ||
651 | |||
652 | ctrla = ATC_DEFAULT_CTRLA | atslave->ctrla; | 653 | ctrla = ATC_DEFAULT_CTRLA | atslave->ctrla; |
653 | ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN; | 654 | ctrlb = ATC_DEFAULT_CTRLB | ATC_IEN; |
654 | 655 | ||