aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-06-25 04:52:25 -0400
committerTakashi Iwai <tiwai@suse.de>2012-06-25 04:52:25 -0400
commit6e72aa5f511daa2ffbd333ea99635c551b86013b (patch)
tree152dbc523a03a1f7730628169dfd8cab9d818587 /sound/pci
parent693b613dc4657e3f9af2625e0097b1870c78bf8c (diff)
ALSA: hda - Add inv-dmic model to possible Realtek codecs
For convenience, add "inv-dmic" model string for enabling the inverted internal mic workaround to possible Realtek codecs, so far, ALC882-variants, ALC262, ALC268, ALC269-variants, and ALC662-variants. Also, the model strings for hardware inv-dmic workarounds, "alc269-dmic" and "alc271-dmic", are added for ALC269(VA) and ALC271 codecs as well. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c64
1 files changed, 52 insertions, 12 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index d11fd0160748..3e698e239dd8 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1784,6 +1784,14 @@ static int alc_add_inv_dmic_mixer(struct hda_codec *codec, hda_nid_t nid)
1784 return 0; 1784 return 0;
1785} 1785}
1786 1786
1787/* typically the digital mic is put at node 0x12 */
1788static void alc_fixup_inv_dmic_0x12(struct hda_codec *codec,
1789 const struct alc_fixup *fix, int action)
1790{
1791 if (action == ALC_FIXUP_ACT_PROBE)
1792 alc_add_inv_dmic_mixer(codec, 0x12);
1793}
1794
1787/* 1795/*
1788 * virtual master controls 1796 * virtual master controls
1789 */ 1797 */
@@ -5017,6 +5025,7 @@ enum {
5017 ALC889_FIXUP_DAC_ROUTE, 5025 ALC889_FIXUP_DAC_ROUTE,
5018 ALC889_FIXUP_MBP_VREF, 5026 ALC889_FIXUP_MBP_VREF,
5019 ALC889_FIXUP_IMAC91_VREF, 5027 ALC889_FIXUP_IMAC91_VREF,
5028 ALC882_FIXUP_INV_DMIC,
5020}; 5029};
5021 5030
5022static void alc889_fixup_coef(struct hda_codec *codec, 5031static void alc889_fixup_coef(struct hda_codec *codec,
@@ -5320,6 +5329,10 @@ static const struct alc_fixup alc882_fixups[] = {
5320 .chained = true, 5329 .chained = true,
5321 .chain_id = ALC882_FIXUP_GPIO1, 5330 .chain_id = ALC882_FIXUP_GPIO1,
5322 }, 5331 },
5332 [ALC882_FIXUP_INV_DMIC] = {
5333 .type = ALC_FIXUP_FUNC,
5334 .v.func = alc_fixup_inv_dmic_0x12,
5335 },
5323}; 5336};
5324 5337
5325static const struct snd_pci_quirk alc882_fixup_tbl[] = { 5338static const struct snd_pci_quirk alc882_fixup_tbl[] = {
@@ -5394,6 +5407,7 @@ static const struct alc_model_fixup alc882_fixup_models[] = {
5394 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"}, 5407 {.id = ALC882_FIXUP_ACER_ASPIRE_4930G, .name = "acer-aspire-4930g"},
5395 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"}, 5408 {.id = ALC882_FIXUP_ACER_ASPIRE_8930G, .name = "acer-aspire-8930g"},
5396 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"}, 5409 {.id = ALC883_FIXUP_ACER_EAPD, .name = "acer-aspire"},
5410 {.id = ALC882_FIXUP_INV_DMIC, .name = "inv-dmic"},
5397 {} 5411 {}
5398}; 5412};
5399 5413
@@ -5481,6 +5495,7 @@ enum {
5481 ALC262_FIXUP_LENOVO_3000, 5495 ALC262_FIXUP_LENOVO_3000,
5482 ALC262_FIXUP_BENQ, 5496 ALC262_FIXUP_BENQ,
5483 ALC262_FIXUP_BENQ_T31, 5497 ALC262_FIXUP_BENQ_T31,
5498 ALC262_FIXUP_INV_DMIC,
5484}; 5499};
5485 5500
5486static const struct alc_fixup alc262_fixups[] = { 5501static const struct alc_fixup alc262_fixups[] = {
@@ -5532,6 +5547,10 @@ static const struct alc_fixup alc262_fixups[] = {
5532 {} 5547 {}
5533 } 5548 }
5534 }, 5549 },
5550 [ALC262_FIXUP_INV_DMIC] = {
5551 .type = ALC_FIXUP_FUNC,
5552 .v.func = alc_fixup_inv_dmic_0x12,
5553 },
5535}; 5554};
5536 5555
5537static const struct snd_pci_quirk alc262_fixup_tbl[] = { 5556static const struct snd_pci_quirk alc262_fixup_tbl[] = {
@@ -5546,6 +5565,10 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = {
5546 {} 5565 {}
5547}; 5566};
5548 5567
5568static const struct alc_model_fixup alc262_fixup_models[] = {
5569 {.id = ALC262_FIXUP_INV_DMIC, .name = "inv-dmic"},
5570 {}
5571};
5549 5572
5550/* 5573/*
5551 */ 5574 */
@@ -5574,7 +5597,8 @@ static int patch_alc262(struct hda_codec *codec)
5574#endif 5597#endif
5575 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 5598 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
5576 5599
5577 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); 5600 alc_pick_fixup(codec, alc262_fixup_models, alc262_fixup_tbl,
5601 alc262_fixups);
5578 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 5602 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
5579 5603
5580 alc_auto_parse_customize_define(codec); 5604 alc_auto_parse_customize_define(codec);
@@ -5630,6 +5654,22 @@ static const struct hda_verb alc268_beep_init_verbs[] = {
5630 { } 5654 { }
5631}; 5655};
5632 5656
5657enum {
5658 ALC268_FIXUP_INV_DMIC,
5659};
5660
5661static const struct alc_fixup alc268_fixups[] = {
5662 [ALC268_FIXUP_INV_DMIC] = {
5663 .type = ALC_FIXUP_FUNC,
5664 .v.func = alc_fixup_inv_dmic_0x12,
5665 },
5666};
5667
5668static const struct alc_model_fixup alc268_fixup_models[] = {
5669 {.id = ALC268_FIXUP_INV_DMIC, .name = "inv-dmic"},
5670 {}
5671};
5672
5633/* 5673/*
5634 * BIOS auto configuration 5674 * BIOS auto configuration
5635 */ 5675 */
@@ -5661,6 +5701,9 @@ static int patch_alc268(struct hda_codec *codec)
5661 5701
5662 spec = codec->spec; 5702 spec = codec->spec;
5663 5703
5704 alc_pick_fixup(codec, alc268_fixup_models, NULL, alc268_fixups);
5705 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
5706
5664 /* automatic parse from the BIOS config */ 5707 /* automatic parse from the BIOS config */
5665 err = alc268_parse_auto_config(codec); 5708 err = alc268_parse_auto_config(codec);
5666 if (err < 0) 5709 if (err < 0)
@@ -5690,6 +5733,8 @@ static int patch_alc268(struct hda_codec *codec)
5690 codec->patch_ops = alc_patch_ops; 5733 codec->patch_ops = alc_patch_ops;
5691 spec->shutup = alc_eapd_shutup; 5734 spec->shutup = alc_eapd_shutup;
5692 5735
5736 alc_apply_fixup(codec, ALC_FIXUP_ACT_PROBE);
5737
5693 return 0; 5738 return 0;
5694 5739
5695 error: 5740 error:
@@ -5918,13 +5963,6 @@ static void alc269_fixup_mic2_mute(struct hda_codec *codec,
5918 } 5963 }
5919} 5964}
5920 5965
5921static void alc269_fixup_inv_dmic(struct hda_codec *codec,
5922 const struct alc_fixup *fix, int action)
5923{
5924 if (action == ALC_FIXUP_ACT_PROBE)
5925 alc_add_inv_dmic_mixer(codec, 0x12);
5926}
5927
5928 5966
5929enum { 5967enum {
5930 ALC269_FIXUP_SONY_VAIO, 5968 ALC269_FIXUP_SONY_VAIO,
@@ -6071,7 +6109,7 @@ static const struct alc_fixup alc269_fixups[] = {
6071 }, 6109 },
6072 [ALC269_FIXUP_INV_DMIC] = { 6110 [ALC269_FIXUP_INV_DMIC] = {
6073 .type = ALC_FIXUP_FUNC, 6111 .type = ALC_FIXUP_FUNC,
6074 .v.func = alc269_fixup_inv_dmic, 6112 .v.func = alc_fixup_inv_dmic_0x12,
6075 }, 6113 },
6076}; 6114};
6077 6115
@@ -6157,6 +6195,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
6157static const struct alc_model_fixup alc269_fixup_models[] = { 6195static const struct alc_model_fixup alc269_fixup_models[] = {
6158 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"}, 6196 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
6159 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"}, 6197 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
6198 {.id = ALC269_FIXUP_STEREO_DMIC, .name = "alc269-dmic"},
6199 {.id = ALC271_FIXUP_DMIC, .name = "alc271-dmic"},
6200 {.id = ALC269_FIXUP_INV_DMIC, .name = "inv-dmic"},
6160 {} 6201 {}
6161}; 6202};
6162 6203
@@ -6550,8 +6591,6 @@ static void alc272_fixup_mario(struct hda_codec *codec,
6550 "hda_codec: failed to override amp caps for NID 0x2\n"); 6591 "hda_codec: failed to override amp caps for NID 0x2\n");
6551} 6592}
6552 6593
6553#define alc662_fixup_inv_dmic alc269_fixup_inv_dmic
6554
6555enum { 6594enum {
6556 ALC662_FIXUP_ASPIRE, 6595 ALC662_FIXUP_ASPIRE,
6557 ALC662_FIXUP_IDEAPAD, 6596 ALC662_FIXUP_IDEAPAD,
@@ -6728,7 +6767,7 @@ static const struct alc_fixup alc662_fixups[] = {
6728 }, 6767 },
6729 [ALC662_FIXUP_INV_DMIC] = { 6768 [ALC662_FIXUP_INV_DMIC] = {
6730 .type = ALC_FIXUP_FUNC, 6769 .type = ALC_FIXUP_FUNC,
6731 .v.func = alc662_fixup_inv_dmic, 6770 .v.func = alc_fixup_inv_dmic_0x12,
6732 }, 6771 },
6733}; 6772};
6734 6773
@@ -6817,6 +6856,7 @@ static const struct alc_model_fixup alc662_fixup_models[] = {
6817 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"}, 6856 {.id = ALC662_FIXUP_ASUS_MODE6, .name = "asus-mode6"},
6818 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"}, 6857 {.id = ALC662_FIXUP_ASUS_MODE7, .name = "asus-mode7"},
6819 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"}, 6858 {.id = ALC662_FIXUP_ASUS_MODE8, .name = "asus-mode8"},
6859 {.id = ALC662_FIXUP_INV_DMIC, .name = "inv-dmic"},
6820 {} 6860 {}
6821}; 6861};
6822 6862