diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-tdm-pcm.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-tdm-pcm.c | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/sound/soc/blackfin/bf5xx-tdm-pcm.c b/sound/soc/blackfin/bf5xx-tdm-pcm.c index 6bac1ac1a315..74cf759b78a6 100644 --- a/sound/soc/blackfin/bf5xx-tdm-pcm.c +++ b/sound/soc/blackfin/bf5xx-tdm-pcm.c | |||
@@ -290,14 +290,14 @@ static int bf5xx_pcm_tdm_new(struct snd_card *card, struct snd_soc_dai *dai, | |||
290 | if (!card->dev->coherent_dma_mask) | 290 | if (!card->dev->coherent_dma_mask) |
291 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 291 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
292 | 292 | ||
293 | if (dai->playback.channels_min) { | 293 | if (dai->driver->playback.channels_min) { |
294 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 294 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
295 | SNDRV_PCM_STREAM_PLAYBACK); | 295 | SNDRV_PCM_STREAM_PLAYBACK); |
296 | if (ret) | 296 | if (ret) |
297 | goto out; | 297 | goto out; |
298 | } | 298 | } |
299 | 299 | ||
300 | if (dai->capture.channels_min) { | 300 | if (dai->driver->capture.channels_min) { |
301 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 301 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
302 | SNDRV_PCM_STREAM_CAPTURE); | 302 | SNDRV_PCM_STREAM_CAPTURE); |
303 | if (ret) | 303 | if (ret) |
@@ -307,25 +307,44 @@ out: | |||
307 | return ret; | 307 | return ret; |
308 | } | 308 | } |
309 | 309 | ||
310 | struct snd_soc_platform bf5xx_tdm_soc_platform = { | 310 | static struct snd_soc_platform_driver bf5xx_tdm_soc_platform = { |
311 | .name = "bf5xx-audio", | 311 | .ops = &bf5xx_pcm_tdm_ops, |
312 | .pcm_ops = &bf5xx_pcm_tdm_ops, | ||
313 | .pcm_new = bf5xx_pcm_tdm_new, | 312 | .pcm_new = bf5xx_pcm_tdm_new, |
314 | .pcm_free = bf5xx_pcm_free_dma_buffers, | 313 | .pcm_free = bf5xx_pcm_free_dma_buffers, |
315 | }; | 314 | }; |
316 | EXPORT_SYMBOL_GPL(bf5xx_tdm_soc_platform); | ||
317 | 315 | ||
318 | static int __init bfin_pcm_tdm_init(void) | 316 | static int __devinit bf5xx_soc_platform_probe(struct platform_device *pdev) |
319 | { | 317 | { |
320 | return snd_soc_register_platform(&bf5xx_tdm_soc_platform); | 318 | return snd_soc_register_platform(&pdev->dev, &bf5xx_tdm_soc_platform); |
321 | } | 319 | } |
322 | module_init(bfin_pcm_tdm_init); | ||
323 | 320 | ||
324 | static void __exit bfin_pcm_tdm_exit(void) | 321 | static int __devexit bf5xx_soc_platform_remove(struct platform_device *pdev) |
325 | { | 322 | { |
326 | snd_soc_unregister_platform(&bf5xx_tdm_soc_platform); | 323 | snd_soc_unregister_platform(&pdev->dev); |
324 | return 0; | ||
325 | } | ||
326 | |||
327 | static struct platform_driver bfin_tdm_driver = { | ||
328 | .driver = { | ||
329 | .name = "bf5xx-tdm-pcm-audio", | ||
330 | .owner = THIS_MODULE, | ||
331 | }, | ||
332 | |||
333 | .probe = bf5xx_soc_platform_probe, | ||
334 | .remove = __devexit_p(bf5xx_soc_platform_remove), | ||
335 | }; | ||
336 | |||
337 | static int __init snd_bfin_tdm_init(void) | ||
338 | { | ||
339 | return platform_driver_register(&bfin_tdm_driver); | ||
340 | } | ||
341 | module_init(snd_bfin_tdm_init); | ||
342 | |||
343 | static void __exit snd_bfin_tdm_exit(void) | ||
344 | { | ||
345 | platform_driver_unregister(&bfin_tdm_driver); | ||
327 | } | 346 | } |
328 | module_exit(bfin_pcm_tdm_exit); | 347 | module_exit(snd_bfin_tdm_exit); |
329 | 348 | ||
330 | MODULE_AUTHOR("Barry Song"); | 349 | MODULE_AUTHOR("Barry Song"); |
331 | MODULE_DESCRIPTION("ADI Blackfin TDM PCM DMA module"); | 350 | MODULE_DESCRIPTION("ADI Blackfin TDM PCM DMA module"); |