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_conexant.c | |
parent | cdd03cedc5b55da017fcdeff7d47cac2639cded8 (diff) | |
download | op-kernel-dev-4740860b534e86d7db3b26cbd980bec8e4c807e8.zip op-kernel-dev-4740860b534e86d7db3b26cbd980bec8e4c807e8.tar.gz |
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_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index afa510f..aabdb9e 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -4020,12 +4020,11 @@ static void cx_auto_init_input(struct hda_codec *codec) } for (i = 0; i < cfg->num_inputs; i++) { - unsigned int type; + hda_nid_t pin = cfg->inputs[i].pin; + unsigned int type = PIN_IN; if (cfg->inputs[i].type == AUTO_PIN_MIC) - type = PIN_VREF80; - else - type = PIN_IN; - snd_hda_set_pin_ctl(codec, cfg->inputs[i].pin, type); + type |= snd_hda_get_default_vref(codec, pin); + snd_hda_set_pin_ctl(codec, pin, type); } if (spec->auto_mic) { |