diff options
Diffstat (limited to 'drivers/dma/txx9dmac.c')
-rw-r--r-- | drivers/dma/txx9dmac.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/dma/txx9dmac.c b/drivers/dma/txx9dmac.c index 75fcf1ac8bb7..cbd83e362b5e 100644 --- a/drivers/dma/txx9dmac.c +++ b/drivers/dma/txx9dmac.c | |||
@@ -938,12 +938,17 @@ txx9dmac_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
938 | return &first->txd; | 938 | return &first->txd; |
939 | } | 939 | } |
940 | 940 | ||
941 | static void txx9dmac_terminate_all(struct dma_chan *chan) | 941 | static int txx9dmac_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, |
942 | unsigned long arg) | ||
942 | { | 943 | { |
943 | struct txx9dmac_chan *dc = to_txx9dmac_chan(chan); | 944 | struct txx9dmac_chan *dc = to_txx9dmac_chan(chan); |
944 | struct txx9dmac_desc *desc, *_desc; | 945 | struct txx9dmac_desc *desc, *_desc; |
945 | LIST_HEAD(list); | 946 | LIST_HEAD(list); |
946 | 947 | ||
948 | /* Only supports DMA_TERMINATE_ALL */ | ||
949 | if (cmd != DMA_TERMINATE_ALL) | ||
950 | return -EINVAL; | ||
951 | |||
947 | dev_vdbg(chan2dev(chan), "terminate_all\n"); | 952 | dev_vdbg(chan2dev(chan), "terminate_all\n"); |
948 | spin_lock_bh(&dc->lock); | 953 | spin_lock_bh(&dc->lock); |
949 | 954 | ||
@@ -958,12 +963,13 @@ static void txx9dmac_terminate_all(struct dma_chan *chan) | |||
958 | /* Flush all pending and queued descriptors */ | 963 | /* Flush all pending and queued descriptors */ |
959 | list_for_each_entry_safe(desc, _desc, &list, desc_node) | 964 | list_for_each_entry_safe(desc, _desc, &list, desc_node) |
960 | txx9dmac_descriptor_complete(dc, desc); | 965 | txx9dmac_descriptor_complete(dc, desc); |
966 | |||
967 | return 0; | ||
961 | } | 968 | } |
962 | 969 | ||
963 | static enum dma_status | 970 | static enum dma_status |
964 | txx9dmac_is_tx_complete(struct dma_chan *chan, | 971 | txx9dmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
965 | dma_cookie_t cookie, | 972 | struct dma_tx_state *txstate) |
966 | dma_cookie_t *done, dma_cookie_t *used) | ||
967 | { | 973 | { |
968 | struct txx9dmac_chan *dc = to_txx9dmac_chan(chan); | 974 | struct txx9dmac_chan *dc = to_txx9dmac_chan(chan); |
969 | dma_cookie_t last_used; | 975 | dma_cookie_t last_used; |
@@ -985,10 +991,7 @@ txx9dmac_is_tx_complete(struct dma_chan *chan, | |||
985 | ret = dma_async_is_complete(cookie, last_complete, last_used); | 991 | ret = dma_async_is_complete(cookie, last_complete, last_used); |
986 | } | 992 | } |
987 | 993 | ||
988 | if (done) | 994 | dma_set_tx_state(txstate, last_complete, last_used, 0); |
989 | *done = last_complete; | ||
990 | if (used) | ||
991 | *used = last_used; | ||
992 | 995 | ||
993 | return ret; | 996 | return ret; |
994 | } | 997 | } |
@@ -1153,8 +1156,8 @@ static int __init txx9dmac_chan_probe(struct platform_device *pdev) | |||
1153 | dc->dma.dev = &pdev->dev; | 1156 | dc->dma.dev = &pdev->dev; |
1154 | dc->dma.device_alloc_chan_resources = txx9dmac_alloc_chan_resources; | 1157 | dc->dma.device_alloc_chan_resources = txx9dmac_alloc_chan_resources; |
1155 | dc->dma.device_free_chan_resources = txx9dmac_free_chan_resources; | 1158 | dc->dma.device_free_chan_resources = txx9dmac_free_chan_resources; |
1156 | dc->dma.device_terminate_all = txx9dmac_terminate_all; | 1159 | dc->dma.device_control = txx9dmac_control; |
1157 | dc->dma.device_is_tx_complete = txx9dmac_is_tx_complete; | 1160 | dc->dma.device_tx_status = txx9dmac_tx_status; |
1158 | dc->dma.device_issue_pending = txx9dmac_issue_pending; | 1161 | dc->dma.device_issue_pending = txx9dmac_issue_pending; |
1159 | if (pdata && pdata->memcpy_chan == ch) { | 1162 | if (pdata && pdata->memcpy_chan == ch) { |
1160 | dc->dma.device_prep_dma_memcpy = txx9dmac_prep_dma_memcpy; | 1163 | dc->dma.device_prep_dma_memcpy = txx9dmac_prep_dma_memcpy; |