aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_cirrus.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-04-20 07:06:53 -0400
committerTakashi Iwai <tiwai@suse.de>2012-04-20 07:06:53 -0400
commit4740860b534e86d7db3b26cbd980bec8e4c807e8 (patch)
treedf010ab3c53a2b4f3829593b56cdfa19f829115b /sound/pci/hda/patch_cirrus.c
parentcdd03cedc5b55da017fcdeff7d47cac2639cded8 (diff)
ALSA: hda - Add snd_hda_get_default_vref() helper function
Add a new helper function to guess the default VREF pin control bits for mic in. This can be used to set the pin control value safely matching with the actual pin capabilities. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_cirrus.c')
-rw-r--r--sound/pci/hda/patch_cirrus.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
index 778e4b9dd88c..48c6d8186e90 100644
--- a/sound/pci/hda/patch_cirrus.c
+++ b/sound/pci/hda/patch_cirrus.c
@@ -1057,12 +1057,8 @@ static void init_input(struct hda_codec *codec)
1057 continue; 1057 continue;
1058 /* set appropriate pin control and mute first */ 1058 /* set appropriate pin control and mute first */
1059 ctl = PIN_IN; 1059 ctl = PIN_IN;
1060 if (cfg->inputs[i].type == AUTO_PIN_MIC) { 1060 if (cfg->inputs[i].type == AUTO_PIN_MIC)
1061 unsigned int caps = snd_hda_query_pin_caps(codec, pin); 1061 ctl |= snd_hda_get_default_vref(codec, pin);
1062 caps >>= AC_PINCAP_VREF_SHIFT;
1063 if (caps & AC_PINCAP_VREF_80)
1064 ctl = PIN_VREF80;
1065 }
1066 snd_hda_set_pin_ctl(codec, pin, ctl); 1062 snd_hda_set_pin_ctl(codec, pin, ctl);
1067 snd_hda_codec_write(codec, spec->adc_nid[i], 0, 1063 snd_hda_codec_write(codec, spec->adc_nid[i], 0,
1068 AC_VERB_SET_AMP_GAIN_MUTE, 1064 AC_VERB_SET_AMP_GAIN_MUTE,