diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:05:23 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-05-04 16:05:23 +0200 |
commit | 8560b9321f9050968f393ce1ec67e47c1a0bd5cf (patch) | |
tree | 658ebb20e4fd5dee840f27103b59da367ff473b1 /sound/soc/pxa | |
parent | 72e31981a4e91f84c5b5e8994f5d25b1cf22b6cf (diff) | |
parent | 6574612fbb34c63117581e68f2231ddce027e41e (diff) | |
download | linux-8560b9321f9050968f393ce1ec67e47c1a0bd5cf.tar.bz2 |
Merge branch 'fix/asoc' into topic/asoc
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 = { static struct platform_device *palm27x_snd_device; -static int __init palm27x_asoc_init(void) +static int palm27x_asoc_probe(struct platform_device *pdev) { int ret; @@ -208,6 +208,10 @@ static int __init palm27x_asoc_init(void) machine_is_palmld())) return -ENODEV; + if (pdev->dev.platform_data) + palm27x_ep_gpio = ((struct palm27x_asoc_info *) + (pdev->dev.platform_data))->jack_gpio; + ret = gpio_request(palm27x_ep_gpio, "Headphone Jack"); if (ret) return ret; @@ -245,16 +249,31 @@ err_alloc: return ret; } -static void __exit palm27x_asoc_exit(void) +static int __devexit palm27x_asoc_remove(struct platform_device *pdev) { free_irq(gpio_to_irq(palm27x_ep_gpio), NULL); gpio_free(palm27x_ep_gpio); platform_device_unregister(palm27x_snd_device); + return 0; } -void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) +static struct platform_driver palm27x_wm9712_driver = { + .probe = palm27x_asoc_probe, + .remove = __devexit_p(palm27x_asoc_remove), + .driver = { + .name = "palm27x-asoc", + .owner = THIS_MODULE, + }, +}; + +static int __init palm27x_asoc_init(void) +{ + return platform_driver_register(&palm27x_wm9712_driver); +} + +static void __exit palm27x_asoc_exit(void) { - palm27x_ep_gpio = data->jack_gpio; + platform_driver_unregister(&palm27x_wm9712_driver); } module_init(palm27x_asoc_init); |