aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/amba-pl08x.c
diff options
context:
space:
mode:
authorRussell King - ARM Linux <linux@arm.linux.org.uk>2012-03-06 17:34:06 -0500
committerVinod Koul <vinod.koul@linux.intel.com>2012-03-13 02:06:06 -0400
commit4d4e58de32a192fea65ab84509d17d199bd291c8 (patch)
treebe35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/amba-pl08x.c
parent08714f60b0fc6ea3a060b69b32e77139f14e6045 (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/amba-pl08x.c')
-rw-r--r--drivers/dma/amba-pl08x.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c
index 513184b4fdd1..e510447a685a 100644
--- a/drivers/dma/amba-pl08x.c
+++ b/drivers/dma/amba-pl08x.c
@@ -971,7 +971,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
971 u32 bytesleft = 0; 971 u32 bytesleft = 0;
972 972
973 last_used = plchan->chan.cookie; 973 last_used = plchan->chan.cookie;
974 last_complete = plchan->lc; 974 last_complete = plchan->chan.completed_cookie;
975 975
976 ret = dma_async_is_complete(cookie, last_complete, last_used); 976 ret = dma_async_is_complete(cookie, last_complete, last_used);
977 if (ret == DMA_SUCCESS) { 977 if (ret == DMA_SUCCESS) {
@@ -983,7 +983,7 @@ static enum dma_status pl08x_dma_tx_status(struct dma_chan *chan,
983 * This cookie not complete yet 983 * This cookie not complete yet
984 */ 984 */
985 last_used = plchan->chan.cookie; 985 last_used = plchan->chan.cookie;
986 last_complete = plchan->lc; 986 last_complete = plchan->chan.completed_cookie;
987 987
988 /* Get number of bytes left in the active transactions and queue */ 988 /* Get number of bytes left in the active transactions and queue */
989 bytesleft = pl08x_getbytes_chan(plchan); 989 bytesleft = pl08x_getbytes_chan(plchan);
@@ -1543,7 +1543,7 @@ static void pl08x_tasklet(unsigned long data)
1543 1543
1544 if (txd) { 1544 if (txd) {
1545 /* Update last completed */ 1545 /* Update last completed */
1546 plchan->lc = txd->tx.cookie; 1546 plchan->chan.completed_cookie = txd->tx.cookie;
1547 } 1547 }
1548 1548
1549 /* If a new descriptor is queued, set it up plchan->at is NULL here */ 1549 /* If a new descriptor is queued, set it up plchan->at is NULL here */
@@ -1725,7 +1725,7 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x,
1725 1725
1726 chan->chan.device = dmadev; 1726 chan->chan.device = dmadev;
1727 chan->chan.cookie = 0; 1727 chan->chan.cookie = 0;
1728 chan->lc = 0; 1728 chan->chan.completed_cookie = 0;
1729 1729
1730 spin_lock_init(&chan->lock); 1730 spin_lock_init(&chan->lock);
1731 INIT_LIST_HEAD(&chan->pend_list); 1731 INIT_LIST_HEAD(&chan->pend_list);