aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/ux500
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2013-04-15 13:19:48 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-04-17 09:17:54 -0400
commit7c1c1d4a7b4ca1266057a3632d27450f5575caf9 (patch)
tree39e53ebd108b551ba939fd13ca9e3c2f8f869400 /sound/soc/ux500
parent69b6f19622ce0aef41df884b75e3f789c64b89c0 (diff)
ASoC: dmaengine-pcm: Make requesting the DMA channel at PCM open optional
Refactor the dmaengine PCM library to allow the DMA channel to be requested before opening a PCM substream. snd_dmaengine_pcm_open() now expects a DMA channel instead of a filter function and filter parameter as its parameters. snd_dmaengine_pcm_close() is updated to not release the DMA channel. This allows a dmaengine based PCM driver to request its channels before the substream is opened. The patch also introduces two new functions, snd_dmaengine_pcm_open_request_chan() and snd_dmaengine_pcm_close_release_chan(), which have the same signature and behaviour of the old snd_dmaengine_pcm_{open,close}() and internally use the new variants of these functions. All users of snd_dmaengine_pcm_{open,close}() are updated to use snd_dmaengine_pcm_open_request_chan() and snd_dmaengine_pcm_close_release_chan(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Stephen Warren <swarren@nvidia.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/ux500')
-rw-r--r--sound/soc/ux500/ux500_pcm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/ux500/ux500_pcm.c b/sound/soc/ux500/ux500_pcm.c
index 09b5364e5095..a7d4f04e5964 100644
--- a/sound/soc/ux500/ux500_pcm.c
+++ b/sound/soc/ux500/ux500_pcm.c
@@ -125,8 +125,8 @@ static int ux500_pcm_open(struct snd_pcm_substream *substream)
125 dma_cfg->dst_info.data_width = mem_data_width; 125 dma_cfg->dst_info.data_width = mem_data_width;
126 } 126 }
127 127
128 128 ret = snd_dmaengine_pcm_open_request_chan(substream, stedma40_filter,
129 ret = snd_dmaengine_pcm_open(substream, stedma40_filter, dma_cfg); 129 dma_cfg);
130 if (ret) { 130 if (ret) {
131 dev_dbg(dai->dev, 131 dev_dbg(dai->dev,
132 "%s: ERROR: snd_dmaengine_pcm_open failed (%d)!\n", 132 "%s: ERROR: snd_dmaengine_pcm_open failed (%d)!\n",
@@ -211,7 +211,7 @@ static int ux500_pcm_mmap(struct snd_pcm_substream *substream,
211 211
212static struct snd_pcm_ops ux500_pcm_ops = { 212static struct snd_pcm_ops ux500_pcm_ops = {
213 .open = ux500_pcm_open, 213 .open = ux500_pcm_open,
214 .close = snd_dmaengine_pcm_close, 214 .close = snd_dmaengine_pcm_close_release_chan,
215 .ioctl = snd_pcm_lib_ioctl, 215 .ioctl = snd_pcm_lib_ioctl,
216 .hw_params = ux500_pcm_hw_params, 216 .hw_params = ux500_pcm_hw_params,
217 .hw_free = ux500_pcm_hw_free, 217 .hw_free = ux500_pcm_hw_free,