diff options
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 64 |
1 files changed, 56 insertions, 8 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 98cc465992f2..ba95039e8ca3 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -1459,22 +1459,31 @@ struct alc_fixup { | |||
1459 | 1459 | ||
1460 | static void alc_pick_fixup(struct hda_codec *codec, | 1460 | static void alc_pick_fixup(struct hda_codec *codec, |
1461 | const struct snd_pci_quirk *quirk, | 1461 | const struct snd_pci_quirk *quirk, |
1462 | const struct alc_fixup *fix) | 1462 | const struct alc_fixup *fix, |
1463 | int pre_init) | ||
1463 | { | 1464 | { |
1464 | const struct alc_pincfg *cfg; | 1465 | const struct alc_pincfg *cfg; |
1465 | 1466 | ||
1466 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); | 1467 | quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk); |
1467 | if (!quirk) | 1468 | if (!quirk) |
1468 | return; | 1469 | return; |
1469 | |||
1470 | fix += quirk->value; | 1470 | fix += quirk->value; |
1471 | cfg = fix->pins; | 1471 | cfg = fix->pins; |
1472 | if (cfg) { | 1472 | if (pre_init && cfg) { |
1473 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1474 | snd_printdd(KERN_INFO "hda_codec: %s: Apply pincfg for %s\n", | ||
1475 | codec->chip_name, quirk->name); | ||
1476 | #endif | ||
1473 | for (; cfg->nid; cfg++) | 1477 | for (; cfg->nid; cfg++) |
1474 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); | 1478 | snd_hda_codec_set_pincfg(codec, cfg->nid, cfg->val); |
1475 | } | 1479 | } |
1476 | if (fix->verbs) | 1480 | if (!pre_init && fix->verbs) { |
1481 | #ifdef CONFIG_SND_DEBUG_VERBOSE | ||
1482 | snd_printdd(KERN_INFO "hda_codec: %s: Apply fix-verbs for %s\n", | ||
1483 | codec->chip_name, quirk->name); | ||
1484 | #endif | ||
1477 | add_verb(codec->spec, fix->verbs); | 1485 | add_verb(codec->spec, fix->verbs); |
1486 | } | ||
1478 | } | 1487 | } |
1479 | 1488 | ||
1480 | static int alc_read_coef_idx(struct hda_codec *codec, | 1489 | static int alc_read_coef_idx(struct hda_codec *codec, |
@@ -10535,7 +10544,8 @@ static int patch_alc882(struct hda_codec *codec) | |||
10535 | board_config = ALC882_AUTO; | 10544 | board_config = ALC882_AUTO; |
10536 | } | 10545 | } |
10537 | 10546 | ||
10538 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups); | 10547 | if (board_config == ALC882_AUTO) |
10548 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 1); | ||
10539 | 10549 | ||
10540 | if (board_config == ALC882_AUTO) { | 10550 | if (board_config == ALC882_AUTO) { |
10541 | /* automatic parse from the BIOS config */ | 10551 | /* automatic parse from the BIOS config */ |
@@ -10610,6 +10620,9 @@ static int patch_alc882(struct hda_codec *codec) | |||
10610 | if (spec->cdefine.enable_pcbeep) | 10620 | if (spec->cdefine.enable_pcbeep) |
10611 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); | 10621 | set_beep_amp(spec, 0x0b, 0x05, HDA_INPUT); |
10612 | 10622 | ||
10623 | if (board_config == ALC882_AUTO) | ||
10624 | alc_pick_fixup(codec, alc882_fixup_tbl, alc882_fixups, 0); | ||
10625 | |||
10613 | spec->vmaster_nid = 0x0c; | 10626 | spec->vmaster_nid = 0x0c; |
10614 | 10627 | ||
10615 | codec->patch_ops = alc_patch_ops; | 10628 | codec->patch_ops = alc_patch_ops; |
@@ -14192,6 +14205,27 @@ static void alc269_auto_init(struct hda_codec *codec) | |||
14192 | alc_inithook(codec); | 14205 | alc_inithook(codec); |
14193 | } | 14206 | } |
14194 | 14207 | ||
14208 | enum { | ||
14209 | ALC269_FIXUP_SONY_VAIO, | ||
14210 | }; | ||
14211 | |||
14212 | const static struct hda_verb alc269_sony_vaio_fixup_verbs[] = { | ||
14213 | {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREFGRD}, | ||
14214 | {} | ||
14215 | }; | ||
14216 | |||
14217 | static const struct alc_fixup alc269_fixups[] = { | ||
14218 | [ALC269_FIXUP_SONY_VAIO] = { | ||
14219 | .verbs = alc269_sony_vaio_fixup_verbs | ||
14220 | }, | ||
14221 | }; | ||
14222 | |||
14223 | static struct snd_pci_quirk alc269_fixup_tbl[] = { | ||
14224 | SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_FIXUP_SONY_VAIO), | ||
14225 | {} | ||
14226 | }; | ||
14227 | |||
14228 | |||
14195 | /* | 14229 | /* |
14196 | * configuration and preset | 14230 | * configuration and preset |
14197 | */ | 14231 | */ |
@@ -14251,7 +14285,7 @@ static struct snd_pci_quirk alc269_cfg_tbl[] = { | |||
14251 | ALC269_DMIC), | 14285 | ALC269_DMIC), |
14252 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), | 14286 | SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005HA", ALC269_DMIC), |
14253 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), | 14287 | SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005HA", ALC269_DMIC), |
14254 | SND_PCI_QUIRK(0x104d, 0x9071, "SONY XTB", ALC269_DMIC), | 14288 | SND_PCI_QUIRK(0x104d, 0x9071, "Sony VAIO", ALC269_AUTO), |
14255 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), | 14289 | SND_PCI_QUIRK(0x10cf, 0x1475, "Lifebook ICH9M-based", ALC269_LIFEBOOK), |
14256 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), | 14290 | SND_PCI_QUIRK(0x152d, 0x1778, "Quanta ON1", ALC269_DMIC), |
14257 | SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), | 14291 | SND_PCI_QUIRK(0x1734, 0x115d, "FSC Amilo", ALC269_FUJITSU), |
@@ -14405,6 +14439,9 @@ static int patch_alc269(struct hda_codec *codec) | |||
14405 | board_config = ALC269_AUTO; | 14439 | board_config = ALC269_AUTO; |
14406 | } | 14440 | } |
14407 | 14441 | ||
14442 | if (board_config == ALC269_AUTO) | ||
14443 | alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 1); | ||
14444 | |||
14408 | if (board_config == ALC269_AUTO) { | 14445 | if (board_config == ALC269_AUTO) { |
14409 | /* automatic parse from the BIOS config */ | 14446 | /* automatic parse from the BIOS config */ |
14410 | err = alc269_parse_auto_config(codec); | 14447 | err = alc269_parse_auto_config(codec); |
@@ -14458,6 +14495,9 @@ static int patch_alc269(struct hda_codec *codec) | |||
14458 | if (spec->cdefine.enable_pcbeep) | 14495 | if (spec->cdefine.enable_pcbeep) |
14459 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); | 14496 | set_beep_amp(spec, 0x0b, 0x04, HDA_INPUT); |
14460 | 14497 | ||
14498 | if (board_config == ALC269_AUTO) | ||
14499 | alc_pick_fixup(codec, alc269_fixup_tbl, alc269_fixups, 0); | ||
14500 | |||
14461 | spec->vmaster_nid = 0x02; | 14501 | spec->vmaster_nid = 0x02; |
14462 | 14502 | ||
14463 | codec->patch_ops = alc_patch_ops; | 14503 | codec->patch_ops = alc_patch_ops; |
@@ -15548,7 +15588,8 @@ static int patch_alc861(struct hda_codec *codec) | |||
15548 | board_config = ALC861_AUTO; | 15588 | board_config = ALC861_AUTO; |
15549 | } | 15589 | } |
15550 | 15590 | ||
15551 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups); | 15591 | if (board_config == ALC861_AUTO) |
15592 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 1); | ||
15552 | 15593 | ||
15553 | if (board_config == ALC861_AUTO) { | 15594 | if (board_config == ALC861_AUTO) { |
15554 | /* automatic parse from the BIOS config */ | 15595 | /* automatic parse from the BIOS config */ |
@@ -15585,6 +15626,9 @@ static int patch_alc861(struct hda_codec *codec) | |||
15585 | 15626 | ||
15586 | spec->vmaster_nid = 0x03; | 15627 | spec->vmaster_nid = 0x03; |
15587 | 15628 | ||
15629 | if (board_config == ALC861_AUTO) | ||
15630 | alc_pick_fixup(codec, alc861_fixup_tbl, alc861_fixups, 0); | ||
15631 | |||
15588 | codec->patch_ops = alc_patch_ops; | 15632 | codec->patch_ops = alc_patch_ops; |
15589 | if (board_config == ALC861_AUTO) { | 15633 | if (board_config == ALC861_AUTO) { |
15590 | spec->init_hook = alc861_auto_init; | 15634 | spec->init_hook = alc861_auto_init; |
@@ -16519,7 +16563,8 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
16519 | board_config = ALC861VD_AUTO; | 16563 | board_config = ALC861VD_AUTO; |
16520 | } | 16564 | } |
16521 | 16565 | ||
16522 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups); | 16566 | if (board_config == ALC861VD_AUTO) |
16567 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 1); | ||
16523 | 16568 | ||
16524 | if (board_config == ALC861VD_AUTO) { | 16569 | if (board_config == ALC861VD_AUTO) { |
16525 | /* automatic parse from the BIOS config */ | 16570 | /* automatic parse from the BIOS config */ |
@@ -16567,6 +16612,9 @@ static int patch_alc861vd(struct hda_codec *codec) | |||
16567 | 16612 | ||
16568 | spec->vmaster_nid = 0x02; | 16613 | spec->vmaster_nid = 0x02; |
16569 | 16614 | ||
16615 | if (board_config == ALC861VD_AUTO) | ||
16616 | alc_pick_fixup(codec, alc861vd_fixup_tbl, alc861vd_fixups, 0); | ||
16617 | |||
16570 | codec->patch_ops = alc_patch_ops; | 16618 | codec->patch_ops = alc_patch_ops; |
16571 | 16619 | ||
16572 | if (board_config == ALC861VD_AUTO) | 16620 | if (board_config == ALC861VD_AUTO) |