diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-04-20 13:06:53 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-04-20 13:06:53 +0200 |
commit | 4740860b534e86d7db3b26cbd980bec8e4c807e8 (patch) | |
tree | df010ab3c53a2b4f3829593b56cdfa19f829115b /sound/pci/hda/patch_analog.c | |
parent | ALSA: hda - Introduce snd_hda_set_pin_ctl*() helper functions (diff) | |
download | linux-4740860b534e86d7db3b26cbd980bec8e4c807e8.tar.xz linux-4740860b534e86d7db3b26cbd980bec8e4c807e8.zip |
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_analog.c')
-rw-r--r-- | sound/pci/hda/patch_analog.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 38163abeea92..723bb9cb5f09 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c @@ -3155,6 +3155,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) for (i = 0; i < cfg->num_inputs; i++) { hda_nid_t nid = cfg->inputs[i].pin; int type = cfg->inputs[i].type; + int val; switch (nid) { case 0x15: /* port-C */ snd_hda_codec_write(codec, 0x33, 0, AC_VERB_SET_CONNECT_SEL, 0x0); @@ -3163,8 +3164,10 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec) snd_hda_codec_write(codec, 0x34, 0, AC_VERB_SET_CONNECT_SEL, 0x0); break; } - snd_hda_set_pin_ctl(codec, nid, - type == AUTO_PIN_MIC ? PIN_VREF80 : PIN_IN); + val = PIN_IN; + if (type == AUTO_PIN_MIC) + val |= snd_hda_get_default_vref(codec, nid); + snd_hda_set_pin_ctl(codec, nid, val); if (nid != AD1988_PIN_CD_NID) snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE); |