aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/timb_dma.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@stericsson.com>2010-03-26 19:44:01 -0400
committerDan Williams <dan.j.williams@intel.com>2010-03-26 19:44:01 -0400
commitc3635c78e500a52c9fcd55de381a72928d9e054d (patch)
tree87403f402227cd8b5572550e70facf81c9eaa0d9 /drivers/dma/timb_dma.c
parent0f65169b1bf44220308e1ce1f6666ad03ddc27af (diff)
DMAENGINE: generic slave control v2
Convert the device_terminate_all() operation on the DMA engine to a generic device_control() operation which can now optionally support also pausing and resuming DMA on a certain channel. Implemented for the COH 901 318 DMAC as an example. [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/timb_dma.c')
-rw-r--r--drivers/dma/timb_dma.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/dma/timb_dma.c b/drivers/dma/timb_dma.c
index 145f1c23408f..7c06471ef863 100644
--- a/drivers/dma/timb_dma.c
+++ b/drivers/dma/timb_dma.c
@@ -613,7 +613,7 @@ static struct dma_async_tx_descriptor *td_prep_slave_sg(struct dma_chan *chan,
613 return &td_desc->txd; 613 return &td_desc->txd;
614} 614}
615 615
616static void td_terminate_all(struct dma_chan *chan) 616static int td_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
617{ 617{
618 struct timb_dma_chan *td_chan = 618 struct timb_dma_chan *td_chan =
619 container_of(chan, struct timb_dma_chan, chan); 619 container_of(chan, struct timb_dma_chan, chan);
@@ -621,6 +621,9 @@ static void td_terminate_all(struct dma_chan *chan)
621 621
622 dev_dbg(chan2dev(chan), "%s: Entry\n", __func__); 622 dev_dbg(chan2dev(chan), "%s: Entry\n", __func__);
623 623
624 if (cmd != DMA_TERMINATE_ALL)
625 return -ENXIO;
626
624 /* first the easy part, put the queue into the free list */ 627 /* first the easy part, put the queue into the free list */
625 spin_lock_bh(&td_chan->lock); 628 spin_lock_bh(&td_chan->lock);
626 list_for_each_entry_safe(td_desc, _td_desc, &td_chan->queue, 629 list_for_each_entry_safe(td_desc, _td_desc, &td_chan->queue,
@@ -630,6 +633,8 @@ static void td_terminate_all(struct dma_chan *chan)
630 /* now tear down the runnning */ 633 /* now tear down the runnning */
631 __td_finish(td_chan); 634 __td_finish(td_chan);
632 spin_unlock_bh(&td_chan->lock); 635 spin_unlock_bh(&td_chan->lock);
636
637 return 0;
633} 638}
634 639
635static void td_tasklet(unsigned long data) 640static void td_tasklet(unsigned long data)
@@ -743,7 +748,7 @@ static int __devinit td_probe(struct platform_device *pdev)
743 dma_cap_set(DMA_SLAVE, td->dma.cap_mask); 748 dma_cap_set(DMA_SLAVE, td->dma.cap_mask);
744 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask); 749 dma_cap_set(DMA_PRIVATE, td->dma.cap_mask);
745 td->dma.device_prep_slave_sg = td_prep_slave_sg; 750 td->dma.device_prep_slave_sg = td_prep_slave_sg;
746 td->dma.device_terminate_all = td_terminate_all; 751 td->dma.device_control = td_control;
747 752
748 td->dma.dev = &pdev->dev; 753 td->dma.dev = &pdev->dev;
749 754