diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-03-26 19:50:49 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-26 19:50:49 -0400 |
commit | 0793448187643b50af89d36b08470baf45a3cab4 (patch) | |
tree | b3313ff58d47e26a8cf707d196177effa1aadfbe /drivers/dma/fsldma.c | |
parent | c3635c78e500a52c9fcd55de381a72928d9e054d (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/fsldma.c')
-rw-r--r-- | drivers/dma/fsldma.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 714fc46e7695..ca5e8a3dce72 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
@@ -971,13 +971,12 @@ static void fsl_dma_memcpy_issue_pending(struct dma_chan *dchan) | |||
971 | } | 971 | } |
972 | 972 | ||
973 | /** | 973 | /** |
974 | * fsl_dma_is_complete - Determine the DMA status | 974 | * fsl_tx_status - Determine the DMA status |
975 | * @chan : Freescale DMA channel | 975 | * @chan : Freescale DMA channel |
976 | */ | 976 | */ |
977 | static enum dma_status fsl_dma_is_complete(struct dma_chan *dchan, | 977 | static enum dma_status fsl_tx_status(struct dma_chan *dchan, |
978 | dma_cookie_t cookie, | 978 | dma_cookie_t cookie, |
979 | dma_cookie_t *done, | 979 | struct dma_tx_state *txstate) |
980 | dma_cookie_t *used) | ||
981 | { | 980 | { |
982 | struct fsldma_chan *chan = to_fsl_chan(dchan); | 981 | struct fsldma_chan *chan = to_fsl_chan(dchan); |
983 | dma_cookie_t last_used; | 982 | dma_cookie_t last_used; |
@@ -988,11 +987,11 @@ static enum dma_status fsl_dma_is_complete(struct dma_chan *dchan, | |||
988 | last_used = dchan->cookie; | 987 | last_used = dchan->cookie; |
989 | last_complete = chan->completed_cookie; | 988 | last_complete = chan->completed_cookie; |
990 | 989 | ||
991 | if (done) | 990 | if (txstate) { |
992 | *done = last_complete; | 991 | txstate->last = last_complete; |
993 | 992 | txstate->used = last_used; | |
994 | if (used) | 993 | txstate->residue = 0; |
995 | *used = last_used; | 994 | } |
996 | 995 | ||
997 | return dma_async_is_complete(cookie, last_complete, last_used); | 996 | return dma_async_is_complete(cookie, last_complete, last_used); |
998 | } | 997 | } |
@@ -1336,7 +1335,7 @@ static int __devinit fsldma_of_probe(struct of_device *op, | |||
1336 | fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; | 1335 | fdev->common.device_free_chan_resources = fsl_dma_free_chan_resources; |
1337 | fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; | 1336 | fdev->common.device_prep_dma_interrupt = fsl_dma_prep_interrupt; |
1338 | fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; | 1337 | fdev->common.device_prep_dma_memcpy = fsl_dma_prep_memcpy; |
1339 | fdev->common.device_is_tx_complete = fsl_dma_is_complete; | 1338 | fdev->common.device_tx_status = fsl_tx_status; |
1340 | fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; | 1339 | fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; |
1341 | fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg; | 1340 | fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg; |
1342 | fdev->common.device_control = fsl_dma_device_control; | 1341 | fdev->common.device_control = fsl_dma_device_control; |