diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:05:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-21 20:05:46 -0400 |
commit | 6f68fbaafbaa033205cd131d3e1f3c4b914e9b78 (patch) | |
tree | 56b434496064ed170f94381e3ec4c6c340b71376 /drivers/dma/txx9dmac.c | |
parent | 6e4513972a5ad28517477d21f301a02ac7a0df76 (diff) | |
parent | 0b28330e39bbe0ffee4c56b09fc415fcec595ea3 (diff) |
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
* 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx:
DMAENGINE: extend the control command to include an arg
async_tx: trim dma_async_tx_descriptor in 'no channel switch' case
DMAENGINE: DMA40 fix for allocation of logical channel 0
DMAENGINE: DMA40 support paused channel status
dmaengine: mpc512x: Use resource_size
DMA ENGINE: Do not reset 'private' of channel
ioat: Remove duplicated devm_kzalloc() calls for ioatdma_device
ioat3: disable cacheline-unaligned transfers for raid operations
ioat2,3: convert to producer/consumer locking
ioat: convert to circ_buf
DMAENGINE: Support for ST-Ericssons DMA40 block v3
async_tx: use of kzalloc/kfree requires the include of slab.h
dmaengine: provide helper for setting txstate
DMAENGINE: generic channel status v2
DMAENGINE: generic slave control v2
dma: timb-dma: Update comment and fix compiler warning
dma: Add timb-dma
DMAENGINE: COH 901 318 fix bytesleft
DMAENGINE: COH 901 318 rename confusing vars
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; |