diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-05-10 18:39:27 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2012-07-01 09:15:22 -0400 |
commit | fe045874aaf4480386c65baf1acae82af4c5e21f (patch) | |
tree | 00bd605046eb02e925b710bc625b9f9b70fa3c94 /drivers/dma | |
parent | 50437bff7f7374f86837986f66e15e73a364f894 (diff) |
dmaengine: virt-dma: vchan_find_desc()
Add a function to find a descriptor within the depths of the
virtualized DMA channel support. Needed for tx_status functionality.
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/virt-dma.c | 13 | ||||
-rw-r--r-- | drivers/dma/virt-dma.h | 2 |
2 files changed, 14 insertions, 1 deletions
diff --git a/drivers/dma/virt-dma.c b/drivers/dma/virt-dma.c index bd85b052b481..a8054fc40cef 100644 --- a/drivers/dma/virt-dma.c +++ b/drivers/dma/virt-dma.c | |||
@@ -39,6 +39,19 @@ dma_cookie_t vchan_tx_submit(struct dma_async_tx_descriptor *tx) | |||
39 | } | 39 | } |
40 | EXPORT_SYMBOL_GPL(vchan_tx_submit); | 40 | EXPORT_SYMBOL_GPL(vchan_tx_submit); |
41 | 41 | ||
42 | struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *vc, | ||
43 | dma_cookie_t cookie) | ||
44 | { | ||
45 | struct virt_dma_desc *vd; | ||
46 | |||
47 | list_for_each_entry(vd, &vc->desc_issued, node) | ||
48 | if (vd->tx.cookie == cookie) | ||
49 | return vd; | ||
50 | |||
51 | return NULL; | ||
52 | } | ||
53 | EXPORT_SYMBOL_GPL(vchan_find_desc); | ||
54 | |||
42 | /* | 55 | /* |
43 | * This tasklet handles the completion of a DMA descriptor by | 56 | * This tasklet handles the completion of a DMA descriptor by |
44 | * calling its callback and freeing it. | 57 | * calling its callback and freeing it. |
diff --git a/drivers/dma/virt-dma.h b/drivers/dma/virt-dma.h index 825bb9623175..44ec57e7e419 100644 --- a/drivers/dma/virt-dma.h +++ b/drivers/dma/virt-dma.h | |||
@@ -40,8 +40,8 @@ static inline struct virt_dma_chan *to_virt_chan(struct dma_chan *chan) | |||
40 | } | 40 | } |
41 | 41 | ||
42 | void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head); | 42 | void vchan_dma_desc_free_list(struct virt_dma_chan *vc, struct list_head *head); |
43 | |||
44 | void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev); | 43 | void vchan_init(struct virt_dma_chan *vc, struct dma_device *dmadev); |
44 | struct virt_dma_desc *vchan_find_desc(struct virt_dma_chan *, dma_cookie_t); | ||
45 | 45 | ||
46 | /** | 46 | /** |
47 | * vchan_tx_prep - prepare a descriptor | 47 | * vchan_tx_prep - prepare a descriptor |