X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=sound%2Fsoc%2Fblackfin%2Fbf5xx-ac97.c;fp=sound%2Fsoc%2Fblackfin%2Fbf5xx-ac97.c;h=ffbac26b9bce5882e662e3dfc1a7a26081cbf91d;hb=f2ec334db8d14ae3ec2e4bf8d974f75b8f772e26;hp=c0eba51099804fcebc40ee13d5b495b3106448f2;hpb=81e20d4d8d0317ecf1c7d193a52ab26cf74e1737;p=mv-sheeva.git diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index c0eba510998..ffbac26b9bc 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c @@ -255,14 +255,14 @@ EXPORT_SYMBOL_GPL(soc_ac97_ops); #ifdef CONFIG_PM static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) { - struct sport_device *sport = dai->private_data; + struct sport_device *sport = snd_soc_dai_get_drvdata(dai); pr_debug("%s : sport %d\n", __func__, dai->id); if (!dai->active) return 0; - if (dai->capture.active) + if (dai->capture_active) sport_rx_stop(sport); - if (dai->playback.active) + if (dai->playback_active) sport_tx_stop(sport); return 0; } @@ -270,7 +270,7 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) static int bf5xx_ac97_resume(struct snd_soc_dai *dai) { int ret; - struct sport_device *sport = dai->private_data; + struct sport_device *sport = snd_soc_dai_get_drvdata(dai); pr_debug("%s : sport %d\n", __func__, dai->id); if (!dai->active) @@ -306,8 +306,7 @@ static int bf5xx_ac97_resume(struct snd_soc_dai *dai) #define bf5xx_ac97_resume NULL #endif -static int bf5xx_ac97_probe(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int bf5xx_ac97_probe(struct snd_soc_dai *dai) { int ret = 0; cmd_count = (int *)get_zeroed_page(GFP_KERNEL); @@ -379,8 +378,7 @@ peripheral_err: return ret; } -static void bf5xx_ac97_remove(struct platform_device *pdev, - struct snd_soc_dai *dai) +static int bf5xx_ac97_remove(struct snd_soc_dai *dai) { free_page((unsigned long)cmd_count); cmd_count = NULL; @@ -388,11 +386,10 @@ static void bf5xx_ac97_remove(struct platform_device *pdev, #ifdef CONFIG_SND_BF5XX_HAVE_COLD_RESET gpio_free(CONFIG_SND_BF5XX_RESET_GPIO_NUM); #endif + return 0; } -struct snd_soc_dai bfin_ac97_dai = { - .name = "bf5xx-ac97", - .id = 0, +struct snd_soc_dai_driver bfin_ac97_dai = { .ac97_control = 1, .probe = bf5xx_ac97_probe, .remove = bf5xx_ac97_remove, @@ -417,18 +414,40 @@ struct snd_soc_dai bfin_ac97_dai = { }; EXPORT_SYMBOL_GPL(bfin_ac97_dai); +static __devinit int asoc_bfin_ac97_probe(struct platform_device *pdev) +{ + return snd_soc_register_dai(&pdev->dev, &bfin_ac97_dai); +} + +static int __devexit asoc_bfin_ac97_remove(struct platform_device *pdev) +{ + snd_soc_unregister_dai(&pdev->dev); + return 0; +} + +static struct platform_driver asoc_bfin_ac97_driver = { + .driver = { + .name = "bfin-ac97", + .owner = THIS_MODULE, + }, + + .probe = asoc_bfin_ac97_probe, + .remove = __devexit_p(asoc_bfin_ac97_remove), +}; + static int __init bfin_ac97_init(void) { - return snd_soc_register_dai(&bfin_ac97_dai); + return platform_driver_register(&asoc_bfin_ac97_driver); } module_init(bfin_ac97_init); static void __exit bfin_ac97_exit(void) { - snd_soc_unregister_dai(&bfin_ac97_dai); + platform_driver_unregister(&asoc_bfin_ac97_driver); } module_exit(bfin_ac97_exit); + MODULE_AUTHOR("Roy Huang"); MODULE_DESCRIPTION("AC97 driver for ADI Blackfin"); MODULE_LICENSE("GPL");