Skip to content

Commit

Permalink
ALSA: hda - Prefer VREF50 if BIOS sets for Realtek codecs
Browse files Browse the repository at this point in the history
If BIOS sets up the input pin as VREF 50, use the value as is instead of
overriding forcibly to VREF 80.  This fixes the quality of inputs on
some devices like Packard-Bell M5210.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jul 30, 2010
1 parent 5d4abf9 commit 954a29c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,13 @@ static void alc_set_input_pin(struct hda_codec *codec, hda_nid_t nid,

if (auto_pin_type <= AUTO_PIN_FRONT_MIC) {
unsigned int pincap;
unsigned int oldval;
oldval = snd_hda_codec_read(codec, nid, 0,
AC_VERB_GET_PIN_WIDGET_CONTROL, 0);
pincap = snd_hda_query_pin_caps(codec, nid);
pincap = (pincap & AC_PINCAP_VREF) >> AC_PINCAP_VREF_SHIFT;
if (pincap & AC_PINCAP_VREF_80)
/* if the default pin setup is vref50, we give it priority */
if ((pincap & AC_PINCAP_VREF_80) && oldval != PIN_VREF50)
val = PIN_VREF80;
else if (pincap & AC_PINCAP_VREF_50)
val = PIN_VREF50;
Expand Down Expand Up @@ -10406,7 +10410,8 @@ static struct alc_config_preset alc882_presets[] = {
* Pin config fixes
*/
enum {
PINFIX_ABIT_AW9D_MAX
PINFIX_ABIT_AW9D_MAX,
PINFIX_PB_M5210,
};

static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
Expand All @@ -10416,13 +10421,22 @@ static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
{ }
};

static const struct hda_verb pb_m5210_verbs[] = {
{ 0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF50 },
{}
};

static const struct alc_fixup alc882_fixups[] = {
[PINFIX_ABIT_AW9D_MAX] = {
.pins = alc882_abit_aw9d_pinfix
},
[PINFIX_PB_M5210] = {
.verbs = pb_m5210_verbs
},
};

static struct snd_pci_quirk alc882_fixup_tbl[] = {
SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", PINFIX_PB_M5210),
SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
{}
};
Expand Down

0 comments on commit 954a29c

Please sign in to comment.