diff options
Diffstat (limited to 'sound/soc/pxa/tosa.c')
| -rw-r--r-- | sound/soc/pxa/tosa.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c index afefe41b8c46..c77194f74c9b 100644 --- a/sound/soc/pxa/tosa.c +++ b/sound/soc/pxa/tosa.c | |||
| @@ -38,7 +38,7 @@ | |||
| 38 | #include "pxa2xx-pcm.h" | 38 | #include "pxa2xx-pcm.h" |
| 39 | #include "pxa2xx-ac97.h" | 39 | #include "pxa2xx-ac97.h" |
| 40 | 40 | ||
| 41 | static struct snd_soc_machine tosa; | 41 | static struct snd_soc_card tosa; |
| 42 | 42 | ||
| 43 | #define TOSA_HP 0 | 43 | #define TOSA_HP 0 |
| 44 | #define TOSA_MIC_INT 1 | 44 | #define TOSA_MIC_INT 1 |
| @@ -230,15 +230,37 @@ static struct snd_soc_dai_link tosa_dai[] = { | |||
| 230 | }, | 230 | }, |
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | static struct snd_soc_machine tosa = { | 233 | static int tosa_probe(struct platform_device *dev) |
| 234 | { | ||
| 235 | int ret; | ||
| 236 | |||
| 237 | ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack"); | ||
| 238 | if (ret) | ||
| 239 | return ret; | ||
| 240 | ret = gpio_direction_output(TOSA_GPIO_L_MUTE, 0); | ||
| 241 | if (ret) | ||
| 242 | gpio_free(TOSA_GPIO_L_MUTE); | ||
| 243 | |||
| 244 | return ret; | ||
| 245 | } | ||
| 246 | |||
| 247 | static int tosa_remove(struct platform_device *dev) | ||
| 248 | { | ||
| 249 | gpio_free(TOSA_GPIO_L_MUTE); | ||
| 250 | return 0; | ||
| 251 | } | ||
| 252 | |||
| 253 | static struct snd_soc_card tosa = { | ||
| 234 | .name = "Tosa", | 254 | .name = "Tosa", |
| 255 | .platform = &pxa2xx_soc_platform, | ||
| 235 | .dai_link = tosa_dai, | 256 | .dai_link = tosa_dai, |
| 236 | .num_links = ARRAY_SIZE(tosa_dai), | 257 | .num_links = ARRAY_SIZE(tosa_dai), |
| 258 | .probe = tosa_probe, | ||
| 259 | .remove = tosa_remove, | ||
| 237 | }; | 260 | }; |
| 238 | 261 | ||
| 239 | static struct snd_soc_device tosa_snd_devdata = { | 262 | static struct snd_soc_device tosa_snd_devdata = { |
| 240 | .machine = &tosa, | 263 | .card = &tosa, |
| 241 | .platform = &pxa2xx_soc_platform, | ||
| 242 | .codec_dev = &soc_codec_dev_wm9712, | 264 | .codec_dev = &soc_codec_dev_wm9712, |
| 243 | }; | 265 | }; |
| 244 | 266 | ||
| @@ -251,11 +273,6 @@ static int __init tosa_init(void) | |||
| 251 | if (!machine_is_tosa()) | 273 | if (!machine_is_tosa()) |
| 252 | return -ENODEV; | 274 | return -ENODEV; |
| 253 | 275 | ||
| 254 | ret = gpio_request(TOSA_GPIO_L_MUTE, "Headphone Jack"); | ||
| 255 | if (ret) | ||
| 256 | return ret; | ||
| 257 | gpio_direction_output(TOSA_GPIO_L_MUTE, 0); | ||
| 258 | |||
| 259 | tosa_snd_device = platform_device_alloc("soc-audio", -1); | 276 | tosa_snd_device = platform_device_alloc("soc-audio", -1); |
| 260 | if (!tosa_snd_device) { | 277 | if (!tosa_snd_device) { |
| 261 | ret = -ENOMEM; | 278 | ret = -ENOMEM; |
| @@ -272,15 +289,12 @@ static int __init tosa_init(void) | |||
| 272 | platform_device_put(tosa_snd_device); | 289 | platform_device_put(tosa_snd_device); |
| 273 | 290 | ||
| 274 | err_alloc: | 291 | err_alloc: |
| 275 | gpio_free(TOSA_GPIO_L_MUTE); | ||
| 276 | |||
| 277 | return ret; | 292 | return ret; |
| 278 | } | 293 | } |
| 279 | 294 | ||
| 280 | static void __exit tosa_exit(void) | 295 | static void __exit tosa_exit(void) |
| 281 | { | 296 | { |
| 282 | platform_device_unregister(tosa_snd_device); | 297 | platform_device_unregister(tosa_snd_device); |
| 283 | gpio_free(TOSA_GPIO_L_MUTE); | ||
| 284 | } | 298 | } |
| 285 | 299 | ||
| 286 | module_init(tosa_init); | 300 | module_init(tosa_init); |
