diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 22:34:06 +0000 |
---|---|---|
committer | Simone Willett <swillett@nvidia.com> | 2012-04-03 09:35:53 -0700 |
commit | 0ca3ff10db648a38b0aeb219a19980fec6ae5135 (patch) | |
tree | f8b0624510b32a13a1e69969239c36de813dd252 /drivers/dma/imx-sdma.c | |
parent | b7ce7f54652d73d6fc1f787dfb4aeec3f475a17f (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>
cherry-picked from mainline
4d4e58de32a192fea65ab84509d17d199bd291c8
Change-Id: Ib653bcfa5f492986946fd34006a8de3090db0441
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/93778
Diffstat (limited to 'drivers/dma/imx-sdma.c')
-rw-r--r-- | drivers/dma/imx-sdma.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 7bd7e98548cd..c3dd583ff138 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -264,7 +264,6 @@ struct sdma_channel { struct dma_chan chan; spinlock_t lock; struct dma_async_tx_descriptor desc; - dma_cookie_t last_completed; enum dma_status status; }; @@ -509,6 +508,7 @@ static void mxc_sdma_handle_channel_normal(struct sdma_channel *sdmac) else sdmac->status = DMA_SUCCESS; + sdmac->chan.completed_cookie = sdmac->desc.cookie; if (sdmac->desc.callback) sdmac->desc.callback(sdmac->desc.callback_param); sdmac->last_completed = sdmac->desc.cookie; @@ -1105,7 +1105,12 @@ static enum dma_status sdma_tx_status(struct dma_chan *chan, last_used = chan->cookie; +<<<<<<< HEAD dma_set_tx_state(txstate, sdmac->last_completed, last_used, 0); +======= + dma_set_tx_state(txstate, chan->completed_cookie, last_used, + sdmac->chn_count - sdmac->chn_real_count); +>>>>>>> 4d4e58d... dmaengine: move last completed cookie into generic dma_chan structure return sdmac->status; } |