summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-01-10 09:45:13 +0100
committerTakashi Iwai <tiwai@suse.de>2013-01-12 08:44:30 +0100
commit0b4df931ce3502311928bf66088cd76a2b5e604f (patch)
treeeb278b29a51481922c8153c48bc847b921c05479 /sound/pci/hda/hda_generic.c
parent2c12c30d3fe5589d32ceddade09f13f1d3d6391d (diff)
downloadlwn-0b4df931ce3502311928bf66088cd76a2b5e604f.tar.gz
lwn-0b4df931ce3502311928bf66088cd76a2b5e604f.zip
ALSA: hda - Avoid auto-mute or auto-mic of retasked jacks
When a jack is retasked as a different direction (e.g. a mic jack is used as a CLFE output), such a jack shouldn't be counted as the target for the automatic jack switching. Skip the automute or the autoswitch when the current pinctl direction is different from what we suppose. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index e786f103cb2b..2020faf9e412 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -2773,6 +2773,9 @@ static bool detect_jacks(struct hda_codec *codec, int num_pins, hda_nid_t *pins)
hda_nid_t nid = pins[i];
if (!nid)
break;
+ /* don't detect pins retasked as inputs */
+ if (snd_hda_codec_get_pin_target(codec, nid) & AC_PINCTL_IN_EN)
+ continue;
present |= snd_hda_jack_detect(codec, nid);
}
return present;
@@ -2899,7 +2902,11 @@ void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *ja
return;
for (i = spec->am_num_entries - 1; i > 0; i--) {
- if (snd_hda_jack_detect(codec, spec->am_entry[i].pin)) {
+ hda_nid_t pin = spec->am_entry[i].pin;
+ /* don't detect pins retasked as outputs */
+ if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN)
+ continue;
+ if (snd_hda_jack_detect(codec, pin)) {
mux_select(codec, 0, spec->am_entry[i].idx);
return;
}