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/coh901318.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/coh901318.c')
-rw-r--r-- | drivers/dma/coh901318.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index 53c54e034aa3..309db3beef16 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c | |||
@@ -426,7 +426,7 @@ static inline u32 coh901318_get_bytes_in_lli(struct coh901318_lli *in_lli) | |||
426 | * absolute measures, but for a rough guess you can still call | 426 | * absolute measures, but for a rough guess you can still call |
427 | * it. | 427 | * it. |
428 | */ | 428 | */ |
429 | u32 coh901318_get_bytes_left(struct dma_chan *chan) | 429 | static u32 coh901318_get_bytes_left(struct dma_chan *chan) |
430 | { | 430 | { |
431 | struct coh901318_chan *cohc = to_coh901318_chan(chan); | 431 | struct coh901318_chan *cohc = to_coh901318_chan(chan); |
432 | struct coh901318_desc *cohd; | 432 | struct coh901318_desc *cohd; |
@@ -503,8 +503,6 @@ u32 coh901318_get_bytes_left(struct dma_chan *chan) | |||
503 | 503 | ||
504 | return left; | 504 | return left; |
505 | } | 505 | } |
506 | EXPORT_SYMBOL(coh901318_get_bytes_left); | ||
507 | |||
508 | 506 | ||
509 | /* | 507 | /* |
510 | * Pauses a transfer without losing data. Enables power save. | 508 | * Pauses a transfer without losing data. Enables power save. |
@@ -1136,9 +1134,8 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
1136 | } | 1134 | } |
1137 | 1135 | ||
1138 | static enum dma_status | 1136 | static enum dma_status |
1139 | coh901318_is_tx_complete(struct dma_chan *chan, | 1137 | coh901318_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
1140 | dma_cookie_t cookie, dma_cookie_t *done, | 1138 | struct dma_tx_state *txstate) |
1141 | dma_cookie_t *used) | ||
1142 | { | 1139 | { |
1143 | struct coh901318_chan *cohc = to_coh901318_chan(chan); | 1140 | struct coh901318_chan *cohc = to_coh901318_chan(chan); |
1144 | dma_cookie_t last_used; | 1141 | dma_cookie_t last_used; |
@@ -1150,10 +1147,14 @@ coh901318_is_tx_complete(struct dma_chan *chan, | |||
1150 | 1147 | ||
1151 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 1148 | ret = dma_async_is_complete(cookie, last_complete, last_used); |
1152 | 1149 | ||
1153 | if (done) | 1150 | if (txstate) { |
1154 | *done = last_complete; | 1151 | txstate->last = last_complete; |
1155 | if (used) | 1152 | txstate->used = last_used; |
1156 | *used = last_used; | 1153 | txstate->residue = coh901318_get_bytes_left(chan); |
1154 | } | ||
1155 | |||
1156 | if (ret == DMA_IN_PROGRESS && cohc->stopped) | ||
1157 | ret = DMA_PAUSED; | ||
1157 | 1158 | ||
1158 | return ret; | 1159 | return ret; |
1159 | } | 1160 | } |
@@ -1356,7 +1357,7 @@ static int __init coh901318_probe(struct platform_device *pdev) | |||
1356 | base->dma_slave.device_alloc_chan_resources = coh901318_alloc_chan_resources; | 1357 | base->dma_slave.device_alloc_chan_resources = coh901318_alloc_chan_resources; |
1357 | base->dma_slave.device_free_chan_resources = coh901318_free_chan_resources; | 1358 | base->dma_slave.device_free_chan_resources = coh901318_free_chan_resources; |
1358 | base->dma_slave.device_prep_slave_sg = coh901318_prep_slave_sg; | 1359 | base->dma_slave.device_prep_slave_sg = coh901318_prep_slave_sg; |
1359 | base->dma_slave.device_is_tx_complete = coh901318_is_tx_complete; | 1360 | base->dma_slave.device_tx_status = coh901318_tx_status; |
1360 | base->dma_slave.device_issue_pending = coh901318_issue_pending; | 1361 | base->dma_slave.device_issue_pending = coh901318_issue_pending; |
1361 | base->dma_slave.device_control = coh901318_control; | 1362 | base->dma_slave.device_control = coh901318_control; |
1362 | base->dma_slave.dev = &pdev->dev; | 1363 | base->dma_slave.dev = &pdev->dev; |
@@ -1376,7 +1377,7 @@ static int __init coh901318_probe(struct platform_device *pdev) | |||
1376 | base->dma_memcpy.device_alloc_chan_resources = coh901318_alloc_chan_resources; | 1377 | base->dma_memcpy.device_alloc_chan_resources = coh901318_alloc_chan_resources; |
1377 | base->dma_memcpy.device_free_chan_resources = coh901318_free_chan_resources; | 1378 | base->dma_memcpy.device_free_chan_resources = coh901318_free_chan_resources; |
1378 | base->dma_memcpy.device_prep_dma_memcpy = coh901318_prep_memcpy; | 1379 | base->dma_memcpy.device_prep_dma_memcpy = coh901318_prep_memcpy; |
1379 | base->dma_memcpy.device_is_tx_complete = coh901318_is_tx_complete; | 1380 | base->dma_memcpy.device_tx_status = coh901318_tx_status; |
1380 | base->dma_memcpy.device_issue_pending = coh901318_issue_pending; | 1381 | base->dma_memcpy.device_issue_pending = coh901318_issue_pending; |
1381 | base->dma_memcpy.device_control = coh901318_control; | 1382 | base->dma_memcpy.device_control = coh901318_control; |
1382 | base->dma_memcpy.dev = &pdev->dev; | 1383 | base->dma_memcpy.dev = &pdev->dev; |