diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:13 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-07 05:17:34 -0400 |
commit | 44347d947f628060b92449702071bfe1d31dfb75 (patch) | |
tree | c6ed74610d5b3295df4296659f80f5feb94b28cc /sound/soc/pxa/palm27x.c | |
parent | d94fc523f3c35bd8013f04827e94756cbc0212f4 (diff) | |
parent | 413f81eba35d6ede9289b0c8a920c013a84fac71 (diff) |
Merge branch 'linus' into tracing/core
Merge reason: tracing/core was on a .30-rc1 base and was missing out on
on a handful of tracing fixes present in .30-rc5-almost.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'sound/soc/pxa/palm27x.c')
-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); |