aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2009-04-17 05:37:35 -0400
committerEric Miao <eric.miao@marvell.com>2009-04-19 09:56:54 -0400
commite91fb9137dd235ab959d7675d0e4104974dad5eb (patch)
treeabc6e2d5064f713a43bf91b3114aa6462e6f6c82 /sound
parentcc8d2730ad6fe79699cedd9cccfe632570830c3c (diff)
[ARM] pxa/palm27x: General fix for Palm27x aSoC driver
Firstly, this patch makes the palm27x asoc driver a little more sane. Also, since all affected devices use GPIO95 as AC97_nRESET, this patch sets that properly. Affected are PalmT5, TX and LifeDrive. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/pxa/palm27x.c27
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
201static struct platform_device *palm27x_snd_device; 201static struct platform_device *palm27x_snd_device;
202 202
203static int __init palm27x_asoc_init(void) 203static 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
248static void __exit palm27x_asoc_exit(void) 252static 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
255void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) 260static 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
269static int __init palm27x_asoc_init(void)
270{
271 return platform_driver_register(&palm27x_wm9712_driver);
272}
273
274static 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
260module_init(palm27x_asoc_init); 279module_init(palm27x_asoc_init);