aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/shdma.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/shdma.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/shdma.c')
-rw-r--r--drivers/dma/shdma.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c
index ce28c1e22825..8aeda9ceb225 100644
--- a/drivers/dma/shdma.c
+++ b/drivers/dma/shdma.c
@@ -738,10 +738,9 @@ static void sh_dmae_memcpy_issue_pending(struct dma_chan *chan)
738 sh_chan_xfer_ld_queue(sh_chan); 738 sh_chan_xfer_ld_queue(sh_chan);
739} 739}
740 740
741static enum dma_status sh_dmae_is_complete(struct dma_chan *chan, 741static enum dma_status sh_dmae_tx_status(struct dma_chan *chan,
742 dma_cookie_t cookie, 742 dma_cookie_t cookie,
743 dma_cookie_t *done, 743 struct dma_tx_state *txstate)
744 dma_cookie_t *used)
745{ 744{
746 struct sh_dmae_chan *sh_chan = to_sh_chan(chan); 745 struct sh_dmae_chan *sh_chan = to_sh_chan(chan);
747 dma_cookie_t last_used; 746 dma_cookie_t last_used;
@@ -754,11 +753,11 @@ static enum dma_status sh_dmae_is_complete(struct dma_chan *chan,
754 last_complete = sh_chan->completed_cookie; 753 last_complete = sh_chan->completed_cookie;
755 BUG_ON(last_complete < 0); 754 BUG_ON(last_complete < 0);
756 755
757 if (done) 756 if (txstate) {
758 *done = last_complete; 757 txstate->last = last_complete;
759 758 txstate->used = last_used;
760 if (used) 759 txstate->residue = 0;
761 *used = last_used; 760 }
762 761
763 spin_lock_bh(&sh_chan->desc_lock); 762 spin_lock_bh(&sh_chan->desc_lock);
764 763
@@ -1030,7 +1029,7 @@ static int __init sh_dmae_probe(struct platform_device *pdev)
1030 = sh_dmae_alloc_chan_resources; 1029 = sh_dmae_alloc_chan_resources;
1031 shdev->common.device_free_chan_resources = sh_dmae_free_chan_resources; 1030 shdev->common.device_free_chan_resources = sh_dmae_free_chan_resources;
1032 shdev->common.device_prep_dma_memcpy = sh_dmae_prep_memcpy; 1031 shdev->common.device_prep_dma_memcpy = sh_dmae_prep_memcpy;
1033 shdev->common.device_is_tx_complete = sh_dmae_is_complete; 1032 shdev->common.device_tx_status = sh_dmae_tx_status;
1034 shdev->common.device_issue_pending = sh_dmae_memcpy_issue_pending; 1033 shdev->common.device_issue_pending = sh_dmae_memcpy_issue_pending;
1035 1034
1036 /* Compulsory for DMA_SLAVE fields */ 1035 /* Compulsory for DMA_SLAVE fields */