aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2013-07-11 08:35:43 -0400
committerMark Brown <broonie@linaro.org>2013-07-11 12:37:44 -0400
commitf6becf0b2ffef0bed813d7f910b5d276c5dc45e1 (patch)
tree379feabda5b68f0174c4506d76480398ce4e8bac /sound
parent84bbc4aa2de97143db0f6ef0c3fa0bd84f73b207 (diff)
ASoC: omap-pcm: Request the DMA channel differently when DT is involved
When booting with DT the platform_get_resource_byname() is not available to get the DMA resource. In this case the DAI drivers will set the filter_data to the name of the DMA and omap-pcm can use this to request the DMA channel. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/omap/omap-pcm.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index c28e042f2208..a11405de86e8 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -113,14 +113,25 @@ static int omap_pcm_open(struct snd_pcm_substream *substream)
113{ 113{
114 struct snd_soc_pcm_runtime *rtd = substream->private_data; 114 struct snd_soc_pcm_runtime *rtd = substream->private_data;
115 struct snd_dmaengine_dai_dma_data *dma_data; 115 struct snd_dmaengine_dai_dma_data *dma_data;
116 int ret;
116 117
117 snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware); 118 snd_soc_set_runtime_hwparams(substream, &omap_pcm_hardware);
118 119
119 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream); 120 dma_data = snd_soc_dai_get_dma_data(rtd->cpu_dai, substream);
120 121
121 return snd_dmaengine_pcm_open_request_chan(substream, 122 /* DT boot: filter_data is the DMA name */
122 omap_dma_filter_fn, 123 if (rtd->cpu_dai->dev->of_node) {
123 dma_data->filter_data); 124 struct dma_chan *chan;
125
126 chan = dma_request_slave_channel(rtd->cpu_dai->dev,
127 dma_data->filter_data);
128 ret = snd_dmaengine_pcm_open(substream, chan);
129 } else {
130 ret = snd_dmaengine_pcm_open_request_chan(substream,
131 omap_dma_filter_fn,
132 dma_data->filter_data);
133 }
134 return ret;
124} 135}
125 136
126static int omap_pcm_mmap(struct snd_pcm_substream *substream, 137static int omap_pcm_mmap(struct snd_pcm_substream *substream,