aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/imx/imx-pcm-dma-mx2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/imx/imx-pcm-dma-mx2.c')
-rw-r--r--sound/soc/imx/imx-pcm-dma-mx2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c
index 19452e44afdc..c78c000e2afe 100644
--- a/sound/soc/imx/imx-pcm-dma-mx2.c
+++ b/sound/soc/imx/imx-pcm-dma-mx2.c
@@ -83,11 +83,13 @@ static void snd_imx_dma_err_callback(int channel, void *data, int err)
83static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream) 83static int imx_ssi_dma_alloc(struct snd_pcm_substream *substream)
84{ 84{
85 struct snd_soc_pcm_runtime *rtd = substream->private_data; 85 struct snd_soc_pcm_runtime *rtd = substream->private_data;
86 struct imx_pcm_dma_params *dma_params = rtd->dai->cpu_dai->dma_data; 86 struct imx_pcm_dma_params *dma_params;
87 struct snd_pcm_runtime *runtime = substream->runtime; 87 struct snd_pcm_runtime *runtime = substream->runtime;
88 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 88 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
89 int ret; 89 int ret;
90 90
91 dma_params = snd_soc_get_dma_data(rtd->dai->cpu_dai, substream);
92
91 iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH); 93 iprtd->dma = imx_dma_request_by_prio(DRV_NAME, DMA_PRIO_HIGH);
92 if (iprtd->dma < 0) { 94 if (iprtd->dma < 0) {
93 pr_err("Failed to claim the audio DMA\n"); 95 pr_err("Failed to claim the audio DMA\n");
@@ -192,10 +194,12 @@ static int snd_imx_pcm_prepare(struct snd_pcm_substream *substream)
192{ 194{
193 struct snd_pcm_runtime *runtime = substream->runtime; 195 struct snd_pcm_runtime *runtime = substream->runtime;
194 struct snd_soc_pcm_runtime *rtd = substream->private_data; 196 struct snd_soc_pcm_runtime *rtd = substream->private_data;
195 struct imx_pcm_dma_params *dma_params = rtd->dai->cpu_dai->dma_data; 197 struct imx_pcm_dma_params *dma_params;
196 struct imx_pcm_runtime_data *iprtd = runtime->private_data; 198 struct imx_pcm_runtime_data *iprtd = runtime->private_data;
197 int err; 199 int err;
198 200
201 dma_params = snd_soc_get_dma_data(rtd->dai->cpu_dai, substream);
202
199 iprtd->substream = substream; 203 iprtd->substream = substream;
200 iprtd->buf = (unsigned int *)substream->dma_buffer.area; 204 iprtd->buf = (unsigned int *)substream->dma_buffer.area;
201 iprtd->period_cnt = 0; 205 iprtd->period_cnt = 0;