diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:36:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-24 11:36:41 -0400 |
commit | 6ae85d6db4871d8dbcb5cc0e9056f97f1ca07061 (patch) | |
tree | d0a6fa2e4fcef36a4c80990a361c0d5fbe091c35 /sound/soc/pxa | |
parent | d72cd3a90e4d6725b62919139e2ab7bd926fa16d (diff) | |
parent | fdd8b079e33d4711527ace19798e9db99a056469 (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-arm
* master.kernel.org:/home/rmk/linux-2.6-arm:
[ARM] 5460/1: Orion: reduce namespace pollution
[ARM] 5458/1: pcmcia: pxa2xx-sharpsl: check if we do have Scoop config
[ARM] 5457/1: mach-imx gpio buildfix
[ARM] 5456/1: add sys_preadv and sys_pwritev
[ARM] pxa/pcm990: start external GPIOs immediately after built-in ones
[ARM] pxa/palm27x: General fix for Palm27x aSoC driver
[ARM] pxa/mioa701: use GPIO95 as AC97 reset line
[ARM] pxa: merge AC97 platform data structures
[ARM] pxa/magician: remove un-necessary #include of pxa-regs.h and hardware.h
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); |