Commit eb995a8c authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] hda-codec - Fix headphone auto-toggle on sigmatel codec

Fix/optimize the headphone auto-toggle function on sigmatel codecs.
The headphone pins are kept as output.  When headhpones are unplugged,
you cannot hear anyway ;)
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 5c79b1f8
...@@ -1432,12 +1432,9 @@ static int stac92xx_init(struct hda_codec *codec) ...@@ -1432,12 +1432,9 @@ static int stac92xx_init(struct hda_codec *codec)
for (i = 0; i < cfg->hp_outs; i++) for (i = 0; i < cfg->hp_outs; i++)
enable_pin_detect(codec, cfg->hp_pins[i], enable_pin_detect(codec, cfg->hp_pins[i],
STAC_HP_EVENT); STAC_HP_EVENT);
stac92xx_auto_init_hp_out(codec);
/* fake event to set up pins */ /* fake event to set up pins */
codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26); codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26);
/* enable the headphones by default.
* If/when unsol_event detection works, this will be ignored
*/
stac92xx_auto_init_hp_out(codec);
} else { } else {
stac92xx_auto_init_multi_out(codec); stac92xx_auto_init_multi_out(codec);
stac92xx_auto_init_hp_out(codec); stac92xx_auto_init_hp_out(codec);
...@@ -1539,9 +1536,6 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) ...@@ -1539,9 +1536,6 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
for (i = 0; i < cfg->speaker_outs; i++) for (i = 0; i < cfg->speaker_outs; i++)
stac92xx_reset_pinctl(codec, cfg->speaker_pins[i], stac92xx_reset_pinctl(codec, cfg->speaker_pins[i],
AC_PINCTL_OUT_EN); AC_PINCTL_OUT_EN);
for (i = 0; i < cfg->hp_outs; i++)
stac92xx_set_pinctl(codec, cfg->hp_pins[i],
AC_PINCTL_OUT_EN);
} else { } else {
/* enable lineouts, disable hp */ /* enable lineouts, disable hp */
for (i = 0; i < cfg->line_outs; i++) for (i = 0; i < cfg->line_outs; i++)
...@@ -1550,9 +1544,6 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res) ...@@ -1550,9 +1544,6 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
for (i = 0; i < cfg->speaker_outs; i++) for (i = 0; i < cfg->speaker_outs; i++)
stac92xx_set_pinctl(codec, cfg->speaker_pins[i], stac92xx_set_pinctl(codec, cfg->speaker_pins[i],
AC_PINCTL_OUT_EN); AC_PINCTL_OUT_EN);
for (i = 0; i < cfg->hp_outs; i++)
stac92xx_reset_pinctl(codec, cfg->hp_pins[i],
AC_PINCTL_OUT_EN);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment