aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/hda_generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/hda_generic.c')
-rw-r--r--sound/pci/hda/hda_generic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 8e77cbbad871..f5c2d1ff1a09 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -3724,7 +3724,8 @@ static int mux_select(struct hda_codec *codec, unsigned int adc_idx,
3724/* check each pin in the given array; returns true if any of them is plugged */ 3724/* check each pin in the given array; returns true if any of them is plugged */
3725static bool detect_jacks(struct hda_codec *codec, int num_pins, hda_nid_t *pins) 3725static bool detect_jacks(struct hda_codec *codec, int num_pins, hda_nid_t *pins)
3726{ 3726{
3727 int i, present = 0; 3727 int i;
3728 bool present = false;
3728 3729
3729 for (i = 0; i < num_pins; i++) { 3730 for (i = 0; i < num_pins; i++) {
3730 hda_nid_t nid = pins[i]; 3731 hda_nid_t nid = pins[i];
@@ -3733,7 +3734,8 @@ static bool detect_jacks(struct hda_codec *codec, int num_pins, hda_nid_t *pins)
3733 /* don't detect pins retasked as inputs */ 3734 /* don't detect pins retasked as inputs */
3734 if (snd_hda_codec_get_pin_target(codec, nid) & AC_PINCTL_IN_EN) 3735 if (snd_hda_codec_get_pin_target(codec, nid) & AC_PINCTL_IN_EN)
3735 continue; 3736 continue;
3736 present |= snd_hda_jack_detect(codec, nid); 3737 if (snd_hda_jack_detect_state(codec, nid) == HDA_JACK_PRESENT)
3738 present = true;
3737 } 3739 }
3738 return present; 3740 return present;
3739} 3741}
@@ -3887,7 +3889,7 @@ void snd_hda_gen_mic_autoswitch(struct hda_codec *codec, struct hda_jack_tbl *ja
3887 /* don't detect pins retasked as outputs */ 3889 /* don't detect pins retasked as outputs */
3888 if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN) 3890 if (snd_hda_codec_get_pin_target(codec, pin) & AC_PINCTL_OUT_EN)
3889 continue; 3891 continue;
3890 if (snd_hda_jack_detect(codec, pin)) { 3892 if (snd_hda_jack_detect_state(codec, pin) == HDA_JACK_PRESENT) {
3891 mux_select(codec, 0, spec->am_entry[i].idx); 3893 mux_select(codec, 0, spec->am_entry[i].idx);
3892 return; 3894 return;
3893 } 3895 }