aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/timb_dma.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2010-03-26 19:50:49 -0400
committerDan Williams <dan.j.williams@intel.com>2010-03-26 19:50:49 -0400
commit0793448187643b50af89d36b08470baf45a3cab4 (patch)
treeb3313ff58d47e26a8cf707d196177effa1aadfbe /drivers/dma/timb_dma.c
parentc3635c78e500a52c9fcd55de381a72928d9e054d (diff)
DMAENGINE: generic channel status v2
Convert the device_is_tx_complete() operation on the DMA engine to a generic device_tx_status()operation which can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE, DMA_TX_PAUSED. [dan.j.williams@intel.com: update for timberdale] Signed-off-by: Linus Walleij <linus.walleij@stericsson.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: Maciej Sosnowski <maciej.sosnowski@intel.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Pavel Machek <pavel@ucw.cz> Cc: Li Yang <leoli@freescale.com> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Cc: Paul Mundt <lethal@linux-sh.org> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Cc: Magnus Damm <damm@opensource.se> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Joe Perches <joe@perches.com> Cc: Roland Dreier <rdreier@cisco.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/timb_dma.c')
-rw-r--r--drivers/dma/timb_dma.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 7c06471ef863..8fc28814561a 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -511,8 +511,8 @@ static void td_free_chan_resources(struct dma_chan *chan)
511 } 511 }
512} 512}
513 513
514static enum dma_status td_is_tx_complete(struct dma_chan *chan, 514static enum dma_status td_tx_status(struct dma_chan *chan, dma_cookie_t cookie,
515 dma_cookie_t cookie, dma_cookie_t *done, dma_cookie_t *used) 515 struct dma_tx_state *txstate)
516{ 516{
517 struct timb_dma_chan *td_chan = 517 struct timb_dma_chan *td_chan =
518 container_of(chan, struct timb_dma_chan, chan); 518 container_of(chan, struct timb_dma_chan, chan);
@@ -527,10 +527,11 @@ static enum dma_status td_is_tx_complete(struct dma_chan *chan,
527 527
528 ret = dma_async_is_complete(cookie, last_complete, last_used); 528 ret = dma_async_is_complete(cookie, last_complete, last_used);
529 529
530 if (done) 530 if (txstate) {
531 *done = last_complete; 531 txstate->last = last_complete;
532 if (used) 532 txstate->used = last_used;
533 *used = last_used; 533 txstate->residue = 0;
534 }
534 535
535 dev_dbg(chan2dev(chan), 536 dev_dbg(chan2dev(chan),
536 "%s: exit, ret: %d, last_complete: %d, last_used: %d\n", 537 "%s: exit, ret: %d, last_complete: %d, last_used: %d\n",
@@ -742,7 +743,7 @@ static int __devinit td_probe(struct platform_device *pdev)
742 743
743 td->dma.device_alloc_chan_resources = td_alloc_chan_resources; 744 td->dma.device_alloc_chan_resources = td_alloc_chan_resources;
744 td->dma.device_free_chan_resources = td_free_chan_resources; 745 td->dma.device_free_chan_resources = td_free_chan_resources;
745 td->dma.device_is_tx_complete = td_is_tx_complete; 746 td->dma.device_tx_status = td_tx_status;
746 td->dma.device_issue_pending = td_issue_pending; 747 td->dma.device_issue_pending = td_issue_pending;
747 748
748 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); 749 dma_cap_set(DMA_SLAVE, td->dma.cap_mask);