aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung/dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/samsung/dma.c')
-rw-r--r--sound/soc/samsung/dma.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index a68b26441784..427ae0d9817b 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -403,7 +403,6 @@ static u64 dma_mask = DMA_BIT_MASK(32);
403static int dma_new(struct snd_soc_pcm_runtime *rtd) 403static int dma_new(struct snd_soc_pcm_runtime *rtd)
404{ 404{
405 struct snd_card *card = rtd->card->snd_card; 405 struct snd_card *card = rtd->card->snd_card;
406 struct snd_soc_dai *dai = rtd->cpu_dai;
407 struct snd_pcm *pcm = rtd->pcm; 406 struct snd_pcm *pcm = rtd->pcm;
408 int ret = 0; 407 int ret = 0;
409 408
@@ -414,14 +413,14 @@ static int dma_new(struct snd_soc_pcm_runtime *rtd)
414 if (!card->dev->coherent_dma_mask) 413 if (!card->dev->coherent_dma_mask)
415 card->dev->coherent_dma_mask = 0xffffffff; 414 card->dev->coherent_dma_mask = 0xffffffff;
416 415
417 if (dai->driver->playback.channels_min) { 416 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
418 ret = preallocate_dma_buffer(pcm, 417 ret = preallocate_dma_buffer(pcm,
419 SNDRV_PCM_STREAM_PLAYBACK); 418 SNDRV_PCM_STREAM_PLAYBACK);
420 if (ret) 419 if (ret)
421 goto out; 420 goto out;
422 } 421 }
423 422
424 if (dai->driver->capture.channels_min) { 423 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
425 ret = preallocate_dma_buffer(pcm, 424 ret = preallocate_dma_buffer(pcm,
426 SNDRV_PCM_STREAM_CAPTURE); 425 SNDRV_PCM_STREAM_CAPTURE);
427 if (ret) 426 if (ret)
@@ -458,17 +457,7 @@ static struct platform_driver asoc_dma_driver = {
458 .remove = __devexit_p(samsung_asoc_platform_remove), 457 .remove = __devexit_p(samsung_asoc_platform_remove),
459}; 458};
460 459
461static int __init samsung_asoc_init(void) 460module_platform_driver(asoc_dma_driver);
462{
463 return platform_driver_register(&asoc_dma_driver);
464}
465module_init(samsung_asoc_init);
466
467static void __exit samsung_asoc_exit(void)
468{
469 platform_driver_unregister(&asoc_dma_driver);
470}
471module_exit(samsung_asoc_exit);
472 461
473MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); 462MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
474MODULE_DESCRIPTION("Samsung ASoC DMA Driver"); 463MODULE_DESCRIPTION("Samsung ASoC DMA Driver");