aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa/pxa2xx-ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa/pxa2xx-ac97.c')
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 11cd0f289c16..cf809049272a 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)
106static int pxa2xx_ac97_probe(struct platform_device *pdev, 106static 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
112static void pxa2xx_ac97_remove(struct platform_device *pdev, 112static 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
118static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, 118static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
@@ -230,15 +230,45 @@ struct snd_soc_dai pxa_ac97_dai[] = {
230EXPORT_SYMBOL_GPL(pxa_ac97_dai); 230EXPORT_SYMBOL_GPL(pxa_ac97_dai);
231EXPORT_SYMBOL_GPL(soc_ac97_ops); 231EXPORT_SYMBOL_GPL(soc_ac97_ops);
232 232
233static int __init pxa_ac97_init(void) 233static int __devinit pxa2xx_ac97_dev_probe(struct platform_device *pdev)
234{ 234{
235 int i;
236
237 for (i = 0; i < ARRAY_SIZE(pxa_ac97_dai); i++)
238 pxa_ac97_dai[i].dev = &pdev->dev;
239
240 /* Punt most of the init to the SoC probe; we may need the machine
241 * driver to do interesting things with the clocking to get us up
242 * and running.
243 */
235 return snd_soc_register_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); 244 return snd_soc_register_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai));
236} 245}
246
247static int __devexit pxa2xx_ac97_dev_remove(struct platform_device *pdev)
248{
249 snd_soc_unregister_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai));
250
251 return 0;
252}
253
254static struct platform_driver pxa2xx_ac97_driver = {
255 .probe = pxa2xx_ac97_dev_probe,
256 .remove = __devexit_p(pxa2xx_ac97_dev_remove),
257 .driver = {
258 .name = "pxa2xx-ac97",
259 .owner = THIS_MODULE,
260 },
261};
262
263static int __init pxa_ac97_init(void)
264{
265 return platform_driver_register(&pxa2xx_ac97_driver);
266}
237module_init(pxa_ac97_init); 267module_init(pxa_ac97_init);
238 268
239static void __exit pxa_ac97_exit(void) 269static void __exit pxa_ac97_exit(void)
240{ 270{
241 snd_soc_unregister_dais(pxa_ac97_dai, ARRAY_SIZE(pxa_ac97_dai)); 271 platform_driver_unregister(&pxa2xx_ac97_driver);
242} 272}
243module_exit(pxa_ac97_exit); 273module_exit(pxa_ac97_exit);
244 274