aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/fsl/mpc5200_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/fsl/mpc5200_dma.c')
-rw-r--r--sound/soc/fsl/mpc5200_dma.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c
index e7803d34c425..9a3f7c5ab687 100644
--- a/sound/soc/fsl/mpc5200_dma.c
+++ b/sound/soc/fsl/mpc5200_dma.c
@@ -8,6 +8,7 @@
8 8
9#include <linux/module.h> 9#include <linux/module.h>
10#include <linux/of_device.h> 10#include <linux/of_device.h>
11#include <linux/dma-mapping.h>
11#include <linux/slab.h> 12#include <linux/slab.h>
12#include <linux/of_platform.h> 13#include <linux/of_platform.h>
13 14
@@ -298,7 +299,7 @@ static struct snd_pcm_ops psc_dma_ops = {
298 .hw_params = psc_dma_hw_params, 299 .hw_params = psc_dma_hw_params,
299}; 300};
300 301
301static u64 psc_dma_dmamask = 0xffffffff; 302static u64 psc_dma_dmamask = DMA_BIT_MASK(32);
302static int psc_dma_new(struct snd_soc_pcm_runtime *rtd) 303static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
303{ 304{
304 struct snd_card *card = rtd->card->snd_card; 305 struct snd_card *card = rtd->card->snd_card;
@@ -314,18 +315,18 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
314 if (!card->dev->dma_mask) 315 if (!card->dev->dma_mask)
315 card->dev->dma_mask = &psc_dma_dmamask; 316 card->dev->dma_mask = &psc_dma_dmamask;
316 if (!card->dev->coherent_dma_mask) 317 if (!card->dev->coherent_dma_mask)
317 card->dev->coherent_dma_mask = 0xffffffff; 318 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
318 319
319 if (pcm->streams[0].substream) { 320 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
320 rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, 321 rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
321 size, &pcm->streams[0].substream->dma_buffer); 322 size, &pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer);
322 if (rc) 323 if (rc)
323 goto playback_alloc_err; 324 goto playback_alloc_err;
324 } 325 }
325 326
326 if (pcm->streams[1].substream) { 327 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
327 rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev, 328 rc = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, pcm->card->dev,
328 size, &pcm->streams[1].substream->dma_buffer); 329 size, &pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->dma_buffer);
329 if (rc) 330 if (rc)
330 goto capture_alloc_err; 331 goto capture_alloc_err;
331 } 332 }
@@ -336,8 +337,8 @@ static int psc_dma_new(struct snd_soc_pcm_runtime *rtd)
336 return 0; 337 return 0;
337 338
338 capture_alloc_err: 339 capture_alloc_err:
339 if (pcm->streams[0].substream) 340 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)
340 snd_dma_free_pages(&pcm->streams[0].substream->dma_buffer); 341 snd_dma_free_pages(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->dma_buffer);
341 342
342 playback_alloc_err: 343 playback_alloc_err:
343 dev_err(card->dev, "Cannot allocate buffer(s)\n"); 344 dev_err(card->dev, "Cannot allocate buffer(s)\n");