diff options
Diffstat (limited to 'sound/soc/blackfin/bf5xx-ac97.c')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97.c | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index c0eba5109980..c5f856ec27ca 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c | |||
@@ -255,7 +255,7 @@ EXPORT_SYMBOL_GPL(soc_ac97_ops); | |||
255 | #ifdef CONFIG_PM | 255 | #ifdef CONFIG_PM |
256 | static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) | 256 | static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) |
257 | { | 257 | { |
258 | struct sport_device *sport = dai->private_data; | 258 | struct sport_device *sport = snd_soc_dai_get_drvdata(dai); |
259 | 259 | ||
260 | pr_debug("%s : sport %d\n", __func__, dai->id); | 260 | pr_debug("%s : sport %d\n", __func__, dai->id); |
261 | if (!dai->active) | 261 | if (!dai->active) |
@@ -270,7 +270,7 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) | |||
270 | static int bf5xx_ac97_resume(struct snd_soc_dai *dai) | 270 | static int bf5xx_ac97_resume(struct snd_soc_dai *dai) |
271 | { | 271 | { |
272 | int ret; | 272 | int ret; |
273 | struct sport_device *sport = dai->private_data; | 273 | struct sport_device *sport = snd_soc_dai_get_drvdata(dai); |
274 | 274 | ||
275 | pr_debug("%s : sport %d\n", __func__, dai->id); | 275 | pr_debug("%s : sport %d\n", __func__, dai->id); |
276 | if (!dai->active) | 276 | if (!dai->active) |
@@ -306,8 +306,7 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) | |||
306 | #define bf5xx_ac97_resume NULL | 306 | #define bf5xx_ac97_resume NULL |
307 | #endif | 307 | #endif |
308 | 308 | ||
309 | static int bf5xx_ac97_probe(struct platform_device *pdev, | 309 | static int bf5xx_ac97_probe(struct snd_soc_dai *dai) |
310 | struct snd_soc_dai *dai) | ||
311 | { | 310 | { |
312 | int ret = 0; | 311 | int ret = 0; |
313 | cmd_count = (int *)get_zeroed_page(GFP_KERNEL); | 312 | cmd_count = (int *)get_zeroed_page(GFP_KERNEL); |
@@ -379,8 +378,7 @@ peripheral_err: | |||
379 | return ret; | 378 | return ret; |
380 | } | 379 | } |
381 | 380 | ||
382 | static void bf5xx_ac97_remove(struct platform_device *pdev, | 381 | static int bf5xx_ac97_remove(struct snd_soc_dai *dai) |
383 | struct snd_soc_dai *dai) | ||
384 | { | 382 | { |
385 | free_page((unsigned long)cmd_count); | 383 | free_page((unsigned long)cmd_count); |
386 | cmd_count = NULL; | 384 | cmd_count = NULL; |
@@ -388,11 +386,10 @@ static void bf5xx_ac97_remove(struct platform_device *pdev, | |||
388 | #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET | 386 | #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET |
389 | gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM); | 387 | gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM); |
390 | #endif | 388 | #endif |
389 | return 0; | ||
391 | } | 390 | } |
392 | 391 | ||
393 | struct snd_soc_dai bfin_ac97_dai = { | 392 | struct snd_soc_dai_driver bfin_ac97_dai = { |
394 | .name = "bf5xx-ac97", | ||
395 | .id = 0, | ||
396 | .ac97_control = 1, | 393 | .ac97_control = 1, |
397 | .probe = bf5xx_ac97_probe, | 394 | .probe = bf5xx_ac97_probe, |
398 | .remove = bf5xx_ac97_remove, | 395 | .remove = bf5xx_ac97_remove, |
@@ -417,18 +414,40 @@ struct snd_soc_dai bfin_ac97_dai = { | |||
417 | }; | 414 | }; |
418 | EXPORT_SYMBOL_GPL(bfin_ac97_dai); | 415 | EXPORT_SYMBOL_GPL(bfin_ac97_dai); |
419 | 416 | ||
417 | static __devinit int asoc_bfin_ac97_probe(struct platform_device *pdev) | ||
418 | { | ||
419 | return snd_soc_register_dai(&pdev->dev, &bfin_ac97_dai); | ||
420 | } | ||
421 | |||
422 | static int __devexit asoc_bfin_ac97_remove(struct platform_device *pdev) | ||
423 | { | ||
424 | snd_soc_unregister_dai(&pdev->dev); | ||
425 | return 0; | ||
426 | } | ||
427 | |||
428 | static struct platform_driver asoc_bfin_ac97_driver = { | ||
429 | .driver = { | ||
430 | .name = "bfin-ac97", | ||
431 | .owner = THIS_MODULE, | ||
432 | }, | ||
433 | |||
434 | .probe = asoc_bfin_ac97_probe, | ||
435 | .remove = __devexit_p(asoc_bfin_ac97_remove), | ||
436 | }; | ||
437 | |||
420 | static int __init bfin_ac97_init(void) | 438 | static int __init bfin_ac97_init(void) |
421 | { | 439 | { |
422 | return snd_soc_register_dai(&bfin_ac97_dai); | 440 | return platform_driver_register(&asoc_bfin_ac97_driver); |
423 | } | 441 | } |
424 | module_init(bfin_ac97_init); | 442 | module_init(bfin_ac97_init); |
425 | 443 | ||
426 | static void __exit bfin_ac97_exit(void) | 444 | static void __exit bfin_ac97_exit(void) |
427 | { | 445 | { |
428 | snd_soc_unregister_dai(&bfin_ac97_dai); | 446 | platform_driver_unregister(&asoc_bfin_ac97_driver); |
429 | } | 447 | } |
430 | module_exit(bfin_ac97_exit); | 448 | module_exit(bfin_ac97_exit); |
431 | 449 | ||
450 | |||
432 | MODULE_AUTHOR("Roy Huang"); | 451 | MODULE_AUTHOR("Roy Huang"); |
433 | MODULE_DESCRIPTION("AC97 driver for ADI Blackfin"); | 452 | MODULE_DESCRIPTION("AC97 driver for ADI Blackfin"); |
434 | MODULE_LICENSE("GPL"); | 453 | MODULE_LICENSE("GPL"); |