diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-i2s-pcm.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-i2s-pcm.c | 44 |
1 files changed, 31 insertions, 13 deletions
diff --git a/sound/soc/blackfin/bf5xx-i2s-pcm.c b/sound/soc/blackfin/bf5xx-i2s-pcm.c index 1d2a1adf2575..890a0dccf902 100644 --- a/sound/soc/blackfin/bf5xx-i2s-pcm.c +++ b/sound/soc/blackfin/bf5xx-i2s-pcm.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <asm/dma.h> | 40 | #include <asm/dma.h> |
41 | 41 | ||
42 | #include "bf5xx-i2s-pcm.h" | 42 | #include "bf5xx-i2s-pcm.h" |
43 | #include "bf5xx-i2s.h" | ||
44 | #include "bf5xx-sport.h" | 43 | #include "bf5xx-sport.h" |
45 | 44 | ||
46 | static void bf5xx_dma_irq(void *data) | 45 | static void bf5xx_dma_irq(void *data) |
@@ -257,14 +256,14 @@ int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai, | |||
257 | if (!card->dev->coherent_dma_mask) | 256 | if (!card->dev->coherent_dma_mask) |
258 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); | 257 | card->dev->coherent_dma_mask = DMA_BIT_MASK(32); |
259 | 258 | ||
260 | if (dai->playback.channels_min) { | 259 | if (dai->driver->playback.channels_min) { |
261 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 260 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
262 | SNDRV_PCM_STREAM_PLAYBACK); | 261 | SNDRV_PCM_STREAM_PLAYBACK); |
263 | if (ret) | 262 | if (ret) |
264 | goto out; | 263 | goto out; |
265 | } | 264 | } |
266 | 265 | ||
267 | if (dai->capture.channels_min) { | 266 | if (dai->driver->capture.channels_min) { |
268 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, | 267 | ret = bf5xx_pcm_preallocate_dma_buffer(pcm, |
269 | SNDRV_PCM_STREAM_CAPTURE); | 268 | SNDRV_PCM_STREAM_CAPTURE); |
270 | if (ret) | 269 | if (ret) |
@@ -274,25 +273,44 @@ int bf5xx_pcm_i2s_new(struct snd_card *card, struct snd_soc_dai *dai, | |||
274 | return ret; | 273 | return ret; |
275 | } | 274 | } |
276 | 275 | ||
277 | struct snd_soc_platform bf5xx_i2s_soc_platform = { | 276 | static struct snd_soc_platform_driver bf5xx_i2s_soc_platform = { |
278 | .name = "bf5xx-audio", | 277 | .ops = &bf5xx_pcm_i2s_ops, |
279 | .pcm_ops = &bf5xx_pcm_i2s_ops, | ||
280 | .pcm_new = bf5xx_pcm_i2s_new, | 278 | .pcm_new = bf5xx_pcm_i2s_new, |
281 | .pcm_free = bf5xx_pcm_free_dma_buffers, | 279 | .pcm_free = bf5xx_pcm_free_dma_buffers, |
282 | }; | 280 | }; |
283 | EXPORT_SYMBOL_GPL(bf5xx_i2s_soc_platform); | ||
284 | 281 | ||
285 | static int __init bfin_i2s_init(void) | 282 | static int __devinit bfin_i2s_soc_platform_probe(struct platform_device *pdev) |
286 | { | 283 | { |
287 | return snd_soc_register_platform(&bf5xx_i2s_soc_platform); | 284 | return snd_soc_register_platform(&pdev->dev, &bf5xx_i2s_soc_platform); |
288 | } | 285 | } |
289 | module_init(bfin_i2s_init); | ||
290 | 286 | ||
291 | static void __exit bfin_i2s_exit(void) | 287 | static int __devexit bfin_i2s_soc_platform_remove(struct platform_device *pdev) |
292 | { | 288 | { |
293 | snd_soc_unregister_platform(&bf5xx_i2s_soc_platform); | 289 | snd_soc_unregister_platform(&pdev->dev); |
290 | return 0; | ||
291 | } | ||
292 | |||
293 | static struct platform_driver bfin_i2s_pcm_driver = { | ||
294 | .driver = { | ||
295 | .name = "bfin-pcm-audio", | ||
296 | .owner = THIS_MODULE, | ||
297 | }, | ||
298 | |||
299 | .probe = bfin_i2s_soc_platform_probe, | ||
300 | .remove = __devexit_p(bfin_i2s_soc_platform_remove), | ||
301 | }; | ||
302 | |||
303 | static int __init snd_bfin_i2s_pcm_init(void) | ||
304 | { | ||
305 | return platform_driver_register(&bfin_i2s_pcm_driver); | ||
306 | } | ||
307 | module_init(snd_bfin_i2s_pcm_init); | ||
308 | |||
309 | static void __exit snd_bfin_i2s_pcm_exit(void) | ||
310 | { | ||
311 | platform_driver_unregister(&bfin_i2s_pcm_driver); | ||
294 | } | 312 | } |
295 | module_exit(bfin_i2s_exit); | 313 | module_exit(snd_bfin_i2s_pcm_exit); |
296 | 314 | ||
297 | MODULE_AUTHOR("Cliff Cai"); | 315 | MODULE_AUTHOR("Cliff Cai"); |
298 | MODULE_DESCRIPTION("ADI Blackfin I2S PCM DMA module"); | 316 | MODULE_DESCRIPTION("ADI Blackfin I2S PCM DMA module"); |