diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2013-04-15 13:19:48 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-17 09:17:54 -0400 |
commit | 7c1c1d4a7b4ca1266057a3632d27450f5575caf9 (patch) | |
tree | 39e53ebd108b551ba939fd13ca9e3c2f8f869400 /sound/soc/mxs | |
parent | 69b6f19622ce0aef41df884b75e3f789c64b89c0 (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/mxs')
-rw-r--r-- | sound/soc/mxs/mxs-pcm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/mxs/mxs-pcm.c b/sound/soc/mxs/mxs-pcm.c index ebbef8597554..7bceb16d0fd9 100644 --- a/sound/soc/mxs/mxs-pcm.c +++ b/sound/soc/mxs/mxs-pcm.c | |||
@@ -87,7 +87,7 @@ static int snd_mxs_open(struct snd_pcm_substream *substream) | |||
87 | 87 | ||
88 | snd_soc_set_runtime_hwparams(substream, &snd_mxs_hardware); | 88 | snd_soc_set_runtime_hwparams(substream, &snd_mxs_hardware); |
89 | 89 | ||
90 | return snd_dmaengine_pcm_open(substream, filter, | 90 | return snd_dmaengine_pcm_open_request_chan(substream, filter, |
91 | snd_soc_dai_get_dma_data(rtd->cpu_dai, substream)); | 91 | snd_soc_dai_get_dma_data(rtd->cpu_dai, substream)); |
92 | } | 92 | } |
93 | 93 | ||
@@ -104,7 +104,7 @@ static int snd_mxs_pcm_mmap(struct snd_pcm_substream *substream, | |||
104 | 104 | ||
105 | static struct snd_pcm_ops mxs_pcm_ops = { | 105 | static struct snd_pcm_ops mxs_pcm_ops = { |
106 | .open = snd_mxs_open, | 106 | .open = snd_mxs_open, |
107 | .close = snd_dmaengine_pcm_close, | 107 | .close = snd_dmaengine_pcm_close_release_chan, |
108 | .ioctl = snd_pcm_lib_ioctl, | 108 | .ioctl = snd_pcm_lib_ioctl, |
109 | .hw_params = snd_mxs_pcm_hw_params, | 109 | .hw_params = snd_mxs_pcm_hw_params, |
110 | .trigger = snd_dmaengine_pcm_trigger, | 110 | .trigger = snd_dmaengine_pcm_trigger, |