From c0fa6c8af7ab4f5d69d512a0d5fc3de512f337ae Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 9 Jan 2012 10:32:48 +0100 Subject: ASoC: i.MX: Add missing dma_async_issue_pending Signed-off-by: Sascha Hauer Acked-by: Mark Brown Signed-off-by: Vinod Koul --- sound/soc/imx/imx-pcm-dma-mx2.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound') diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 5780c9b9d569..1acfd25e107d 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -206,6 +206,7 @@ static int snd_imx_pcm_trigger(struct snd_pcm_substream *substream, int cmd) case SNDRV_PCM_TRIGGER_RESUME: case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: dmaengine_submit(iprtd->desc); + dma_async_issue_pending(iprtd->dma_chan); break; -- cgit v1.2.2 From 258aea76f552cc755da92e7e823abbb85e021514 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 1 Feb 2012 16:12:19 +0530 Subject: dmaengine: Pass dma_slave_config .device_fc = NULL for all existing users .device_fc is added in struct dma_slave_config recently. All user drivers, which want DMA to be the flow controller must pass this field as false. As earlier driver don't look to use this feature, mark it false for now. Signed-off-by: Viresh Kumar Acked-by: Linus Walleij Signed-off-by: Vinod Koul --- sound/soc/imx/imx-pcm-dma-mx2.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sound') diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 1acfd25e107d..52b0dedbf996 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -108,6 +109,8 @@ static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream, return 0; } + slave_config.device_fc = false; + if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { slave_config.direction = DMA_MEM_TO_DEV; slave_config.dst_addr = dma_params->dma_addr; -- cgit v1.2.2 From e2b35f3dbfc080f15b72834d08f04f0269dbe9be Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Wed, 1 Feb 2012 16:12:27 +0530 Subject: dmaengine/dw_dmac: Fix dw_dmac user drivers to adapt to slave_config changes There are few existing user drivers of dw_dmac. They will break as soon as we remove unused fields from struct dw_dma_slave. This patch focuses to fix these user drivers to use dma_slave_config() routine. Signed-off-by: Viresh Kumar Signed-off-by: Vinod Koul --- sound/atmel/abdac.c | 18 ++++++++++++++---- sound/atmel/ac97c.c | 41 +++++++++++++++++++++++++++++++++-------- 2 files changed, 47 insertions(+), 12 deletions(-) (limited to 'sound') diff --git a/sound/atmel/abdac.c b/sound/atmel/abdac.c index 4fa1dbd8ee83..f7c2bb08055d 100644 --- a/sound/atmel/abdac.c +++ b/sound/atmel/abdac.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -467,15 +468,24 @@ static int __devinit atmel_abdac_probe(struct platform_device *pdev) snd_card_set_dev(card, &pdev->dev); if (pdata->dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->dws; dma_cap_mask_t mask; - dws->tx_reg = regs->start + DAC_DATA; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); - dac->dma.chan = dma_request_channel(mask, filter, dws); + dac->dma.chan = dma_request_channel(mask, filter, &pdata->dws); + if (dac->dma.chan) { + struct dma_slave_config dma_conf = { + .dst_addr = regs->start + DAC_DATA, + .dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_MEM_TO_DEV, + .device_fc = false, + }; + + dmaengine_slave_config(dac->dma.chan, &dma_conf); + } } if (!pdata->dws.dma_dev || !dac->dma.chan) { dev_dbg(&pdev->dev, "DMA not available\n"); diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c index 61dade698358..115313ef54d6 100644 --- a/sound/atmel/ac97c.c +++ b/sound/atmel/ac97c.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -1014,16 +1015,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev) if (cpu_is_at32ap7000()) { if (pdata->rx_dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->rx_dws; dma_cap_mask_t mask; - dws->rx_reg = regs->start + AC97C_CARHR + 2; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); chip->dma.rx_chan = dma_request_channel(mask, filter, - dws); + &pdata->rx_dws); + if (chip->dma.rx_chan) { + struct dma_slave_config dma_conf = { + .src_addr = regs->start + AC97C_CARHR + + 2, + .src_addr_width = + DMA_SLAVE_BUSWIDTH_2_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_DEV_TO_MEM, + .device_fc = false, + }; + + dmaengine_slave_config(chip->dma.rx_chan, + &dma_conf); + } dev_info(&chip->pdev->dev, "using %s for DMA RX\n", dev_name(&chip->dma.rx_chan->dev->device)); @@ -1031,16 +1044,28 @@ static int __devinit atmel_ac97c_probe(struct platform_device *pdev) } if (pdata->tx_dws.dma_dev) { - struct dw_dma_slave *dws = &pdata->tx_dws; dma_cap_mask_t mask; - dws->tx_reg = regs->start + AC97C_CATHR + 2; - dma_cap_zero(mask); dma_cap_set(DMA_SLAVE, mask); chip->dma.tx_chan = dma_request_channel(mask, filter, - dws); + &pdata->tx_dws); + if (chip->dma.tx_chan) { + struct dma_slave_config dma_conf = { + .dst_addr = regs->start + AC97C_CATHR + + 2, + .dst_addr_width = + DMA_SLAVE_BUSWIDTH_2_BYTES, + .src_maxburst = 1, + .dst_maxburst = 1, + .direction = DMA_MEM_TO_DEV, + .device_fc = false, + }; + + dmaengine_slave_config(chip->dma.tx_chan, + &dma_conf); + } dev_info(&chip->pdev->dev, "using %s for DMA TX\n", dev_name(&chip->dma.tx_chan->dev->device)); -- cgit v1.2.2 From 16052827d98fbc13c31ebad560af4bd53e2b4dd5 Mon Sep 17 00:00:00 2001 From: Alexandre Bounine Date: Thu, 8 Mar 2012 16:11:18 -0500 Subject: dmaengine/dma_slave: introduce inline wrappers Add inline wrappers for device_prep_slave_sg() and device_prep_dma_cyclic() interfaces to hide new parameter from current users of affected interfaces. Convert current users to use new wrappers instead of direct calls. Suggested by Russell King [https://lkml.org/lkml/2012/2/3/269]. Signed-off-by: Alexandre Bounine Signed-off-by: Vinod Koul --- sound/soc/ep93xx/ep93xx-pcm.c | 3 +-- sound/soc/imx/imx-pcm-dma-mx2.c | 2 +- sound/soc/mxs/mxs-pcm.c | 2 +- sound/soc/sh/siu_pcm.c | 4 ++-- sound/soc/txx9/txx9aclc.c | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) (limited to 'sound') diff --git a/sound/soc/ep93xx/ep93xx-pcm.c b/sound/soc/ep93xx/ep93xx-pcm.c index de8390449873..50593e50ad57 100644 --- a/sound/soc/ep93xx/ep93xx-pcm.c +++ b/sound/soc/ep93xx/ep93xx-pcm.c @@ -142,11 +142,10 @@ static int ep93xx_pcm_dma_submit(struct snd_pcm_substream *substream) struct snd_pcm_runtime *runtime = substream->runtime; struct ep93xx_runtime_data *rtd = runtime->private_data; struct dma_chan *chan = rtd->dma_chan; - struct dma_device *dma_dev = chan->device; struct dma_async_tx_descriptor *desc; rtd->pointer_bytes = 0; - desc = dma_dev->device_prep_dma_cyclic(chan, runtime->dma_addr, + desc = dmaengine_prep_dma_cyclic(chan, runtime->dma_addr, rtd->period_bytes * rtd->periods, rtd->period_bytes, rtd->dma_data.direction); diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 52b0dedbf996..af46b4e2b438 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -160,7 +160,7 @@ static int snd_imx_pcm_hw_params(struct snd_pcm_substream *substream, iprtd->buf = (unsigned int *)substream->dma_buffer.area; - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, iprtd->period_bytes * iprtd->periods, iprtd->period_bytes, substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index 105f42a394df..661b678d08a8 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c @@ -132,7 +132,7 @@ static int snd_mxs_pcm_hw_params(struct snd_pcm_substream *substream, iprtd->buf = substream->dma_buffer.area; - iprtd->desc = chan->device->device_prep_dma_cyclic(chan, dma_addr, + iprtd->desc = dmaengine_prep_dma_cyclic(chan, dma_addr, iprtd->period_bytes * iprtd->periods, iprtd->period_bytes, substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index 0193e595d415..5cfcc655e95f 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -130,7 +130,7 @@ static int siu_pcm_wr_set(struct siu_port *port_info, sg_dma_len(&sg) = size; sg_dma_address(&sg) = buff; - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, + desc = dmaengine_prep_slave_sg(siu_stream->chan, &sg, 1, DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { dev_err(dev, "Failed to allocate a dma descriptor\n"); @@ -180,7 +180,7 @@ static int siu_pcm_rd_set(struct siu_port *port_info, sg_dma_len(&sg) = size; sg_dma_address(&sg) = buff; - desc = siu_stream->chan->device->device_prep_slave_sg(siu_stream->chan, + desc = dmaengine_prep_slave_sg(siu_stream->chan, &sg, 1, DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); if (!desc) { dev_err(dev, "Failed to allocate dma descriptor\n"); diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 21554611557c..b609d2c64c55 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -132,7 +132,7 @@ txx9aclc_dma_submit(struct txx9aclc_dmadata *dmadata, dma_addr_t buf_dma_addr) sg_set_page(&sg, pfn_to_page(PFN_DOWN(buf_dma_addr)), dmadata->frag_bytes, buf_dma_addr & (PAGE_SIZE - 1)); sg_dma_address(&sg) = buf_dma_addr; - desc = chan->device->device_prep_slave_sg(chan, &sg, 1, + desc = dmaengine_prep_slave_sg(chan, &sg, 1, dmadata->substream->stream == SNDRV_PCM_STREAM_PLAYBACK ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT | DMA_CTRL_ACK); -- cgit v1.2.2