summaryrefslogtreecommitdiff
path: root/sound/soc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/imx/imx-sgtl5000.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/sound/soc/imx/imx-sgtl5000.c b/sound/soc/imx/imx-sgtl5000.c
index 82ee8eca8680..3fd0aa211aef 100644
--- a/sound/soc/imx/imx-sgtl5000.c
+++ b/sound/soc/imx/imx-sgtl5000.c
@@ -249,24 +249,26 @@ static int imx_3stack_sgtl5000_init(struct snd_soc_pcm_runtime *rtd)
snd_soc_dapm_enable_pin(&codec->dapm, "Headphone Jack");
snd_soc_dapm_sync(&codec->dapm);
- /* Jack detection API stuff */
- ret = snd_soc_jack_new(codec, "Headphone Jack",
- SND_JACK_HEADPHONE, &hs_jack);
- if (ret)
- return ret;
-
- ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
- hs_jack_pins);
- if (ret) {
- printk(KERN_ERR "failed to call snd_soc_jack_add_pins\n");
- return ret;
+ if (hs_jack_gpios[0].gpio != -1) {
+ /* Jack detection API stuff */
+ ret = snd_soc_jack_new(codec, "Headphone Jack",
+ SND_JACK_HEADPHONE, &hs_jack);
+ if (ret)
+ return ret;
+
+ ret = snd_soc_jack_add_pins(&hs_jack, ARRAY_SIZE(hs_jack_pins),
+ hs_jack_pins);
+ if (ret) {
+ printk(KERN_ERR "failed to call snd_soc_jack_add_pins\n");
+ return ret;
+ }
+
+ ret = snd_soc_jack_add_gpios(&hs_jack,
+ ARRAY_SIZE(hs_jack_gpios), hs_jack_gpios);
+ if (ret)
+ printk(KERN_WARNING "failed to call snd_soc_jack_add_gpios\n");
}
- ret = snd_soc_jack_add_gpios(&hs_jack, ARRAY_SIZE(hs_jack_gpios),
- hs_jack_gpios);
- if (ret)
- printk(KERN_WARNING "failed to call snd_soc_jack_add_gpios\n");
-
return 0;
}