diff options
author | Linus Walleij <linus.walleij@stericsson.com> | 2010-03-26 19:50:49 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2010-03-26 19:50:49 -0400 |
commit | 0793448187643b50af89d36b08470baf45a3cab4 (patch) | |
tree | b3313ff58d47e26a8cf707d196177effa1aadfbe /drivers/dma/ipu | |
parent | c3635c78e500a52c9fcd55de381a72928d9e054d (diff) |
DMAENGINE: generic channel status v2
Convert the device_is_tx_complete() operation on the
DMA engine to a generic device_tx_status()operation which
can return three states, DMA_TX_RUNNING, DMA_TX_COMPLETE,
DMA_TX_PAUSED.
[dan.j.williams@intel.com: update for timberdale]
Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Maciej Sosnowski <maciej.sosnowski@intel.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Li Yang <leoli@freescale.com>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Magnus Damm <damm@opensource.se>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: Joe Perches <joe@perches.com>
Cc: Roland Dreier <rdreier@cisco.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dma/ipu')
-rw-r--r-- | drivers/dma/ipu/ipu_idmac.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index 39e7fb2a90e3..b9cef8b1701c 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
@@ -1646,15 +1646,16 @@ static void idmac_free_chan_resources(struct dma_chan *chan) | |||
1646 | tasklet_schedule(&to_ipu(idmac)->tasklet); | 1646 | tasklet_schedule(&to_ipu(idmac)->tasklet); |
1647 | } | 1647 | } |
1648 | 1648 | ||
1649 | static enum dma_status idmac_is_tx_complete(struct dma_chan *chan, | 1649 | static enum dma_status idmac_tx_status(struct dma_chan *chan, |
1650 | dma_cookie_t cookie, dma_cookie_t *done, dma_cookie_t *used) | 1650 | dma_cookie_t cookie, struct dma_tx_state *txstate) |
1651 | { | 1651 | { |
1652 | struct idmac_channel *ichan = to_idmac_chan(chan); | 1652 | struct idmac_channel *ichan = to_idmac_chan(chan); |
1653 | 1653 | ||
1654 | if (done) | 1654 | if (txstate) { |
1655 | *done = ichan->completed; | 1655 | txstate->last = ichan->completed; |
1656 | if (used) | 1656 | txstate->used = chan->cookie; |
1657 | *used = chan->cookie; | 1657 | txstate->residue = 0; |
1658 | } | ||
1658 | if (cookie != chan->cookie) | 1659 | if (cookie != chan->cookie) |
1659 | return DMA_ERROR; | 1660 | return DMA_ERROR; |
1660 | return DMA_SUCCESS; | 1661 | return DMA_SUCCESS; |
@@ -1673,7 +1674,7 @@ static int __init ipu_idmac_init(struct ipu *ipu) | |||
1673 | dma->dev = ipu->dev; | 1674 | dma->dev = ipu->dev; |
1674 | dma->device_alloc_chan_resources = idmac_alloc_chan_resources; | 1675 | dma->device_alloc_chan_resources = idmac_alloc_chan_resources; |
1675 | dma->device_free_chan_resources = idmac_free_chan_resources; | 1676 | dma->device_free_chan_resources = idmac_free_chan_resources; |
1676 | dma->device_is_tx_complete = idmac_is_tx_complete; | 1677 | dma->device_tx_status = idmac_tx_status; |
1677 | dma->device_issue_pending = idmac_issue_pending; | 1678 | dma->device_issue_pending = idmac_issue_pending; |
1678 | 1679 | ||
1679 | /* Compulsory for DMA_SLAVE fields */ | 1680 | /* Compulsory for DMA_SLAVE fields */ |