aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/tegra/tegra_wm8903.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c
index 5ef2063e0ab..9059525f3b0 100644
--- a/sound/soc/tegra/tegra_wm8903.c
+++ b/sound/soc/tegra/tegra_wm8903.c
@@ -50,12 +50,9 @@
50 50
51#define DRV_NAME "tegra-snd-wm8903" 51#define DRV_NAME "tegra-snd-wm8903"
52 52
53#define GPIO_HP_DET BIT(4)
54
55struct tegra_wm8903 { 53struct tegra_wm8903 {
56 struct tegra_wm8903_platform_data pdata; 54 struct tegra_wm8903_platform_data pdata;
57 struct tegra_asoc_utils_data util_data; 55 struct tegra_asoc_utils_data util_data;
58 int gpio_requested;
59}; 56};
60 57
61static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream, 58static int tegra_wm8903_hw_params(struct snd_pcm_substream *substream,
@@ -252,7 +249,6 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd)
252 snd_soc_jack_add_gpios(&tegra_wm8903_hp_jack, 249 snd_soc_jack_add_gpios(&tegra_wm8903_hp_jack,
253 1, 250 1,
254 &tegra_wm8903_hp_jack_gpio); 251 &tegra_wm8903_hp_jack_gpio);
255 machine->gpio_requested |= GPIO_HP_DET;
256 } 252 }
257 253
258 snd_soc_jack_new(codec, "Mic Jack", SND_JACK_MICROPHONE, 254 snd_soc_jack_new(codec, "Mic Jack", SND_JACK_MICROPHONE,
@@ -458,10 +454,8 @@ static int __devexit tegra_wm8903_driver_remove(struct platform_device *pdev)
458 struct snd_soc_card *card = platform_get_drvdata(pdev); 454 struct snd_soc_card *card = platform_get_drvdata(pdev);
459 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card); 455 struct tegra_wm8903 *machine = snd_soc_card_get_drvdata(card);
460 456
461 if (machine->gpio_requested & GPIO_HP_DET) 457 snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack, 1,
462 snd_soc_jack_free_gpios(&tegra_wm8903_hp_jack, 458 &tegra_wm8903_hp_jack_gpio);
463 1,
464 &tegra_wm8903_hp_jack_gpio);
465 459
466 snd_soc_unregister_card(card); 460 snd_soc_unregister_card(card);
467 461