aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-i2s-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-i2s-pcm.c')
-rw-r--r--sound/soc/blackfin/bf5xx-i2s-pcm.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c
index 7565e1576ff..63205d723ea 100644
--- a/sound/soc/blackfin/bf5xx-i2s-pcm.c
+++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c
@@ -260,7 +260,6 @@ static u64 bf5xx_pcm_dmamask = DMA_BIT_MASK(32);
260static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd) 260static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd)
261{ 261{
262 struct snd_card *card = rtd->card->snd_card; 262 struct snd_card *card = rtd->card->snd_card;
263 struct snd_soc_dai *dai = rtd->cpu_dai;
264 struct snd_pcm *pcm = rtd->pcm; 263 struct snd_pcm *pcm = rtd->pcm;
265 int ret = 0; 264 int ret = 0;
266 265
@@ -270,14 +269,14 @@ static int bf5xx_pcm_i2s_new(struct snd_soc_pcm_runtime *rtd)
270 if (!card->dev->coherent_dma_mask) 269 if (!card->dev->coherent_dma_mask)
271 card->dev->coherent_dma_mask = DMA_BIT_MASK(32); 270 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
272 271
273 if (dai->driver->playback.channels_min) { 272 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) {
274 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 273 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
275 SNDRV_PCM_STREAM_PLAYBACK); 274 SNDRV_PCM_STREAM_PLAYBACK);
276 if (ret) 275 if (ret)
277 goto out; 276 goto out;
278 } 277 }
279 278
280 if (dai->driver->capture.channels_min) { 279 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) {
281 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 280 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
282 SNDRV_PCM_STREAM_CAPTURE); 281 SNDRV_PCM_STREAM_CAPTURE);
283 if (ret) 282 if (ret)
@@ -314,17 +313,7 @@ static struct platform_driver bfin_i2s_pcm_driver = {
314 .remove = __devexit_p(bfin_i2s_soc_platform_remove), 313 .remove = __devexit_p(bfin_i2s_soc_platform_remove),
315}; 314};
316 315
317static int __init snd_bfin_i2s_pcm_init(void) 316module_platform_driver(bfin_i2s_pcm_driver);
318{
319 return platform_driver_register(&bfin_i2s_pcm_driver);
320}
321module_init(snd_bfin_i2s_pcm_init);
322
323static void __exit snd_bfin_i2s_pcm_exit(void)
324{
325 platform_driver_unregister(&bfin_i2s_pcm_driver);
326}
327module_exit(snd_bfin_i2s_pcm_exit);
328 317
329MODULE_AUTHOR("Cliff Cai"); 318MODULE_AUTHOR("Cliff Cai");
330MODULE_DESCRIPTION("ADI Blackfin I2S PCM DMA module"); 319MODULE_DESCRIPTION("ADI Blackfin I2S PCM DMA module");