aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/fsldma.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/fsldma.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/fsldma.c')
-rw-r--r--drivers/dma/fsldma.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index bbb4be5a3ff4..714fc46e7695 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -774,13 +774,18 @@ fail:
774 return NULL; 774 return NULL;
775} 775}
776 776
777static void fsl_dma_device_terminate_all(struct dma_chan *dchan) 777static int fsl_dma_device_control(struct dma_chan *dchan,
778 enum dma_ctrl_cmd cmd)
778{ 779{
779 struct fsldma_chan *chan; 780 struct fsldma_chan *chan;
780 unsigned long flags; 781 unsigned long flags;
781 782
783 /* Only supports DMA_TERMINATE_ALL */
784 if (cmd != DMA_TERMINATE_ALL)
785 return -ENXIO;
786
782 if (!dchan) 787 if (!dchan)
783 return; 788 return -EINVAL;
784 789
785 chan = to_fsl_chan(dchan); 790 chan = to_fsl_chan(dchan);
786 791
@@ -794,6 +799,8 @@ static void fsl_dma_device_terminate_all(struct dma_chan *dchan)
794 fsldma_free_desc_list(chan, &chan->ld_running); 799 fsldma_free_desc_list(chan, &chan->ld_running);
795 800
796 spin_unlock_irqrestore(&chan->desc_lock, flags); 801 spin_unlock_irqrestore(&chan->desc_lock, flags);
802
803 return 0;
797} 804}
798 805
799/** 806/**
@@ -1332,7 +1339,7 @@ static int __devinit fsldma_of_probe(struct of_device *op,
1332 fdev->common.device_is_tx_complete = fsl_dma_is_complete; 1339 fdev->common.device_is_tx_complete = fsl_dma_is_complete;
1333 fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending; 1340 fdev->common.device_issue_pending = fsl_dma_memcpy_issue_pending;
1334 fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg; 1341 fdev->common.device_prep_slave_sg = fsl_dma_prep_slave_sg;
1335 fdev->common.device_terminate_all = fsl_dma_device_terminate_all; 1342 fdev->common.device_control = fsl_dma_device_control;
1336 fdev->common.dev = &op->dev; 1343 fdev->common.dev = &op->dev;
1337 1344
1338 dev_set_drvdata(&op->dev, fdev); 1345 dev_set_drvdata(&op->dev, fdev);