aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/tegra/tegra_alc5632.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/tegra/tegra_alc5632.c')
-rw-r--r--sound/soc/tegra/tegra_alc5632.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sound/soc/tegra/tegra_alc5632.c b/sound/soc/tegra/tegra_alc5632.c
index 32de7006daf0..facf6f00c6b0 100644
--- a/sound/soc/tegra/tegra_alc5632.c
+++ b/sound/soc/tegra/tegra_alc5632.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * tegra_alc5632.c -- Toshiba AC100(PAZ00) machine ASoC driver 2* tegra_alc5632.c -- Toshiba AC100(PAZ00) machine ASoC driver
3 * 3 *
4 * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net> 4 * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net>
5 * Copyright (C) 2012 - NVIDIA, Inc. 5 * Copyright (C) 2012 - NVIDIA, Inc.
@@ -110,7 +110,6 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
110{ 110{
111 struct snd_soc_codec *codec = rtd->codec; 111 struct snd_soc_codec *codec = rtd->codec;
112 struct snd_soc_dapm_context *dapm = &codec->dapm; 112 struct snd_soc_dapm_context *dapm = &codec->dapm;
113 struct device_node *np = codec->card->dev->of_node;
114 struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(codec->card); 113 struct tegra_alc5632 *machine = snd_soc_card_get_drvdata(codec->card);
115 114
116 snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET, 115 snd_soc_jack_new(codec, "Headset Jack", SND_JACK_HEADSET,
@@ -119,8 +118,6 @@ static int tegra_alc5632_asoc_init(struct snd_soc_pcm_runtime *rtd)
119 ARRAY_SIZE(tegra_alc5632_hs_jack_pins), 118 ARRAY_SIZE(tegra_alc5632_hs_jack_pins),
120 tegra_alc5632_hs_jack_pins); 119 tegra_alc5632_hs_jack_pins);
121 120
122 machine->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
123
124 if (gpio_is_valid(machine->gpio_hp_det)) { 121 if (gpio_is_valid(machine->gpio_hp_det)) {
125 tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det; 122 tegra_alc5632_hp_jack_gpio.gpio = machine->gpio_hp_det;
126 snd_soc_jack_add_gpios(&tegra_alc5632_hs_jack, 123 snd_soc_jack_add_gpios(&tegra_alc5632_hs_jack,
@@ -159,6 +156,7 @@ static struct snd_soc_card snd_soc_tegra_alc5632 = {
159 156
160static __devinit int tegra_alc5632_probe(struct platform_device *pdev) 157static __devinit int tegra_alc5632_probe(struct platform_device *pdev)
161{ 158{
159 struct device_node *np = pdev->dev.of_node;
162 struct snd_soc_card *card = &snd_soc_tegra_alc5632; 160 struct snd_soc_card *card = &snd_soc_tegra_alc5632;
163 struct tegra_alc5632 *alc5632; 161 struct tegra_alc5632 *alc5632;
164 int ret; 162 int ret;
@@ -181,6 +179,10 @@ static __devinit int tegra_alc5632_probe(struct platform_device *pdev)
181 goto err; 179 goto err;
182 } 180 }
183 181
182 alc5632->gpio_hp_det = of_get_named_gpio(np, "nvidia,hp-det-gpios", 0);
183 if (alc5632->gpio_hp_det == -ENODEV)
184 return -EPROBE_DEFER;
185
184 ret = snd_soc_of_parse_card_name(card, "nvidia,model"); 186 ret = snd_soc_of_parse_card_name(card, "nvidia,model");
185 if (ret) 187 if (ret)
186 goto err; 188 goto err;