aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/coh901318.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/coh901318.c')
-rw-r--r--drivers/dma/coh901318.c25
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 */
429u32 coh901318_get_bytes_left(struct dma_chan *chan) 429static 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}
506EXPORT_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
1138static enum dma_status 1136static enum dma_status
1139coh901318_is_tx_complete(struct dma_chan *chan, 1137coh901318_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;