diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-tdm-pcm.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-tdm-pcm.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index c95cc03d583d..254490cf1876 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c | |||
@@ -286,7 +286,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32); | |||
286 | static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) | 286 | static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) |
287 | { | 287 | { |
288 | struct snd_card *card = rtd->card->snd_card; | 288 | struct snd_card *card = rtd->card->snd_card; |
289 | struct snd_soc_dai *dai = rtd->cpu_dai; | ||
290 | struct snd_pcm *pcm = rtd->pcm; | 289 | struct snd_pcm *pcm = rtd->pcm; |
291 | int ret = 0; | 290 | int ret = 0; |
292 | 291 | ||
@@ -295,14 +294,14 @@ static int bf5xx_pcm_tdm_new(struct snd_soc_pcm_runtime *rtd) | |||
295 | if (!card->dev->coherent_dma_mask) | 294 | if (!card->dev->coherent_dma_mask) |
296 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 295 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
297 | 296 | ||
298 | if (dai->driver->playback.channels_min) { | 297 | if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) { |
299 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 298 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
300 | SNDRV_PCM_STREAM_PLAYBACK); | 299 | SNDRV_PCM_STREAM_PLAYBACK); |
301 | if (ret) | 300 | if (ret) |
302 | goto out; | 301 | goto out; |
303 | } | 302 | } |
304 | 303 | ||
305 | if (dai->driver->capture.channels_min) { | 304 | if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) { |
306 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 305 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
307 | SNDRV_PCM_STREAM_CAPTURE); | 306 | SNDRV_PCM_STREAM_CAPTURE); |
308 | if (ret) | 307 | if (ret) |
@@ -339,17 +338,7 @@ static struct platform_driver bfin_tdm_driver = { | |||
339 | .remove = __devexit_p(bf5xx_soc_platform_remove), | 338 | .remove = __devexit_p(bf5xx_soc_platform_remove), |
340 | }; | 339 | }; |
341 | 340 | ||
342 | static int __init snd_bfin_tdm_init(void) | 341 | module_platform_driver(bfin_tdm_driver); |
343 | { | ||
344 | return platform_driver_register(&bfin_tdm_driver); | ||
345 | } | ||
346 | module_init(snd_bfin_tdm_init); | ||
347 | |||
348 | static void __exit snd_bfin_tdm_exit(void) | ||
349 | { | ||
350 | platform_driver_unregister(&bfin_tdm_driver); | ||
351 | } | ||
352 | module_exit(snd_bfin_tdm_exit); | ||
353 | 342 | ||
354 | MODULE_AUTHOR("Barry Song"); | 343 | MODULE_AUTHOR("Barry Song"); |
355 | MODULE_DESCRIPTION("ADI Blackfin TDM PCM DMA module"); | 344 | MODULE_DESCRIPTION("ADI Blackfin TDM PCM DMA module"); |