aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.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/at_hdmac.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/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index efc1a61ca231..f9143cf9e50a 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -759,13 +759,17 @@ err_desc_get:
759 return NULL; 759 return NULL;
760} 760}
761 761
762static void atc_terminate_all(struct dma_chan *chan) 762static int atc_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd)
763{ 763{
764 struct at_dma_chan *atchan = to_at_dma_chan(chan); 764 struct at_dma_chan *atchan = to_at_dma_chan(chan);
765 struct at_dma *atdma = to_at_dma(chan->device); 765 struct at_dma *atdma = to_at_dma(chan->device);
766 struct at_desc *desc, *_desc; 766 struct at_desc *desc, *_desc;
767 LIST_HEAD(list); 767 LIST_HEAD(list);
768 768
769 /* Only supports DMA_TERMINATE_ALL */
770 if (cmd != DMA_TERMINATE_ALL)
771 return -ENXIO;
772
769 /* 773 /*
770 * This is only called when something went wrong elsewhere, so 774 * This is only called when something went wrong elsewhere, so
771 * we don't really care about the data. Just disable the 775 * we don't really care about the data. Just disable the
@@ -789,6 +793,8 @@ static void atc_terminate_all(struct dma_chan *chan)
789 /* Flush all pending and queued descriptors */ 793 /* Flush all pending and queued descriptors */
790 list_for_each_entry_safe(desc, _desc, &list, desc_node) 794 list_for_each_entry_safe(desc, _desc, &list, desc_node)
791 atc_chain_complete(atchan, desc); 795 atc_chain_complete(atchan, desc);
796
797 return 0;
792} 798}
793 799
794/** 800/**
@@ -1091,7 +1097,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
1091 1097
1092 if (dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)) { 1098 if (dma_has_cap(DMA_SLAVE, atdma->dma_common.cap_mask)) {
1093 atdma->dma_common.device_prep_slave_sg = atc_prep_slave_sg; 1099 atdma->dma_common.device_prep_slave_sg = atc_prep_slave_sg;
1094 atdma->dma_common.device_terminate_all = atc_terminate_all; 1100 atdma->dma_common.device_control = atc_control;
1095 } 1101 }
1096 1102
1097 dma_writel(atdma, EN, AT_DMA_ENABLE); 1103 dma_writel(atdma, EN, AT_DMA_ENABLE);