diff options
Diffstat (limited to 'drivers/dma/at_hdmac.c')
| -rw-r--r-- | drivers/dma/at_hdmac.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index f9143cf9e50a..ff75cf18d32e 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
| @@ -798,29 +798,25 @@ static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd) | |||
| 798 | } | 798 | } |
| 799 | 799 | ||
| 800 | /** | 800 | /** |
| 801 | * atc_is_tx_complete - poll for transaction completion | 801 | * atc_tx_status - poll for transaction completion |
| 802 | * @chan: DMA channel | 802 | * @chan: DMA channel |
| 803 | * @cookie: transaction identifier to check status of | 803 | * @cookie: transaction identifier to check status of |
| 804 | * @done: if not %NULL, updated with last completed transaction | 804 | * @txstate: if not %NULL updated with transaction state |
| 805 | * @used: if not %NULL, updated with last used transaction | ||
| 806 | * | 805 | * |
| 807 | * If @done and @used are passed in, upon return they reflect the driver | 806 | * If @txstate is passed in, upon return it reflect the driver |
| 808 | * internal state and can be used with dma_async_is_complete() to check | 807 | * internal state and can be used with dma_async_is_complete() to check |
| 809 | * the status of multiple cookies without re-checking hardware state. | 808 | * the status of multiple cookies without re-checking hardware state. |
| 810 | */ | 809 | */ |
| 811 | static enum dma_status | 810 | static enum dma_status |
| 812 | atc_is_tx_complete(struct dma_chan *chan, | 811 | atc_tx_status(struct dma_chan *chan, |
| 813 | dma_cookie_t cookie, | 812 | dma_cookie_t cookie, |
| 814 | dma_cookie_t *done, dma_cookie_t *used) | 813 | struct dma_tx_state *txstate) |
| 815 | { | 814 | { |
| 816 | struct at_dma_chan *atchan = to_at_dma_chan(chan); | 815 | struct at_dma_chan *atchan = to_at_dma_chan(chan); |
| 817 | dma_cookie_t last_used; | 816 | dma_cookie_t last_used; |
| 818 | dma_cookie_t last_complete; | 817 | dma_cookie_t last_complete; |
| 819 | enum dma_status ret; | 818 | enum dma_status ret; |
| 820 | 819 | ||
| 821 | dev_vdbg(chan2dev(chan), "is_tx_complete: %d (d%d, u%d)\n", | ||
| 822 | cookie, done ? *done : 0, used ? *used : 0); | ||
| 823 | |||
| 824 | spin_lock_bh(&atchan->lock); | 820 | spin_lock_bh(&atchan->lock); |
| 825 | 821 | ||
| 826 | last_complete = atchan->completed_cookie; | 822 | last_complete = atchan->completed_cookie; |
| @@ -838,10 +834,15 @@ atc_is_tx_complete(struct dma_chan *chan, | |||
| 838 | 834 | ||
| 839 | spin_unlock_bh(&atchan->lock); | 835 | spin_unlock_bh(&atchan->lock); |
| 840 | 836 | ||
| 841 | if (done) | 837 | if (txstate) { |
| 842 | *done = last_complete; | 838 | txstate->last = last_complete; |
| 843 | if (used) | 839 | txstate->used = last_used; |
| 844 | *used = last_used; | 840 | txstate->residue = 0; |
| 841 | } | ||
| 842 | |||
| 843 | dev_vdbg(chan2dev(chan), "tx_status: %d (d%d, u%d)\n", | ||
| 844 | cookie, last_complete ? last_complete : 0, | ||
| 845 | last_used ? last_used : 0); | ||
| 845 | 846 | ||
| 846 | return ret; | 847 | return ret; |
| 847 | } | 848 | } |
| @@ -1087,7 +1088,7 @@ static int __init at_dma_probe(struct platform_device *pdev) | |||
| 1087 | /* set base routines */ | 1088 | /* set base routines */ |
| 1088 | atdma->dma_common.device_alloc_chan_resources = atc_alloc_chan_resources; | 1089 | atdma->dma_common.device_alloc_chan_resources = atc_alloc_chan_resources; |
| 1089 | atdma->dma_common.device_free_chan_resources = atc_free_chan_resources; | 1090 | atdma->dma_common.device_free_chan_resources = atc_free_chan_resources; |
| 1090 | atdma->dma_common.device_is_tx_complete = atc_is_tx_complete; | 1091 | atdma->dma_common.device_tx_status = atc_tx_status; |
| 1091 | atdma->dma_common.device_issue_pending = atc_issue_pending; | 1092 | atdma->dma_common.device_issue_pending = atc_issue_pending; |
| 1092 | atdma->dma_common.dev = &pdev->dev; | 1093 | atdma->dma_common.dev = &pdev->dev; |
| 1093 | 1094 | ||
