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>
This commit is contained in:
Takashi Iwai
2012-04-20 13:06:53 +02:00
parent cdd03cedc5
commit 4740860b53
10 changed files with 56 additions and 58 deletions

View File

@@ -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) {