aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/blackfin/bf5xx-ac97-pcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ac97-pcm.c')
-rw-r--r--sound/soc/blackfin/bf5xx-ac97-pcm.c43
1 files changed, 31 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97-pcm.c b/sound/soc/blackfin/bf5xx-ac97-pcm.c
index 5e7aacf3bb5a..5a2fd8abaefa 100644
--- a/sound/soc/blackfin/bf5xx-ac97-pcm.c
+++ b/sound/soc/blackfin/bf5xx-ac97-pcm.c
@@ -422,14 +422,14 @@ int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai,
422 if (!card->dev->coherent_dma_mask) 422 if (!card->dev->coherent_dma_mask)
423 card->dev->coherent_dma_mask = DMA_BIT_MASK(32); 423 card->dev->coherent_dma_mask = DMA_BIT_MASK(32);
424 424
425 if (dai->playback.channels_min) { 425 if (dai->driver->playback.channels_min) {
426 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 426 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
427 SNDRV_PCM_STREAM_PLAYBACK); 427 SNDRV_PCM_STREAM_PLAYBACK);
428 if (ret) 428 if (ret)
429 goto out; 429 goto out;
430 } 430 }
431 431
432 if (dai->capture.channels_min) { 432 if (dai->driver->capture.channels_min) {
433 ret = bf5xx_pcm_preallocate_dma_buffer(pcm, 433 ret = bf5xx_pcm_preallocate_dma_buffer(pcm,
434 SNDRV_PCM_STREAM_CAPTURE); 434 SNDRV_PCM_STREAM_CAPTURE);
435 if (ret) 435 if (ret)
@@ -439,25 +439,44 @@ int bf5xx_pcm_ac97_new(struct snd_card *card, struct snd_soc_dai *dai,
439 return ret; 439 return ret;
440} 440}
441 441
442struct snd_soc_platform bf5xx_ac97_soc_platform = { 442static struct snd_soc_platform_driver bf5xx_ac97_soc_platform = {
443 .name = "bf5xx-audio", 443 .ops = &bf5xx_pcm_ac97_ops,
444 .pcm_ops = &bf5xx_pcm_ac97_ops,
445 .pcm_new = bf5xx_pcm_ac97_new, 444 .pcm_new = bf5xx_pcm_ac97_new,
446 .pcm_free = bf5xx_pcm_free_dma_buffers, 445 .pcm_free = bf5xx_pcm_free_dma_buffers,
447}; 446};
448EXPORT_SYMBOL_GPL(bf5xx_ac97_soc_platform);
449 447
450static int __init bfin_ac97_init(void) 448static int __devinit bf5xx_soc_platform_probe(struct platform_device *pdev)
451{ 449{
452 return snd_soc_register_platform(&bf5xx_ac97_soc_platform); 450 return snd_soc_register_platform(&pdev->dev, &bf5xx_ac97_soc_platform);
453} 451}
454module_init(bfin_ac97_init);
455 452
456static void __exit bfin_ac97_exit(void) 453static int __devexit bf5xx_soc_platform_remove(struct platform_device *pdev)
457{ 454{
458 snd_soc_unregister_platform(&bf5xx_ac97_soc_platform); 455 snd_soc_unregister_platform(&pdev->dev);
456 return 0;
457}
458
459static struct platform_driver bf5xx_pcm_driver = {
460 .driver = {
461 .name = "bf5xx-pcm-audio",
462 .owner = THIS_MODULE,
463 },
464
465 .probe = bf5xx_soc_platform_probe,
466 .remove = __devexit_p(bf5xx_soc_platform_remove),
467};
468
469static int __init snd_bf5xx_pcm_init(void)
470{
471 return platform_driver_register(&bf5xx_pcm_driver);
472}
473module_init(snd_bf5xx_pcm_init);
474
475static void __exit snd_bf5xx_pcm_exit(void)
476{
477 platform_driver_unregister(&bf5xx_pcm_driver);
459} 478}
460module_exit(bfin_ac97_exit); 479module_exit(snd_bf5xx_pcm_exit);
461 480
462MODULE_AUTHOR("Cliff Cai"); 481MODULE_AUTHOR("Cliff Cai");
463MODULE_DESCRIPTION("ADI Blackfin AC97 PCM DMA module"); 482MODULE_DESCRIPTION("ADI Blackfin AC97 PCM DMA module");