aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/omap/omap-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/omap/omap-pcm.c')
-rw-r--r--sound/soc/omap/omap-pcm.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c
index 6ede7dc6c10a..a59bd352d342 100644
--- a/sound/soc/omap/omap-pcm.c
+++ b/sound/soc/omap/omap-pcm.c
@@ -378,7 +378,6 @@ static void omap_pcm_free_dma_buffers(struct snd_pcm *pcm)
378static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd) 378static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
379{ 379{
380 struct snd_card *card = rtd->card->snd_card; 380 struct snd_card *card = rtd->card->snd_card;
381 struct snd_soc_dai *dai = rtd->cpu_dai;
382 struct snd_pcm *pcm = rtd->pcm; 381 struct snd_pcm *pcm = rtd->pcm;
383 int ret = 0; 382 int ret = 0;
384 383
@@ -387,14 +386,14 @@ static int omap_pcm_new(struct snd_soc_pcm_runtime *rtd)
387 if (!card->dev->coherent_dma_mask) 386 if (!card->dev->coherent_dma_mask)
388 card->dev->coherent_dma_mask = DMA_BIT_MASK(64); 387 card->dev->coherent_dma_mask = DMA_BIT_MASK(64);
389 388
390 if (dai->driver->playback.channels_min) { 389 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
391 ret = omap_pcm_preallocate_dma_buffer(pcm, 390 ret = omap_pcm_preallocate_dma_buffer(pcm,
392 SNDRV_PCM_STREAM_PLAYBACK); 391 SNDRV_PCM_STREAM_PLAYBACK);
393 if (ret) 392 if (ret)
394 goto out; 393 goto out;
395 } 394 }
396 395
397 if (dai->driver->capture.channels_min) { 396 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
398 ret = omap_pcm_preallocate_dma_buffer(pcm, 397 ret = omap_pcm_preallocate_dma_buffer(pcm,
399 SNDRV_PCM_STREAM_CAPTURE); 398 SNDRV_PCM_STREAM_CAPTURE);
400 if (ret) 399 if (ret)
@@ -433,17 +432,7 @@ static struct platform_driver omap_pcm_driver = {
433 .remove = __devexit_p(omap_pcm_remove), 432 .remove = __devexit_p(omap_pcm_remove),
434}; 433};
435 434
436static int __init snd_omap_pcm_init(void) 435module_platform_driver(omap_pcm_driver);
437{
438 return platform_driver_register(&omap_pcm_driver);
439}
440module_init(snd_omap_pcm_init);
441
442static void __exit snd_omap_pcm_exit(void)
443{
444 platform_driver_unregister(&omap_pcm_driver);
445}
446module_exit(snd_omap_pcm_exit);
447 436
448MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@bitmer.com>"); 437MODULE_AUTHOR("Jarkko Nikula <jarkko.nikula@bitmer.com>");
449MODULE_DESCRIPTION("OMAP PCM DMA module"); 438MODULE_DESCRIPTION("OMAP PCM DMA module");