If there are no internal speakers, we should not turn the eapd switch off, because it might be necessary to keep high for Headphone.
BugLink: https://bugs.launchpad.net/bugs/1155016 Signed-off-by: David Henningsson <email address hidden> --- sound/pci/hda/patch_sigmatel.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
Hi Takashi,
I encountered the bug when working with a pre-release machine (so no alsa-info, unfortunately).
Feel free to commit if you think this is a good idea. Or can you think of a use case where this would cause a regression?
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index d57c81e..66200ea8 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -3524,6 +3524,31 @@ static int stac_parse_auto_config(struct hda_codec *codec) if (err < 0) return err;
+ /* Don't GPIO-mute speakers if there are no internal speakers, because + the GPIO might be necessary for Headphone */ + if (spec->eapd_switch) { + hda_nid_t *nid_pin; + int nids, i; + bool found = false; + if (spec->gen.autocfg.line_out_type == AUTO_PIN_SPEAKER_OUT) { + nid_pin = spec->gen.autocfg.line_out_pins; + nids = spec->gen.autocfg.line_outs; + } else { + nid_pin = spec->gen.autocfg.speaker_pins; + nids = spec->gen.autocfg.speaker_outs; + } + for (i = 0; i < nids; i++) { + unsigned int def_conf = snd_hda_codec_get_pincfg(codec, nid_pin[i]); + unsigned int attr = snd_hda_get_input_pin_attr(def_conf); + if (attr == INPUT_PIN_ATTR_INT) { + found = true; + break; + } + } + if (!found) + spec->eapd_switch = 0; + } + /* minimum value is actually mute */ spec->gen.vmaster_tlv[3] |= TLV_DB_SCALE_MUTE;
-- 1.7.9.5
If there are no internal speakers, we should not turn the eapd switch
off, because it might be necessary to keep high for Headphone.
BugLink: https:/ /bugs.launchpad .net/bugs/ 1155016 pci/hda/ patch_sigmatel. c | 25 +++++++ +++++++ +++++++ ++++
Signed-off-by: David Henningsson <email address hidden>
---
sound/
1 file changed, 25 insertions(+)
Hi Takashi,
I encountered the bug when working with a pre-release machine (so no alsa-info, unfortunately).
Feel free to commit if you think this is a good idea. Or can you think of a use case
where this would cause a regression?
diff --git a/sound/ pci/hda/ patch_sigmatel. c b/sound/ pci/hda/ patch_sigmatel. c pci/hda/ patch_sigmatel. c pci/hda/ patch_sigmatel. c auto_config( struct hda_codec *codec)
index d57c81e..66200ea8 100644
--- a/sound/
+++ b/sound/
@@ -3524,6 +3524,31 @@ static int stac_parse_
if (err < 0)
return err;
+ /* Don't GPIO-mute speakers if there are no internal speakers, because gen.autocfg. line_out_ type == AUTO_PIN_ SPEAKER_ OUT) { autocfg. line_out_ pins; autocfg. line_outs; autocfg. speaker_ pins; autocfg. speaker_ outs; codec_get_ pincfg( codec, nid_pin[i]); get_input_ pin_attr( def_conf) ; >gen.vmaster_ tlv[3] |= TLV_DB_SCALE_MUTE;
+ the GPIO might be necessary for Headphone */
+ if (spec->eapd_switch) {
+ hda_nid_t *nid_pin;
+ int nids, i;
+ bool found = false;
+ if (spec->
+ nid_pin = spec->gen.
+ nids = spec->gen.
+ } else {
+ nid_pin = spec->gen.
+ nids = spec->gen.
+ }
+ for (i = 0; i < nids; i++) {
+ unsigned int def_conf = snd_hda_
+ unsigned int attr = snd_hda_
+ if (attr == INPUT_PIN_ATTR_INT) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ spec->eapd_switch = 0;
+ }
+
/* minimum value is actually mute */
spec-
--
1.7.9.5