diff options
author | Joachim Eastwood <joachim.eastwood@jotron.com> | 2011-12-31 20:14:24 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-01-20 08:58:25 -0500 |
commit | 6296914ccefe6efefee811436dd7cfad6545f2eb (patch) | |
tree | 9416880b5553cf4447e60c44bd40ba27357fc554 | |
parent | 3294c4c603a1c4ce00e5b8495e99dd3ba076f1e3 (diff) |
ASoC: use proper defines for stream directions in pcm engines
Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | sound/soc/fsl/fsl_dma.c | 10 | ||||
-rw-r--r-- | sound/soc/fsl/mpc5200_dma.c | 12 | ||||
-rw-r--r-- | sound/soc/s6000/s6000-pcm.c | 5 |
3 files changed, 14 insertions, 13 deletions
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index 4f59bbaba48..96bb92dd174 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c | |||
@@ -311,23 +311,23 @@ static int fsl_dma_new(struct snd_soc_pcm_runtime *rtd) | |||
311 | * should allocate a DMA buffer only for the streams that are valid. | 311 | * should allocate a DMA buffer only for the streams that are valid. |
312 | */ | 312 | */ |
313 | 313 | ||
314 | if (pcm->streams[0].substream) { | 314 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
315 | ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, | 315 | ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, |
316 | fsl_dma_hardware.buffer_bytes_max, | 316 | fsl_dma_hardware.buffer_bytes_max, |
317 | &pcm->streams[0].substream->dma_buffer); | 317 | &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); |
318 | if (ret) { | 318 | if (ret) { |
319 | dev_err(card->dev, "can't alloc playback dma buffer\n"); | 319 | dev_err(card->dev, "can't alloc playback dma buffer\n"); |
320 | return ret; | 320 | return ret; |
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
324 | if (pcm->streams[1].substream) { | 324 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
325 | ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, | 325 | ret = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, card->dev, |
326 | fsl_dma_hardware.buffer_bytes_max, | 326 | fsl_dma_hardware.buffer_bytes_max, |
327 | &pcm->streams[1].substream->dma_buffer); | 327 | &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer); |
328 | if (ret) { | 328 | if (ret) { |
329 | dev_err(card->dev, "can't alloc capture dma buffer\n"); | 329 | dev_err(card->dev, "can't alloc capture dma buffer\n"); |
330 | snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer); | 330 | snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); |
331 | return ret; | 331 | return ret; |
332 | } | 332 | } |
333 | } | 333 | } |
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index e7803d34c42..2112e224a4a 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c | |||
@@ -316,16 +316,16 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) | |||
316 | if (!card->dev->coherent_dma_mask) | 316 | if (!card->dev->coherent_dma_mask) |
317 | card->dev->coherent_dma_mask = 0xffffffff; | 317 | card->dev->coherent_dma_mask = 0xffffffff; |
318 | 318 | ||
319 | if (pcm->streams[0].substream) { | 319 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
320 | rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, | 320 | rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, |
321 | size, &pcm->streams[0].substream->dma_buffer); | 321 | size, &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); |
322 | if (rc) | 322 | if (rc) |
323 | goto playback_alloc_err; | 323 | goto playback_alloc_err; |
324 | } | 324 | } |
325 | 325 | ||
326 | if (pcm->streams[1].substream) { | 326 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
327 | rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, | 327 | rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, |
328 | size, &pcm->streams[1].substream->dma_buffer); | 328 | size, &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer); |
329 | if (rc) | 329 | if (rc) |
330 | goto capture_alloc_err; | 330 | goto capture_alloc_err; |
331 | } | 331 | } |
@@ -336,8 +336,8 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) | |||
336 | return 0; | 336 | return 0; |
337 | 337 | ||
338 | capture_alloc_err: | 338 | capture_alloc_err: |
339 | if (pcm->streams[0].substream) | 339 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) |
340 | snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer); | 340 | snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer); |
341 | 341 | ||
342 | playback_alloc_err: | 342 | playback_alloc_err: |
343 | dev_err(card->dev, "Cannot allocate buffer(s)\n"); | 343 | dev_err(card->dev, "Cannot allocate buffer(s)\n"); |
diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index 43c014f362f..716da861c62 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c | |||
@@ -435,7 +435,8 @@ static void s6000_pcm_free(struct snd_pcm *pcm) | |||
435 | { | 435 | { |
436 | struct snd_soc_pcm_runtime *runtime = pcm->private_data; | 436 | struct snd_soc_pcm_runtime *runtime = pcm->private_data; |
437 | struct s6000_pcm_dma_params *params = | 437 | struct s6000_pcm_dma_params *params = |
438 | snd_soc_dai_get_dma_data(runtime->cpu_dai, pcm->streams[0].substream); | 438 | snd_soc_dai_get_dma_data(runtime->cpu_dai, |
439 | pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); | ||
439 | 440 | ||
440 | free_irq(params->irq, pcm); | 441 | free_irq(params->irq, pcm); |
441 | snd_pcm_lib_preallocate_free_for_all(pcm); | 442 | snd_pcm_lib_preallocate_free_for_all(pcm); |
@@ -451,7 +452,7 @@ static int s6000_pcm_new(struct snd_soc_pcm_runtime *runtime) | |||
451 | int res; | 452 | int res; |
452 | 453 | ||
453 | params = snd_soc_dai_get_dma_data(runtime->cpu_dai, | 454 | params = snd_soc_dai_get_dma_data(runtime->cpu_dai, |
454 | pcm->streams[0].substream); | 455 | pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream); |
455 | 456 | ||
456 | if (!card->dev->dma_mask) | 457 | if (!card->dev->dma_mask) |
457 | card->dev->dma_mask = &s6000_pcm_dmamask; | 458 | card->dev->dma_mask = &s6000_pcm_dmamask; |