diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-09 14:18:33 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-09 14:19:01 -0400 |
commit | 6b849bcff0004aa5dd216b4d3eb56f51c9df8a72 (patch) | |
tree | 64fe72cb24e9ffdb1f88926b446066aa45ad7a68 /sound | |
parent | a381934e5f9c0c3c292d780d61f5be9c22b2ef54 (diff) |
ASoC: Convert PXA AC97 driver to probe with the platform device
This will break any boards that don't register the AC97 controller
device due to using ASoC.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/pxa/pxa2xx-ac97.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 812c2b4d3e07..49a2810ca58c 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -106,13 +106,13 @@ static int pxa2xx_ac97_resume(struct snd_soc_dai *dai) | |||
106 | static int pxa2xx_ac97_probe(struct platform_device *pdev, | 106 | static int pxa2xx_ac97_probe(struct platform_device *pdev, |
107 | struct snd_soc_dai *dai) | 107 | struct snd_soc_dai *dai) |
108 | { | 108 | { |
109 | return pxa2xx_ac97_hw_probe(pdev); | 109 | return pxa2xx_ac97_hw_probe(to_platform_device(dai->dev)); |
110 | } | 110 | } |
111 | 111 | ||
112 | static void pxa2xx_ac97_remove(struct platform_device *pdev, | 112 | static void pxa2xx_ac97_remove(struct platform_device *pdev, |
113 | struct snd_soc_dai *dai) | 113 | struct snd_soc_dai *dai) |
114 | { | 114 | { |
115 | pxa2xx_ac97_hw_remove(pdev); | 115 | pxa2xx_ac97_hw_remove(to_platform_device(dai->dev)); |
116 | } | 116 | } |
117 | 117 | ||
118 | static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, | 118 | static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, |
@@ -229,15 +229,45 @@ struct snd_soc_dai pxa_ac97_dai[] = { | |||
229 | EXPORT_SYMBOL_GPL(pxa_ac97_dai); | 229 | EXPORT_SYMBOL_GPL(pxa_ac97_dai); |
230 | EXPORT_SYMBOL_GPL(soc_ac97_ops); | 230 | EXPORT_SYMBOL_GPL(soc_ac97_ops); |
231 | 231 | ||
232 | static int __init pxa_ac97_init(void) | 232 | static int __devinit pxa2xx_ac97_dev_probe(struct platform_device *pdev) |
233 | { | 233 | { |
234 | int i; | ||
235 | |||
236 | for (i = 0; i < ARRAY_SIZE(pxa_ac97_dai); i++) | ||
237 | pxa_ac97_dai[i].dev = &pdev->dev; | ||
238 | |||
239 | /* Punt most of the init to the SoC probe; we may need the machine | ||
240 | * driver to do interesting things with the clocking to get us up | ||
241 | * and running. | ||
242 | */ | ||
234 | return snd_soc_register_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); | 243 | return snd_soc_register_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); |
235 | } | 244 | } |
245 | |||
246 | static int __devexit pxa2xx_ac97_dev_remove(struct platform_device *pdev) | ||
247 | { | ||
248 | snd_soc_unregister_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); | ||
249 | |||
250 | return 0; | ||
251 | } | ||
252 | |||
253 | static struct platform_driver pxa2xx_ac97_driver = { | ||
254 | .probe = pxa2xx_ac97_dev_probe, | ||
255 | .remove = __devexit_p(pxa2xx_ac97_dev_remove), | ||
256 | .driver = { | ||
257 | .name = "pxa2xx-ac97", | ||
258 | .owner = THIS_MODULE, | ||
259 | }, | ||
260 | }; | ||
261 | |||
262 | static int __init pxa_ac97_init(void) | ||
263 | { | ||
264 | return platform_driver_register(&pxa2xx_ac97_driver); | ||
265 | } | ||
236 | module_init(pxa_ac97_init); | 266 | module_init(pxa_ac97_init); |
237 | 267 | ||
238 | static void __exit pxa_ac97_exit(void) | 268 | static void __exit pxa_ac97_exit(void) |
239 | { | 269 | { |
240 | snd_soc_unregister_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); | 270 | platform_driver_unregister(&pxa2xx_ac97_driver); |
241 | } | 271 | } |
242 | module_exit(pxa_ac97_exit); | 272 | module_exit(pxa_ac97_exit); |
243 | 273 | ||