aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/s3c24xx/s3c-ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/s3c24xx/s3c-ac97.c')
-rw-r--r--sound/soc/s3c24xx/s3c-ac97.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sound/soc/s3c24xx/s3c-ac97.c b/sound/soc/s3c24xx/s3c-ac97.c
index ee8ed9d7e703..ecf4fd04ae96 100644
--- a/sound/soc/s3c24xx/s3c-ac97.c
+++ b/sound/soc/s3c24xx/s3c-ac97.c
@@ -224,11 +224,14 @@ static int s3c_ac97_hw_params(struct snd_pcm_substream *substream,
224{ 224{
225 struct snd_soc_pcm_runtime *rtd = substream->private_data; 225 struct snd_soc_pcm_runtime *rtd = substream->private_data;
226 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai; 226 struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
227 struct s3c_dma_params *dma_data;
227 228
228 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 229 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
229 cpu_dai->dma_data = &s3c_ac97_pcm_out; 230 dma_data = &s3c_ac97_pcm_out;
230 else 231 else
231 cpu_dai->dma_data = &s3c_ac97_pcm_in; 232 dma_data = &s3c_ac97_pcm_in;
233
234 snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);
232 235
233 return 0; 236 return 0;
234} 237}
@@ -238,8 +241,8 @@ static int s3c_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
238{ 241{
239 u32 ac_glbctrl; 242 u32 ac_glbctrl;
240 struct snd_soc_pcm_runtime *rtd = substream->private_data; 243 struct snd_soc_pcm_runtime *rtd = substream->private_data;
241 int channel = ((struct s3c_dma_params *) 244 struct s3c_dma_params *dma_data =
242 rtd->dai->cpu_dai->dma_data)->channel; 245 snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
243 246
244 ac_glbctrl = readl(s3c_ac97.regs + S3C_AC97_GLBCTRL); 247 ac_glbctrl = readl(s3c_ac97.regs + S3C_AC97_GLBCTRL);
245 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) 248 if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
@@ -265,7 +268,7 @@ static int s3c_ac97_trigger(struct snd_pcm_substream *substream, int cmd,
265 268
266 writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL); 269 writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
267 270
268 s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STARTED); 271 s3c2410_dma_ctrl(dma_data->channel, S3C2410_DMAOP_STARTED);
269 272
270 return 0; 273 return 0;
271} 274}
@@ -280,7 +283,7 @@ static int s3c_ac97_hw_mic_params(struct snd_pcm_substream *substream,
280 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 283 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
281 return -ENODEV; 284 return -ENODEV;
282 else 285 else
283 cpu_dai->dma_data = &s3c_ac97_mic_in; 286 snd_soc_dai_set_dma_data(cpu_dai, substream, &s3c_ac97_mic_in);
284 287
285 return 0; 288 return 0;
286} 289}
@@ -290,8 +293,8 @@ static int s3c_ac97_mic_trigger(struct snd_pcm_substream *substream,
290{ 293{
291 u32 ac_glbctrl; 294 u32 ac_glbctrl;
292 struct snd_soc_pcm_runtime *rtd = substream->private_data; 295 struct snd_soc_pcm_runtime *rtd = substream->private_data;
293 int channel = ((struct s3c_dma_params *) 296 struct s3c_dma_params *dma_data =
294 rtd->dai->cpu_dai->dma_data)->channel; 297 snd_soc_dai_get_dma_data(rtd->dai->cpu_dai, substream);
295 298
296 ac_glbctrl = readl(s3c_ac97.regs + S3C_AC97_GLBCTRL); 299 ac_glbctrl = readl(s3c_ac97.regs + S3C_AC97_GLBCTRL);
297 ac_glbctrl &= ~S3C_AC97_GLBCTRL_MICINTM_MASK; 300 ac_glbctrl &= ~S3C_AC97_GLBCTRL_MICINTM_MASK;
@@ -311,7 +314,7 @@ static int s3c_ac97_mic_trigger(struct snd_pcm_substream *substream,
311 314
312 writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL); 315 writel(ac_glbctrl, s3c_ac97.regs + S3C_AC97_GLBCTRL);
313 316
314 s3c2410_dma_ctrl(channel, S3C2410_DMAOP_STARTED); 317 s3c2410_dma_ctrl(dma_data->channel, S3C2410_DMAOP_STARTED);
315 318
316 return 0; 319 return 0;
317} 320}