aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/pci/hda/patch_realtek.c57
1 files changed, 57 insertions, 0 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 804276685324..d7eb22f5ca38 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -724,6 +724,38 @@ static void alc_subsystem_id(struct hda_codec *codec,
724} 724}
725 725
726/* 726/*
727 * Fix-up pin default configurations
728 */
729
730struct alc_pincfg {
731 hda_nid_t nid;
732 u32 val;
733};
734
735static void alc_fix_pincfg(struct hda_codec *codec,
736 const struct snd_pci_quirk *quirk,
737 const struct alc_pincfg **pinfix)
738{
739 const struct alc_pincfg *cfg;
740
741 quirk = snd_pci_quirk_lookup(codec->bus->pci, quirk);
742 if (!quirk)
743 return;
744
745 cfg = pinfix[quirk->value];
746 for (; cfg->nid; cfg++) {
747 int i;
748 u32 val = cfg->val;
749 for (i = 0; i < 4; i++) {
750 snd_hda_codec_write(codec, cfg->nid, 0,
751 AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 + i,
752 val & 0xff);
753 val >>= 8;
754 }
755 }
756}
757
758/*
727 * ALC880 3-stack model 759 * ALC880 3-stack model
728 * 760 *
729 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e) 761 * DAC: Front = 0x02 (0x0c), Surr = 0x05 (0x0f), CLFE = 0x04 (0x0e)
@@ -5410,6 +5442,29 @@ static struct alc_config_preset alc882_presets[] = {
5410 5442
5411 5443
5412/* 5444/*
5445 * Pin config fixes
5446 */
5447enum {
5448 PINFIX_ABIT_AW9D_MAX
5449};
5450
5451static struct alc_pincfg alc882_abit_aw9d_pinfix[] = {
5452 { 0x15, 0x01080104 }, /* side */
5453 { 0x16, 0x01011012 }, /* rear */
5454 { 0x17, 0x01016011 }, /* clfe */
5455 { }
5456};
5457
5458static const struct alc_pincfg *alc882_pin_fixes[] = {
5459 [PINFIX_ABIT_AW9D_MAX] = alc882_abit_aw9d_pinfix,
5460};
5461
5462static struct snd_pci_quirk alc882_pinfix_tbl[] = {
5463 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
5464 {}
5465};
5466
5467/*
5413 * BIOS auto configuration 5468 * BIOS auto configuration
5414 */ 5469 */
5415static void alc882_auto_set_output_and_unmute(struct hda_codec *codec, 5470static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
@@ -5532,6 +5587,8 @@ static int patch_alc882(struct hda_codec *codec)
5532 } 5587 }
5533 } 5588 }
5534 5589
5590 alc_fix_pincfg(codec, alc882_pinfix_tbl, alc882_pin_fixes);
5591
5535 if (board_config == ALC882_AUTO) { 5592 if (board_config == ALC882_AUTO) {
5536 /* automatic parse from the BIOS config */ 5593 /* automatic parse from the BIOS config */
5537 err = alc882_parse_auto_config(codec); 5594 err = alc882_parse_auto_config(codec);