diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-05 05:12:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-05-05 05:12:55 -0400 |
commit | f3831a592fe4332a70baad64a860b345398885b7 (patch) | |
tree | fd27b986295fe5a4f1c0924a804228f829a4c894 /sound/soc/pxa | |
parent | 376f7839b72ec526173cafb5d8eadfc61e2effdf (diff) | |
parent | 8560b9321f9050968f393ce1ec67e47c1a0bd5cf (diff) |
Merge commit 'takashi/topic/asoc' into for-2.6.31
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r-- | sound/soc/pxa/palm27x.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 48a73f64500b..44fcc4e01e08 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c | |||
@@ -200,7 +200,7 @@ static struct snd_soc_device palm27x_snd_devdata = { | |||
200 | 200 | ||
201 | static struct platform_device *palm27x_snd_device; | 201 | static struct platform_device *palm27x_snd_device; |
202 | 202 | ||
203 | static int __init palm27x_asoc_init(void) | 203 | static int palm27x_asoc_probe(struct platform_device *pdev) |
204 | { | 204 | { |
205 | int ret; | 205 | int ret; |
206 | 206 | ||
@@ -208,6 +208,10 @@ static int __init palm27x_asoc_init(void) | |||
208 | machine_is_palmld())) | 208 | machine_is_palmld())) |
209 | return -ENODEV; | 209 | return -ENODEV; |
210 | 210 | ||
211 | if (pdev->dev.platform_data) | ||
212 | palm27x_ep_gpio = ((struct palm27x_asoc_info *) | ||
213 | (pdev->dev.platform_data))->jack_gpio; | ||
214 | |||
211 | ret = gpio_request(palm27x_ep_gpio, "Headphone Jack"); | 215 | ret = gpio_request(palm27x_ep_gpio, "Headphone Jack"); |
212 | if (ret) | 216 | if (ret) |
213 | return ret; | 217 | return ret; |
@@ -245,16 +249,31 @@ err_alloc: | |||
245 | return ret; | 249 | return ret; |
246 | } | 250 | } |
247 | 251 | ||
248 | static void __exit palm27x_asoc_exit(void) | 252 | static int __devexit palm27x_asoc_remove(struct platform_device *pdev) |
249 | { | 253 | { |
250 | free_irq(gpio_to_irq(palm27x_ep_gpio), NULL); | 254 | free_irq(gpio_to_irq(palm27x_ep_gpio), NULL); |
251 | gpio_free(palm27x_ep_gpio); | 255 | gpio_free(palm27x_ep_gpio); |
252 | platform_device_unregister(palm27x_snd_device); | 256 | platform_device_unregister(palm27x_snd_device); |
257 | return 0; | ||
253 | } | 258 | } |
254 | 259 | ||
255 | void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) | 260 | static struct platform_driver palm27x_wm9712_driver = { |
261 | .probe = palm27x_asoc_probe, | ||
262 | .remove = __devexit_p(palm27x_asoc_remove), | ||
263 | .driver = { | ||
264 | .name = "palm27x-asoc", | ||
265 | .owner = THIS_MODULE, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static int __init palm27x_asoc_init(void) | ||
270 | { | ||
271 | return platform_driver_register(&palm27x_wm9712_driver); | ||
272 | } | ||
273 | |||
274 | static void __exit palm27x_asoc_exit(void) | ||
256 | { | 275 | { |
257 | palm27x_ep_gpio = data->jack_gpio; | 276 | platform_driver_unregister(&palm27x_wm9712_driver); |
258 | } | 277 | } |
259 | 278 | ||
260 | module_init(palm27x_asoc_init); | 279 | module_init(palm27x_asoc_init); |