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_via.c | |
parent | cdd03cedc5b55da017fcdeff7d47cac2639cded8 (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_via.c')
-rw-r--r-- | sound/pci/hda/patch_via.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c index 8ee531aeda6e..92e11672b91c 100644 --- a/sound/pci/hda/patch_via.c +++ b/sound/pci/hda/patch_via.c @@ -661,10 +661,11 @@ static void via_auto_init_analog_input(struct hda_codec *codec) hda_nid_t nid = cfg->inputs[i].pin; if (spec->smart51_enabled && is_smart51_pins(codec, nid)) ctl = PIN_OUT; - else if (cfg->inputs[i].type == AUTO_PIN_MIC) - ctl = PIN_VREF50; - else + else { ctl = PIN_IN; + if (cfg->inputs[i].type == AUTO_PIN_MIC) + ctl |= snd_hda_get_default_vref(codec, nid); + } snd_hda_set_pin_ctl(codec, nid, ctl); } |