diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:34:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:06:06 -0400 |
commit | 4d4e58de32a192fea65ab84509d17d199bd291c8 (patch) | |
tree | be35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/timb_dma.c | |
parent | 08714f60b0fc6ea3a060b69b32e77139f14e6045 (diff) |
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie
in their private dma channel structures. This is pointless, and
forces driver specific code. Move this out into the common dma_chan
structure.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/timb_dma.c')
-rw-r--r-- | drivers/dma/timb_dma.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c index a6f9c1684a0f..a1d15598cf7e 100644 --- a/drivers/dma/timb_dma.c +++ b/drivers/dma/timb_dma.c | |||
@@ -84,7 +84,6 @@ struct timb_dma_chan { | |||
84 | especially the lists and descriptors, | 84 | especially the lists and descriptors, |
85 | from races between the tasklet and calls | 85 | from races between the tasklet and calls |
86 | from above */ | 86 | from above */ |
87 | dma_cookie_t last_completed_cookie; | ||
88 | bool ongoing; | 87 | bool ongoing; |
89 | struct list_head active_list; | 88 | struct list_head active_list; |
90 | struct list_head queue; | 89 | struct list_head queue; |
@@ -284,7 +283,7 @@ static void __td_finish(struct timb_dma_chan *td_chan) | |||
284 | else | 283 | else |
285 | iowrite32(0, td_chan->membase + TIMBDMA_OFFS_TX_DLAR); | 284 | iowrite32(0, td_chan->membase + TIMBDMA_OFFS_TX_DLAR); |
286 | */ | 285 | */ |
287 | td_chan->last_completed_cookie = txd->cookie; | 286 | td_chan->chan.completed_cookie = txd->cookie; |
288 | td_chan->ongoing = false; | 287 | td_chan->ongoing = false; |
289 | 288 | ||
290 | callback = txd->callback; | 289 | callback = txd->callback; |
@@ -481,7 +480,7 @@ static int td_alloc_chan_resources(struct dma_chan *chan) | |||
481 | } | 480 | } |
482 | 481 | ||
483 | spin_lock_bh(&td_chan->lock); | 482 | spin_lock_bh(&td_chan->lock); |
484 | td_chan->last_completed_cookie = 1; | 483 | chan->completed_cookie = 1; |
485 | chan->cookie = 1; | 484 | chan->cookie = 1; |
486 | spin_unlock_bh(&td_chan->lock); | 485 | spin_unlock_bh(&td_chan->lock); |
487 | 486 | ||
@@ -523,7 +522,7 @@ static enum dma_status td_tx_status(struct dma_chan *chan, dma_cookie_t cookie, | |||
523 | 522 | ||
524 | dev_dbg(chan2dev(chan), "%s: Entry\n", __func__); | 523 | dev_dbg(chan2dev(chan), "%s: Entry\n", __func__); |
525 | 524 | ||
526 | last_complete = td_chan->last_completed_cookie; | 525 | last_complete = chan->completed_cookie; |
527 | last_used = chan->cookie; | 526 | last_used = chan->cookie; |
528 | 527 | ||
529 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 528 | ret = dma_async_is_complete(cookie, last_complete, last_used); |