mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 15:02:40 -04:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user