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/mpc512x_dma.c | |
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/mpc512x_dma.c')
-rw-r--r-- | drivers/dma/mpc512x_dma.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c index 3fdf1f46bd63..cb3a8e94ea48 100644 --- a/drivers/dma/mpc512x_dma.c +++ b/drivers/dma/mpc512x_dma.c | |||
@@ -540,8 +540,8 @@ static void mpc_dma_issue_pending(struct dma_chan *chan) | |||
540 | 540 | ||
541 | /* Check request completion status */ | 541 | /* Check request completion status */ |
542 | static enum dma_status | 542 | static enum dma_status |
543 | mpc_dma_is_tx_complete(struct dma_chan *chan, dma_cookie_t cookie, | 543 | mpc_dma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, |
544 | dma_cookie_t *done, dma_cookie_t *used) | 544 | struct dma_tx_state *txstate) |
545 | { | 545 | { |
546 | struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(chan); | 546 | struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(chan); |
547 | unsigned long flags; | 547 | unsigned long flags; |
@@ -553,11 +553,11 @@ mpc_dma_is_tx_complete(struct dma_chan *chan, dma_cookie_t cookie, | |||
553 | last_complete = mchan->completed_cookie; | 553 | last_complete = mchan->completed_cookie; |
554 | spin_unlock_irqrestore(&mchan->lock, flags); | 554 | spin_unlock_irqrestore(&mchan->lock, flags); |
555 | 555 | ||
556 | if (done) | 556 | if (txstate) { |
557 | *done = last_complete; | 557 | txstate->last = last_complete; |
558 | 558 | txstate->used = last_used; | |
559 | if (used) | 559 | txstate->residue = 0; |
560 | *used = last_used; | 560 | } |
561 | 561 | ||
562 | return dma_async_is_complete(cookie, last_complete, last_used); | 562 | return dma_async_is_complete(cookie, last_complete, last_used); |
563 | } | 563 | } |
@@ -693,7 +693,7 @@ static int __devinit mpc_dma_probe(struct of_device *op, | |||
693 | dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources; | 693 | dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources; |
694 | dma->device_free_chan_resources = mpc_dma_free_chan_resources; | 694 | dma->device_free_chan_resources = mpc_dma_free_chan_resources; |
695 | dma->device_issue_pending = mpc_dma_issue_pending; | 695 | dma->device_issue_pending = mpc_dma_issue_pending; |
696 | dma->device_is_tx_complete = mpc_dma_is_tx_complete; | 696 | dma->device_tx_status = mpc_dma_tx_status; |
697 | dma->device_prep_dma_memcpy = mpc_dma_prep_memcpy; | 697 | dma->device_prep_dma_memcpy = mpc_dma_prep_memcpy; |
698 | 698 | ||
699 | INIT_LIST_HEAD(&dma->channels); | 699 | INIT_LIST_HEAD(&dma->channels); |