Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133078
b: refs/heads/master
c: 23f0c04
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai committed Feb 26, 2009
1 parent 1fb2655 commit 7d61fa2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 37 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5d9b6c07831456b7a7d90eac31c853d60eaf8ab6
refs/heads/master: 23f0c048ba59ad5c2f3fd85ed98360b631dbf6f8
62 changes: 26 additions & 36 deletions trunk/sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,24 @@ static int alc_eapd_ctrl_put(struct snd_kcontrol *kcontrol,
.private_value = nid | (mask<<16) }
#endif /* CONFIG_SND_DEBUG */

/*
* set up the input pin config (depending on the given auto-pin type)
*/
static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid,
int auto_pin_type)
{
unsigned int val = PIN_IN;

if (auto_pin_type <= AUTO_PIN_FRONT_MIC) {
unsigned int pincap;
pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
if (pincap & AC_PINCAP_VREF_80)
val = PIN_VREF80;
}
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, val);
}

/*
*/
static void add_mixer(struct alc_spec *spec, struct snd_kcontrol_new *mix)
Expand Down Expand Up @@ -4188,10 +4206,7 @@ static void alc880_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (alc880_is_input_pin(nid)) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN);
alc_set_input_pin(codec, nid, i);
if (nid != ALC880_PIN_CD_NID)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down Expand Up @@ -5657,10 +5672,7 @@ static void alc260_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (nid >= 0x12) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN);
alc_set_input_pin(codec, nid, i);
if (nid != ALC260_PIN_CD_NID)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down Expand Up @@ -7006,16 +7018,7 @@ static void alc882_auto_init_analog_input(struct hda_codec *codec)
unsigned int vref;
if (!nid)
continue;
vref = PIN_IN;
if (1 /*i <= AUTO_PIN_FRONT_MIC*/) {
unsigned int pincap;
pincap = snd_hda_param_read(codec, nid, AC_PAR_PIN_CAP);
if ((pincap >> AC_PINCAP_VREF_SHIFT) &
AC_PINCAP_VREF_80)
vref = PIN_VREF80;
}
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL, vref);
alc_set_input_pin(codec, nid, AUTO_PIN_FRONT_MIC /*i*/);
if (get_wcaps(codec, nid) & AC_WCAP_OUT_AMP)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down Expand Up @@ -9100,10 +9103,7 @@ static void alc883_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (alc883_is_input_pin(nid)) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
(i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN));
alc_set_input_pin(codec, nid, i);
if (nid != ALC883_PIN_CD_NID)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down Expand Up @@ -13831,12 +13831,8 @@ static void alc861_auto_init_analog_input(struct hda_codec *codec)

for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (nid >= 0x0c && nid <= 0x11) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN);
}
if (nid >= 0x0c && nid <= 0x11)
alc_set_input_pin(codec, nid, i);
}
}

Expand Down Expand Up @@ -14803,10 +14799,7 @@ static void alc861vd_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (alc861vd_is_input_pin(nid)) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN);
alc_set_input_pin(codec, nid, i);
if (nid != ALC861VD_PIN_CD_NID)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down Expand Up @@ -16732,10 +16725,7 @@ static void alc662_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
if (alc662_is_input_pin(nid)) {
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
(i <= AUTO_PIN_FRONT_MIC ?
PIN_VREF80 : PIN_IN));
alc_set_input_pin(codec, nid, i);
if (nid != ALC662_PIN_CD_NID)
snd_hda_codec_write(codec, nid, 0,
AC_VERB_SET_AMP_GAIN_MUTE,
Expand Down

0 comments on commit 7d61fa2

Please sign in to comment.