aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_realtek.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/hda/patch_realtek.c')
-rw-r--r--sound/pci/hda/patch_realtek.c379
1 files changed, 256 insertions, 123 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index c5646941539a..8d0a84436674 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -118,7 +118,8 @@ struct alc_spec {
118 118
119 int init_amp; 119 int init_amp;
120 int codec_variant; /* flag for other variants */ 120 int codec_variant; /* flag for other variants */
121 bool has_alc5505_dsp; 121 unsigned int has_alc5505_dsp:1;
122 unsigned int no_depop_delay:1;
122 123
123 /* for PLL fix */ 124 /* for PLL fix */
124 hda_nid_t pll_nid; 125 hda_nid_t pll_nid;
@@ -280,8 +281,11 @@ static void alc_auto_setup_eapd(struct hda_codec *codec, bool on)
280 */ 281 */
281static void alc_eapd_shutup(struct hda_codec *codec) 282static void alc_eapd_shutup(struct hda_codec *codec)
282{ 283{
284 struct alc_spec *spec = codec->spec;
285
283 alc_auto_setup_eapd(codec, false); 286 alc_auto_setup_eapd(codec, false);
284 msleep(200); 287 if (!spec->no_depop_delay)
288 msleep(200);
285 snd_hda_shutup_pins(codec); 289 snd_hda_shutup_pins(codec);
286} 290}
287 291
@@ -365,6 +369,17 @@ static void alc_fixup_sku_ignore(struct hda_codec *codec,
365 } 369 }
366} 370}
367 371
372static void alc_fixup_no_depop_delay(struct hda_codec *codec,
373 const struct hda_fixup *fix, int action)
374{
375 struct alc_spec *spec = codec->spec;
376
377 if (action == HDA_FIXUP_ACT_PROBE) {
378 spec->no_depop_delay = 1;
379 codec->depop_delay = 0;
380 }
381}
382
368static int alc_auto_parse_customize_define(struct hda_codec *codec) 383static int alc_auto_parse_customize_define(struct hda_codec *codec)
369{ 384{
370 unsigned int ass, tmp, i; 385 unsigned int ass, tmp, i;
@@ -454,9 +469,7 @@ static bool found_in_nid_list(hda_nid_t nid, const hda_nid_t *list, int nums)
454 * 7 ~ 0 : Assembly ID 469 * 7 ~ 0 : Assembly ID
455 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36 470 * port-A --> pin 39/41, port-E --> pin 14/15, port-D --> pin 35/36
456 */ 471 */
457static int alc_subsystem_id(struct hda_codec *codec, 472static int alc_subsystem_id(struct hda_codec *codec, const hda_nid_t *ports)
458 hda_nid_t porta, hda_nid_t porte,
459 hda_nid_t portd, hda_nid_t porti)
460{ 473{
461 unsigned int ass, tmp, i; 474 unsigned int ass, tmp, i;
462 unsigned nid; 475 unsigned nid;
@@ -546,14 +559,7 @@ do_sku:
546 spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) { 559 spec->gen.autocfg.line_out_type == AUTO_PIN_HP_OUT)) {
547 hda_nid_t nid; 560 hda_nid_t nid;
548 tmp = (ass >> 11) & 0x3; /* HP to chassis */ 561 tmp = (ass >> 11) & 0x3; /* HP to chassis */
549 if (tmp == 0) 562 nid = ports[tmp];
550 nid = porta;
551 else if (tmp == 1)
552 nid = porte;
553 else if (tmp == 2)
554 nid = portd;
555 else if (tmp == 3)
556 nid = porti;
557 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins, 563 if (found_in_nid_list(nid, spec->gen.autocfg.line_out_pins,
558 spec->gen.autocfg.line_outs)) 564 spec->gen.autocfg.line_outs))
559 return 1; 565 return 1;
@@ -566,7 +572,7 @@ do_sku:
566 * ports contains an array of 4 pin NIDs for port-A, E, D and I */ 572 * ports contains an array of 4 pin NIDs for port-A, E, D and I */
567static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports) 573static void alc_ssid_check(struct hda_codec *codec, const hda_nid_t *ports)
568{ 574{
569 if (!alc_subsystem_id(codec, ports[0], ports[1], ports[2], ports[3])) { 575 if (!alc_subsystem_id(codec, ports)) {
570 struct alc_spec *spec = codec->spec; 576 struct alc_spec *spec = codec->spec;
571 snd_printd("realtek: " 577 snd_printd("realtek: "
572 "Enable default setup for auto mode as fallback\n"); 578 "Enable default setup for auto mode as fallback\n");
@@ -702,7 +708,8 @@ static void alc_inv_dmic_sync(struct hda_codec *codec, bool force)
702} 708}
703 709
704static void alc_inv_dmic_hook(struct hda_codec *codec, 710static void alc_inv_dmic_hook(struct hda_codec *codec,
705 struct snd_ctl_elem_value *ucontrol) 711 struct snd_kcontrol *kcontrol,
712 struct snd_ctl_elem_value *ucontrol)
706{ 713{
707 alc_inv_dmic_sync(codec, false); 714 alc_inv_dmic_sync(codec, false);
708} 715}
@@ -863,7 +870,10 @@ static int alc_suspend(struct hda_codec *codec)
863#ifdef CONFIG_PM 870#ifdef CONFIG_PM
864static int alc_resume(struct hda_codec *codec) 871static int alc_resume(struct hda_codec *codec)
865{ 872{
866 msleep(150); /* to avoid pop noise */ 873 struct alc_spec *spec = codec->spec;
874
875 if (!spec->no_depop_delay)
876 msleep(150); /* to avoid pop noise */
867 codec->patch_ops.init(codec); 877 codec->patch_ops.init(codec);
868 snd_hda_codec_resume_amp(codec); 878 snd_hda_codec_resume_amp(codec);
869 snd_hda_codec_resume_cache(codec); 879 snd_hda_codec_resume_cache(codec);
@@ -903,7 +913,7 @@ static int alc_codec_rename(struct hda_codec *codec, const char *name)
903} 913}
904 914
905/* 915/*
906 * Rename codecs appropriately from COEF value 916 * Rename codecs appropriately from COEF value or subvendor id
907 */ 917 */
908struct alc_codec_rename_table { 918struct alc_codec_rename_table {
909 unsigned int vendor_id; 919 unsigned int vendor_id;
@@ -912,6 +922,13 @@ struct alc_codec_rename_table {
912 const char *name; 922 const char *name;
913}; 923};
914 924
925struct alc_codec_rename_pci_table {
926 unsigned int codec_vendor_id;
927 unsigned short pci_subvendor;
928 unsigned short pci_subdevice;
929 const char *name;
930};
931
915static struct alc_codec_rename_table rename_tbl[] = { 932static struct alc_codec_rename_table rename_tbl[] = {
916 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" }, 933 { 0x10ec0269, 0xfff0, 0x3010, "ALC277" },
917 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" }, 934 { 0x10ec0269, 0xf0f0, 0x2010, "ALC259" },
@@ -931,9 +948,20 @@ static struct alc_codec_rename_table rename_tbl[] = {
931 { } /* terminator */ 948 { } /* terminator */
932}; 949};
933 950
951static struct alc_codec_rename_pci_table rename_pci_tbl[] = {
952 { 0x10ec0280, 0x1028, 0, "ALC3220" },
953 { 0x10ec0282, 0x1028, 0, "ALC3221" },
954 { 0x10ec0283, 0x1028, 0, "ALC3223" },
955 { 0x10ec0292, 0x1028, 0, "ALC3226" },
956 { 0x10ec0255, 0x1028, 0, "ALC3234" },
957 { 0x10ec0668, 0x1028, 0, "ALC3661" },
958 { } /* terminator */
959};
960
934static int alc_codec_rename_from_preset(struct hda_codec *codec) 961static int alc_codec_rename_from_preset(struct hda_codec *codec)
935{ 962{
936 const struct alc_codec_rename_table *p; 963 const struct alc_codec_rename_table *p;
964 const struct alc_codec_rename_pci_table *q;
937 965
938 for (p = rename_tbl; p->vendor_id; p++) { 966 for (p = rename_tbl; p->vendor_id; p++) {
939 if (p->vendor_id != codec->vendor_id) 967 if (p->vendor_id != codec->vendor_id)
@@ -941,6 +969,17 @@ static int alc_codec_rename_from_preset(struct hda_codec *codec)
941 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits) 969 if ((alc_get_coef0(codec) & p->coef_mask) == p->coef_bits)
942 return alc_codec_rename(codec, p->name); 970 return alc_codec_rename(codec, p->name);
943 } 971 }
972
973 for (q = rename_pci_tbl; q->codec_vendor_id; q++) {
974 if (q->codec_vendor_id != codec->vendor_id)
975 continue;
976 if (q->pci_subvendor != codec->bus->pci->subsystem_vendor)
977 continue;
978 if (!q->pci_subdevice ||
979 q->pci_subdevice == codec->bus->pci->subsystem_device)
980 return alc_codec_rename(codec, q->name);
981 }
982
944 return 0; 983 return 0;
945} 984}
946 985
@@ -1763,6 +1802,7 @@ enum {
1763 ALC882_FIXUP_ACER_ASPIRE_7736, 1802 ALC882_FIXUP_ACER_ASPIRE_7736,
1764 ALC882_FIXUP_ASUS_W90V, 1803 ALC882_FIXUP_ASUS_W90V,
1765 ALC889_FIXUP_CD, 1804 ALC889_FIXUP_CD,
1805 ALC889_FIXUP_FRONT_HP_NO_PRESENCE,
1766 ALC889_FIXUP_VAIO_TT, 1806 ALC889_FIXUP_VAIO_TT,
1767 ALC888_FIXUP_EEE1601, 1807 ALC888_FIXUP_EEE1601,
1768 ALC882_FIXUP_EAPD, 1808 ALC882_FIXUP_EAPD,
@@ -1780,7 +1820,9 @@ enum {
1780 ALC889_FIXUP_DAC_ROUTE, 1820 ALC889_FIXUP_DAC_ROUTE,
1781 ALC889_FIXUP_MBP_VREF, 1821 ALC889_FIXUP_MBP_VREF,
1782 ALC889_FIXUP_IMAC91_VREF, 1822 ALC889_FIXUP_IMAC91_VREF,
1823 ALC889_FIXUP_MBA11_VREF,
1783 ALC889_FIXUP_MBA21_VREF, 1824 ALC889_FIXUP_MBA21_VREF,
1825 ALC889_FIXUP_MP11_VREF,
1784 ALC882_FIXUP_INV_DMIC, 1826 ALC882_FIXUP_INV_DMIC,
1785 ALC882_FIXUP_NO_PRIMARY_HP, 1827 ALC882_FIXUP_NO_PRIMARY_HP,
1786 ALC887_FIXUP_ASUS_BASS, 1828 ALC887_FIXUP_ASUS_BASS,
@@ -1910,6 +1952,16 @@ static void alc889_fixup_imac91_vref(struct hda_codec *codec,
1910 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids)); 1952 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1911} 1953}
1912 1954
1955/* Set VREF on speaker pins on mba11 */
1956static void alc889_fixup_mba11_vref(struct hda_codec *codec,
1957 const struct hda_fixup *fix, int action)
1958{
1959 static hda_nid_t nids[1] = { 0x18 };
1960
1961 if (action == HDA_FIXUP_ACT_INIT)
1962 alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
1963}
1964
1913/* Set VREF on speaker pins on mba21 */ 1965/* Set VREF on speaker pins on mba21 */
1914static void alc889_fixup_mba21_vref(struct hda_codec *codec, 1966static void alc889_fixup_mba21_vref(struct hda_codec *codec,
1915 const struct hda_fixup *fix, int action) 1967 const struct hda_fixup *fix, int action)
@@ -1980,6 +2032,15 @@ static const struct hda_fixup alc882_fixups[] = {
1980 { } 2032 { }
1981 } 2033 }
1982 }, 2034 },
2035 [ALC889_FIXUP_FRONT_HP_NO_PRESENCE] = {
2036 .type = HDA_FIXUP_PINS,
2037 .v.pins = (const struct hda_pintbl[]) {
2038 { 0x1b, 0x02214120 }, /* Front HP jack is flaky, disable jack detect */
2039 { }
2040 },
2041 .chained = true,
2042 .chain_id = ALC889_FIXUP_CD,
2043 },
1983 [ALC889_FIXUP_VAIO_TT] = { 2044 [ALC889_FIXUP_VAIO_TT] = {
1984 .type = HDA_FIXUP_PINS, 2045 .type = HDA_FIXUP_PINS,
1985 .v.pins = (const struct hda_pintbl[]) { 2046 .v.pins = (const struct hda_pintbl[]) {
@@ -2119,12 +2180,24 @@ static const struct hda_fixup alc882_fixups[] = {
2119 .chained = true, 2180 .chained = true,
2120 .chain_id = ALC882_FIXUP_GPIO1, 2181 .chain_id = ALC882_FIXUP_GPIO1,
2121 }, 2182 },
2183 [ALC889_FIXUP_MBA11_VREF] = {
2184 .type = HDA_FIXUP_FUNC,
2185 .v.func = alc889_fixup_mba11_vref,
2186 .chained = true,
2187 .chain_id = ALC889_FIXUP_MBP_VREF,
2188 },
2122 [ALC889_FIXUP_MBA21_VREF] = { 2189 [ALC889_FIXUP_MBA21_VREF] = {
2123 .type = HDA_FIXUP_FUNC, 2190 .type = HDA_FIXUP_FUNC,
2124 .v.func = alc889_fixup_mba21_vref, 2191 .v.func = alc889_fixup_mba21_vref,
2125 .chained = true, 2192 .chained = true,
2126 .chain_id = ALC889_FIXUP_MBP_VREF, 2193 .chain_id = ALC889_FIXUP_MBP_VREF,
2127 }, 2194 },
2195 [ALC889_FIXUP_MP11_VREF] = {
2196 .type = HDA_FIXUP_FUNC,
2197 .v.func = alc889_fixup_mba11_vref,
2198 .chained = true,
2199 .chain_id = ALC885_FIXUP_MACPRO_GPIO,
2200 },
2128 [ALC882_FIXUP_INV_DMIC] = { 2201 [ALC882_FIXUP_INV_DMIC] = {
2129 .type = HDA_FIXUP_FUNC, 2202 .type = HDA_FIXUP_FUNC,
2130 .v.func = alc_fixup_inv_dmic_0x12, 2203 .v.func = alc_fixup_inv_dmic_0x12,
@@ -2188,13 +2261,13 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2188 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF), 2261 SND_PCI_QUIRK(0x106b, 0x00a0, "MacBookPro 3,1", ALC889_FIXUP_MBP_VREF),
2189 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF), 2262 SND_PCI_QUIRK(0x106b, 0x00a1, "Macbook", ALC889_FIXUP_MBP_VREF),
2190 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2263 SND_PCI_QUIRK(0x106b, 0x00a4, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
2191 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC885_FIXUP_MACPRO_GPIO), 2264 SND_PCI_QUIRK(0x106b, 0x0c00, "Mac Pro", ALC889_FIXUP_MP11_VREF),
2192 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO), 2265 SND_PCI_QUIRK(0x106b, 0x1000, "iMac 24", ALC885_FIXUP_MACPRO_GPIO),
2193 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO), 2266 SND_PCI_QUIRK(0x106b, 0x2800, "AppleTV", ALC885_FIXUP_MACPRO_GPIO),
2194 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF), 2267 SND_PCI_QUIRK(0x106b, 0x2c00, "MacbookPro rev3", ALC889_FIXUP_MBP_VREF),
2195 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF), 2268 SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
2196 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD), 2269 SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
2197 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF), 2270 SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBA11_VREF),
2198 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF), 2271 SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
2199 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF), 2272 SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
2200 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF), 2273 SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
@@ -2211,7 +2284,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
2211 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 2284 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
2212 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD), 2285 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
2213 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 2286 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
2214 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), 2287 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3/Z87X-UD3H", ALC889_FIXUP_FRONT_HP_NO_PRESENCE),
2215 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 2288 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
2216 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD), 2289 SND_PCI_QUIRK_VENDOR(0x1558, "Clevo laptop", ALC882_FIXUP_EAPD),
2217 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD), 2290 SND_PCI_QUIRK(0x161f, 0x2054, "Medion laptop", ALC883_FIXUP_EAPD),
@@ -2314,6 +2387,7 @@ enum {
2314 ALC262_FIXUP_BENQ, 2387 ALC262_FIXUP_BENQ,
2315 ALC262_FIXUP_BENQ_T31, 2388 ALC262_FIXUP_BENQ_T31,
2316 ALC262_FIXUP_INV_DMIC, 2389 ALC262_FIXUP_INV_DMIC,
2390 ALC262_FIXUP_INTEL_BAYLEYBAY,
2317}; 2391};
2318 2392
2319static const struct hda_fixup alc262_fixups[] = { 2393static const struct hda_fixup alc262_fixups[] = {
@@ -2378,6 +2452,10 @@ static const struct hda_fixup alc262_fixups[] = {
2378 .type = HDA_FIXUP_FUNC, 2452 .type = HDA_FIXUP_FUNC,
2379 .v.func = alc_fixup_inv_dmic_0x12, 2453 .v.func = alc_fixup_inv_dmic_0x12,
2380 }, 2454 },
2455 [ALC262_FIXUP_INTEL_BAYLEYBAY] = {
2456 .type = HDA_FIXUP_FUNC,
2457 .v.func = alc_fixup_no_depop_delay,
2458 },
2381}; 2459};
2382 2460
2383static const struct snd_pci_quirk alc262_fixup_tbl[] = { 2461static const struct snd_pci_quirk alc262_fixup_tbl[] = {
@@ -2389,6 +2467,7 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = {
2389 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000), 2467 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
2390 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ), 2468 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
2391 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31), 2469 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_FIXUP_BENQ_T31),
2470 SND_PCI_QUIRK(0x8086, 0x7270, "BayleyBay", ALC262_FIXUP_INTEL_BAYLEYBAY),
2392 {} 2471 {}
2393}; 2472};
2394 2473
@@ -3140,7 +3219,8 @@ static void alc269_fixup_hp_gpio_mute_hook(void *private_data, int enabled)
3140 3219
3141/* turn on/off mic-mute LED per capture hook */ 3220/* turn on/off mic-mute LED per capture hook */
3142static void alc269_fixup_hp_gpio_mic_mute_hook(struct hda_codec *codec, 3221static void alc269_fixup_hp_gpio_mic_mute_hook(struct hda_codec *codec,
3143 struct snd_ctl_elem_value *ucontrol) 3222 struct snd_kcontrol *kcontrol,
3223 struct snd_ctl_elem_value *ucontrol)
3144{ 3224{
3145 struct alc_spec *spec = codec->spec; 3225 struct alc_spec *spec = codec->spec;
3146 unsigned int oldval = spec->gpio_led; 3226 unsigned int oldval = spec->gpio_led;
@@ -3450,7 +3530,8 @@ static void alc_update_headset_mode(struct hda_codec *codec)
3450} 3530}
3451 3531
3452static void alc_update_headset_mode_hook(struct hda_codec *codec, 3532static void alc_update_headset_mode_hook(struct hda_codec *codec,
3453 struct snd_ctl_elem_value *ucontrol) 3533 struct snd_kcontrol *kcontrol,
3534 struct snd_ctl_elem_value *ucontrol)
3454{ 3535{
3455 alc_update_headset_mode(codec); 3536 alc_update_headset_mode(codec);
3456} 3537}
@@ -3526,6 +3607,28 @@ static void alc_fixup_headset_mode_alc255(struct hda_codec *codec,
3526 alc_fixup_headset_mode(codec, fix, action); 3607 alc_fixup_headset_mode(codec, fix, action);
3527} 3608}
3528 3609
3610static void alc_fixup_auto_mute_via_amp(struct hda_codec *codec,
3611 const struct hda_fixup *fix, int action)
3612{
3613 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3614 struct alc_spec *spec = codec->spec;
3615 spec->gen.auto_mute_via_amp = 1;
3616 }
3617}
3618
3619static void alc_no_shutup(struct hda_codec *codec)
3620{
3621}
3622
3623static void alc_fixup_no_shutup(struct hda_codec *codec,
3624 const struct hda_fixup *fix, int action)
3625{
3626 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3627 struct alc_spec *spec = codec->spec;
3628 spec->shutup = alc_no_shutup;
3629 }
3630}
3631
3529static void alc_fixup_headset_mode_alc668(struct hda_codec *codec, 3632static void alc_fixup_headset_mode_alc668(struct hda_codec *codec,
3530 const struct hda_fixup *fix, int action) 3633 const struct hda_fixup *fix, int action)
3531{ 3634{
@@ -3717,101 +3820,18 @@ static void alc282_fixup_asus_tx300(struct hda_codec *codec,
3717static void alc290_fixup_mono_speakers(struct hda_codec *codec, 3820static void alc290_fixup_mono_speakers(struct hda_codec *codec,
3718 const struct hda_fixup *fix, int action) 3821 const struct hda_fixup *fix, int action)
3719{ 3822{
3720 if (action == HDA_FIXUP_ACT_PRE_PROBE) 3823 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3721 /* Remove DAC node 0x03, as it seems to be 3824 /* DAC node 0x03 is giving mono output. We therefore want to
3722 giving mono output */ 3825 make sure 0x14 (front speaker) and 0x15 (headphones) use the
3723 snd_hda_override_wcaps(codec, 0x03, 0); 3826 stereo DAC, while leaving 0x17 (bass speaker) for node 0x03. */
3724} 3827 hda_nid_t conn1[2] = { 0x0c };
3725 3828 snd_hda_override_conn_list(codec, 0x14, 1, conn1);
3726#if IS_ENABLED(CONFIG_THINKPAD_ACPI) 3829 snd_hda_override_conn_list(codec, 0x15, 1, conn1);
3727
3728#include <linux/thinkpad_acpi.h>
3729#include <acpi/acpi.h>
3730
3731static int (*led_set_func)(int, bool);
3732
3733static acpi_status acpi_check_cb(acpi_handle handle, u32 lvl, void *context,
3734 void **rv)
3735{
3736 bool *found = context;
3737 *found = true;
3738 return AE_OK;
3739}
3740
3741static bool is_thinkpad(struct hda_codec *codec)
3742{
3743 bool found = false;
3744 if (codec->subsystem_id >> 16 != 0x17aa)
3745 return false;
3746 if (ACPI_SUCCESS(acpi_get_devices("LEN0068", acpi_check_cb, &found, NULL)) && found)
3747 return true;
3748 found = false;
3749 return ACPI_SUCCESS(acpi_get_devices("IBM0068", acpi_check_cb, &found, NULL)) && found;
3750}
3751
3752static void update_tpacpi_mute_led(void *private_data, int enabled)
3753{
3754 if (led_set_func)
3755 led_set_func(TPACPI_LED_MUTE, !enabled);
3756}
3757
3758static void update_tpacpi_micmute_led(struct hda_codec *codec,
3759 struct snd_ctl_elem_value *ucontrol)
3760{
3761 if (!ucontrol || !led_set_func)
3762 return;
3763 if (strcmp("Capture Switch", ucontrol->id.name) == 0 && ucontrol->id.index == 0) {
3764 /* TODO: How do I verify if it's a mono or stereo here? */
3765 bool val = ucontrol->value.integer.value[0] || ucontrol->value.integer.value[1];
3766 led_set_func(TPACPI_LED_MICMUTE, !val);
3767 }
3768}
3769
3770static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
3771 const struct hda_fixup *fix, int action)
3772{
3773 struct alc_spec *spec = codec->spec;
3774 bool removefunc = false;
3775
3776 if (action == HDA_FIXUP_ACT_PROBE) {
3777 if (!is_thinkpad(codec))
3778 return;
3779 if (!led_set_func)
3780 led_set_func = symbol_request(tpacpi_led_set);
3781 if (!led_set_func) {
3782 snd_printk(KERN_WARNING "Failed to find thinkpad-acpi symbol tpacpi_led_set\n");
3783 return;
3784 }
3785
3786 removefunc = true;
3787 if (led_set_func(TPACPI_LED_MUTE, false) >= 0) {
3788 spec->gen.vmaster_mute.hook = update_tpacpi_mute_led;
3789 removefunc = false;
3790 }
3791 if (led_set_func(TPACPI_LED_MICMUTE, false) >= 0) {
3792 if (spec->gen.num_adc_nids > 1)
3793 snd_printdd("Skipping micmute LED control due to several ADCs");
3794 else {
3795 spec->gen.cap_sync_hook = update_tpacpi_micmute_led;
3796 removefunc = false;
3797 }
3798 }
3799 }
3800
3801 if (led_set_func && (action == HDA_FIXUP_ACT_FREE || removefunc)) {
3802 symbol_put(tpacpi_led_set);
3803 led_set_func = NULL;
3804 } 3830 }
3805} 3831}
3806 3832
3807#else 3833/* for hda_fixup_thinkpad_acpi() */
3808 3834#include "thinkpad_helper.c"
3809static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
3810 const struct hda_fixup *fix, int action)
3811{
3812}
3813
3814#endif
3815 3835
3816enum { 3836enum {
3817 ALC269_FIXUP_SONY_VAIO, 3837 ALC269_FIXUP_SONY_VAIO,
@@ -3837,6 +3857,7 @@ enum {
3837 ALC269_FIXUP_HP_GPIO_LED, 3857 ALC269_FIXUP_HP_GPIO_LED,
3838 ALC269_FIXUP_INV_DMIC, 3858 ALC269_FIXUP_INV_DMIC,
3839 ALC269_FIXUP_LENOVO_DOCK, 3859 ALC269_FIXUP_LENOVO_DOCK,
3860 ALC269_FIXUP_NO_SHUTUP,
3840 ALC286_FIXUP_SONY_MIC_NO_PRESENCE, 3861 ALC286_FIXUP_SONY_MIC_NO_PRESENCE,
3841 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT, 3862 ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
3842 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, 3863 ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
@@ -3853,6 +3874,7 @@ enum {
3853 ALC269_FIXUP_ACER_AC700, 3874 ALC269_FIXUP_ACER_AC700,
3854 ALC269_FIXUP_LIMIT_INT_MIC_BOOST, 3875 ALC269_FIXUP_LIMIT_INT_MIC_BOOST,
3855 ALC269VB_FIXUP_ASUS_ZENBOOK, 3876 ALC269VB_FIXUP_ASUS_ZENBOOK,
3877 ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A,
3856 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED, 3878 ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED,
3857 ALC269VB_FIXUP_ORDISSIMO_EVE2, 3879 ALC269VB_FIXUP_ORDISSIMO_EVE2,
3858 ALC283_FIXUP_CHROME_BOOK, 3880 ALC283_FIXUP_CHROME_BOOK,
@@ -3860,6 +3882,9 @@ enum {
3860 ALC282_FIXUP_ASUS_TX300, 3882 ALC282_FIXUP_ASUS_TX300,
3861 ALC283_FIXUP_INT_MIC, 3883 ALC283_FIXUP_INT_MIC,
3862 ALC290_FIXUP_MONO_SPEAKERS, 3884 ALC290_FIXUP_MONO_SPEAKERS,
3885 ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
3886 ALC290_FIXUP_SUBWOOFER,
3887 ALC290_FIXUP_SUBWOOFER_HSJACK,
3863 ALC269_FIXUP_THINKPAD_ACPI, 3888 ALC269_FIXUP_THINKPAD_ACPI,
3864 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 3889 ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
3865 ALC255_FIXUP_HEADSET_MODE, 3890 ALC255_FIXUP_HEADSET_MODE,
@@ -4009,6 +4034,10 @@ static const struct hda_fixup alc269_fixups[] = {
4009 .type = HDA_FIXUP_FUNC, 4034 .type = HDA_FIXUP_FUNC,
4010 .v.func = alc_fixup_inv_dmic_0x12, 4035 .v.func = alc_fixup_inv_dmic_0x12,
4011 }, 4036 },
4037 [ALC269_FIXUP_NO_SHUTUP] = {
4038 .type = HDA_FIXUP_FUNC,
4039 .v.func = alc_fixup_no_shutup,
4040 },
4012 [ALC269_FIXUP_LENOVO_DOCK] = { 4041 [ALC269_FIXUP_LENOVO_DOCK] = {
4013 .type = HDA_FIXUP_PINS, 4042 .type = HDA_FIXUP_PINS,
4014 .v.pins = (const struct hda_pintbl[]) { 4043 .v.pins = (const struct hda_pintbl[]) {
@@ -4143,6 +4172,17 @@ static const struct hda_fixup alc269_fixups[] = {
4143 .chained = true, 4172 .chained = true,
4144 .chain_id = ALC269VB_FIXUP_DMIC, 4173 .chain_id = ALC269VB_FIXUP_DMIC,
4145 }, 4174 },
4175 [ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A] = {
4176 .type = HDA_FIXUP_VERBS,
4177 .v.verbs = (const struct hda_verb[]) {
4178 /* class-D output amp +5dB */
4179 { 0x20, AC_VERB_SET_COEF_INDEX, 0x12 },
4180 { 0x20, AC_VERB_SET_PROC_COEF, 0x2800 },
4181 {}
4182 },
4183 .chained = true,
4184 .chain_id = ALC269VB_FIXUP_ASUS_ZENBOOK,
4185 },
4146 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = { 4186 [ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED] = {
4147 .type = HDA_FIXUP_FUNC, 4187 .type = HDA_FIXUP_FUNC,
4148 .v.func = alc269_fixup_limit_int_mic_boost, 4188 .v.func = alc269_fixup_limit_int_mic_boost,
@@ -4182,15 +4222,37 @@ static const struct hda_fixup alc269_fixups[] = {
4182 .chained = true, 4222 .chained = true,
4183 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 4223 .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST
4184 }, 4224 },
4225 [ALC290_FIXUP_SUBWOOFER_HSJACK] = {
4226 .type = HDA_FIXUP_PINS,
4227 .v.pins = (const struct hda_pintbl[]) {
4228 { 0x17, 0x90170112 }, /* subwoofer */
4229 { }
4230 },
4231 .chained = true,
4232 .chain_id = ALC290_FIXUP_MONO_SPEAKERS_HSJACK,
4233 },
4234 [ALC290_FIXUP_SUBWOOFER] = {
4235 .type = HDA_FIXUP_PINS,
4236 .v.pins = (const struct hda_pintbl[]) {
4237 { 0x17, 0x90170112 }, /* subwoofer */
4238 { }
4239 },
4240 .chained = true,
4241 .chain_id = ALC290_FIXUP_MONO_SPEAKERS,
4242 },
4185 [ALC290_FIXUP_MONO_SPEAKERS] = { 4243 [ALC290_FIXUP_MONO_SPEAKERS] = {
4186 .type = HDA_FIXUP_FUNC, 4244 .type = HDA_FIXUP_FUNC,
4187 .v.func = alc290_fixup_mono_speakers, 4245 .v.func = alc290_fixup_mono_speakers,
4246 },
4247 [ALC290_FIXUP_MONO_SPEAKERS_HSJACK] = {
4248 .type = HDA_FIXUP_FUNC,
4249 .v.func = alc290_fixup_mono_speakers,
4188 .chained = true, 4250 .chained = true,
4189 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE, 4251 .chain_id = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
4190 }, 4252 },
4191 [ALC269_FIXUP_THINKPAD_ACPI] = { 4253 [ALC269_FIXUP_THINKPAD_ACPI] = {
4192 .type = HDA_FIXUP_FUNC, 4254 .type = HDA_FIXUP_FUNC,
4193 .v.func = alc_fixup_thinkpad_acpi, 4255 .v.func = hda_fixup_thinkpad_acpi,
4194 }, 4256 },
4195 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = { 4257 [ALC255_FIXUP_DELL1_MIC_NO_PRESENCE] = {
4196 .type = HDA_FIXUP_PINS, 4258 .type = HDA_FIXUP_PINS,
@@ -4209,6 +4271,7 @@ static const struct hda_fixup alc269_fixups[] = {
4209}; 4271};
4210 4272
4211static const struct snd_pci_quirk alc269_fixup_tbl[] = { 4273static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4274 SND_PCI_QUIRK(0x1025, 0x0283, "Acer TravelMate 8371", ALC269_FIXUP_INV_DMIC),
4212 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC), 4275 SND_PCI_QUIRK(0x1025, 0x029b, "Acer 1810TZ", ALC269_FIXUP_INV_DMIC),
4213 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC), 4276 SND_PCI_QUIRK(0x1025, 0x0349, "Acer AOD260", ALC269_FIXUP_INV_DMIC),
4214 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700), 4277 SND_PCI_QUIRK(0x1025, 0x047c, "Acer AC700", ALC269_FIXUP_ACER_AC700),
@@ -4229,6 +4292,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4229 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4292 SND_PCI_QUIRK(0x1028, 0x05cb, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4230 SND_PCI_QUIRK(0x1028, 0x05cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4293 SND_PCI_QUIRK(0x1028, 0x05cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4231 SND_PCI_QUIRK(0x1028, 0x05cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4294 SND_PCI_QUIRK(0x1028, 0x05cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4295 SND_PCI_QUIRK(0x1028, 0x05da, "Dell Vostro 5460", ALC290_FIXUP_SUBWOOFER),
4232 SND_PCI_QUIRK(0x1028, 0x05de, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4296 SND_PCI_QUIRK(0x1028, 0x05de, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4233 SND_PCI_QUIRK(0x1028, 0x05e0, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4297 SND_PCI_QUIRK(0x1028, 0x05e0, "Dell", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4234 SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4298 SND_PCI_QUIRK(0x1028, 0x05e9, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
@@ -4247,16 +4311,26 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4247 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4311 SND_PCI_QUIRK(0x1028, 0x0606, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4248 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4312 SND_PCI_QUIRK(0x1028, 0x0608, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4249 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4313 SND_PCI_QUIRK(0x1028, 0x0609, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4250 SND_PCI_QUIRK(0x1028, 0x0610, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4314 SND_PCI_QUIRK(0x1028, 0x060f, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE),
4315 SND_PCI_QUIRK(0x1028, 0x0610, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE),
4251 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4316 SND_PCI_QUIRK(0x1028, 0x0613, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4252 SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4317 SND_PCI_QUIRK(0x1028, 0x0614, "Dell Inspiron 3135", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4253 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_MONO_SPEAKERS), 4318 SND_PCI_QUIRK(0x1028, 0x0615, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
4319 SND_PCI_QUIRK(0x1028, 0x0616, "Dell Vostro 5470", ALC290_FIXUP_SUBWOOFER_HSJACK),
4254 SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4320 SND_PCI_QUIRK(0x1028, 0x061f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4255 SND_PCI_QUIRK(0x1028, 0x0629, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4321 SND_PCI_QUIRK(0x1028, 0x0629, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4256 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS), 4322 SND_PCI_QUIRK(0x1028, 0x0638, "Dell Inspiron 5439", ALC290_FIXUP_MONO_SPEAKERS_HSJACK),
4257 SND_PCI_QUIRK(0x1028, 0x063e, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE), 4323 SND_PCI_QUIRK(0x1028, 0x063e, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4258 SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4324 SND_PCI_QUIRK(0x1028, 0x063f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4259 SND_PCI_QUIRK(0x1028, 0x0640, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), 4325 SND_PCI_QUIRK(0x1028, 0x0640, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4326 SND_PCI_QUIRK(0x1028, 0x064d, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4327 SND_PCI_QUIRK(0x1028, 0x0651, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4328 SND_PCI_QUIRK(0x1028, 0x0652, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4329 SND_PCI_QUIRK(0x1028, 0x0653, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4330 SND_PCI_QUIRK(0x1028, 0x0657, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4331 SND_PCI_QUIRK(0x1028, 0x0658, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE),
4332 SND_PCI_QUIRK(0x1028, 0x065f, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4333 SND_PCI_QUIRK(0x1028, 0x0662, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE),
4260 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4334 SND_PCI_QUIRK(0x1028, 0x15cc, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4261 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE), 4335 SND_PCI_QUIRK(0x1028, 0x15cd, "Dell X5 Precision", ALC269_FIXUP_DELL2_MIC_NO_PRESENCE),
4262 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2), 4336 SND_PCI_QUIRK(0x103c, 0x1586, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC2),
@@ -4264,12 +4338,60 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4264 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4338 SND_PCI_QUIRK(0x103c, 0x1973, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4265 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1), 4339 SND_PCI_QUIRK(0x103c, 0x1983, "HP Pavilion", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4266 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED), 4340 SND_PCI_QUIRK(0x103c, 0x218b, "HP", ALC269_FIXUP_LIMIT_INT_MIC_BOOST_MUTE_LED),
4341 /* ALC282 */
4342 SND_PCI_QUIRK(0x103c, 0x220f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4343 SND_PCI_QUIRK(0x103c, 0x2213, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4344 SND_PCI_QUIRK(0x103c, 0x2266, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4345 SND_PCI_QUIRK(0x103c, 0x2267, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4346 SND_PCI_QUIRK(0x103c, 0x2268, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4347 SND_PCI_QUIRK(0x103c, 0x2269, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4348 SND_PCI_QUIRK(0x103c, 0x226a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4349 SND_PCI_QUIRK(0x103c, 0x226b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4350 SND_PCI_QUIRK(0x103c, 0x227a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4351 SND_PCI_QUIRK(0x103c, 0x227b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4352 SND_PCI_QUIRK(0x103c, 0x229e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4353 SND_PCI_QUIRK(0x103c, 0x22a0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4354 SND_PCI_QUIRK(0x103c, 0x22b2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4355 SND_PCI_QUIRK(0x103c, 0x22b7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4356 SND_PCI_QUIRK(0x103c, 0x22bf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4357 SND_PCI_QUIRK(0x103c, 0x22c0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4358 SND_PCI_QUIRK(0x103c, 0x22c1, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4359 SND_PCI_QUIRK(0x103c, 0x22c2, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4360 SND_PCI_QUIRK(0x103c, 0x22cd, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4361 SND_PCI_QUIRK(0x103c, 0x22ce, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4362 SND_PCI_QUIRK(0x103c, 0x22cf, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4363 SND_PCI_QUIRK(0x103c, 0x22d0, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4364 /* ALC290 */
4365 SND_PCI_QUIRK(0x103c, 0x2260, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4366 SND_PCI_QUIRK(0x103c, 0x2261, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4367 SND_PCI_QUIRK(0x103c, 0x2262, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4368 SND_PCI_QUIRK(0x103c, 0x2263, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4369 SND_PCI_QUIRK(0x103c, 0x2264, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4370 SND_PCI_QUIRK(0x103c, 0x2265, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4371 SND_PCI_QUIRK(0x103c, 0x227d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4372 SND_PCI_QUIRK(0x103c, 0x227e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4373 SND_PCI_QUIRK(0x103c, 0x227f, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4374 SND_PCI_QUIRK(0x103c, 0x2280, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4375 SND_PCI_QUIRK(0x103c, 0x2281, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4376 SND_PCI_QUIRK(0x103c, 0x2282, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4377 SND_PCI_QUIRK(0x103c, 0x2289, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4378 SND_PCI_QUIRK(0x103c, 0x228a, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4379 SND_PCI_QUIRK(0x103c, 0x228b, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4380 SND_PCI_QUIRK(0x103c, 0x228c, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4381 SND_PCI_QUIRK(0x103c, 0x228d, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4382 SND_PCI_QUIRK(0x103c, 0x228e, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4383 SND_PCI_QUIRK(0x103c, 0x22c5, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4384 SND_PCI_QUIRK(0x103c, 0x22c6, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4385 SND_PCI_QUIRK(0x103c, 0x22c7, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4386 SND_PCI_QUIRK(0x103c, 0x22c8, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4387 SND_PCI_QUIRK(0x103c, 0x22c3, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4388 SND_PCI_QUIRK(0x103c, 0x22c4, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1),
4267 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED), 4389 SND_PCI_QUIRK_VENDOR(0x103c, "HP", ALC269_FIXUP_HP_MUTE_LED),
4268 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), 4390 SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300),
4269 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4391 SND_PCI_QUIRK(0x1043, 0x106d, "Asus K53BE", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4270 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4392 SND_PCI_QUIRK(0x1043, 0x115d, "Asus 1015E", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4271 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), 4393 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK),
4272 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK), 4394 SND_PCI_QUIRK(0x1043, 0x1517, "Asus Zenbook UX31A", ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A),
4273 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC), 4395 SND_PCI_QUIRK(0x1043, 0x16e3, "ASUS UX50", ALC269_FIXUP_STEREO_DMIC),
4274 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW), 4396 SND_PCI_QUIRK(0x1043, 0x1a13, "Asus G73Jw", ALC269_FIXUP_ASUS_G73JW),
4275 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC), 4397 SND_PCI_QUIRK(0x1043, 0x1b13, "Asus U41SV", ALC269_FIXUP_INV_DMIC),
@@ -4279,6 +4401,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4279 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 4401 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
4280 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC), 4402 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
4281 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101), 4403 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
4404 SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
4282 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE), 4405 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
4283 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2), 4406 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
4284 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ), 4407 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
@@ -4300,6 +4423,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4300 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4423 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4301 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4424 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4302 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4425 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4426 SND_PCI_QUIRK(0x17aa, 0x3978, "IdeaPad Y410P", ALC269_FIXUP_NO_SHUTUP),
4303 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4427 SND_PCI_QUIRK(0x17aa, 0x5013, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4304 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC), 4428 SND_PCI_QUIRK(0x17aa, 0x501a, "Thinkpad", ALC283_FIXUP_INT_MIC),
4305 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4429 SND_PCI_QUIRK(0x17aa, 0x5026, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -4502,7 +4626,7 @@ static int patch_alc269(struct hda_codec *codec)
4502 } 4626 }
4503 4627
4504 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) { 4628 if (snd_hda_codec_read(codec, 0x51, 0, AC_VERB_PARAMETERS, 0) == 0x10ec5505) {
4505 spec->has_alc5505_dsp = true; 4629 spec->has_alc5505_dsp = 1;
4506 spec->init_hook = alc5505_dsp_init; 4630 spec->init_hook = alc5505_dsp_init;
4507 } 4631 }
4508 4632
@@ -4841,6 +4965,7 @@ enum {
4841 ALC662_FIXUP_BASS_CHMAP, 4965 ALC662_FIXUP_BASS_CHMAP,
4842 ALC662_FIXUP_BASS_1A, 4966 ALC662_FIXUP_BASS_1A,
4843 ALC662_FIXUP_BASS_1A_CHMAP, 4967 ALC662_FIXUP_BASS_1A_CHMAP,
4968 ALC668_FIXUP_AUTO_MUTE,
4844}; 4969};
4845 4970
4846static const struct hda_fixup alc662_fixups[] = { 4971static const struct hda_fixup alc662_fixups[] = {
@@ -5001,6 +5126,12 @@ static const struct hda_fixup alc662_fixups[] = {
5001 .type = HDA_FIXUP_FUNC, 5126 .type = HDA_FIXUP_FUNC,
5002 .v.func = alc_fixup_inv_dmic_0x12, 5127 .v.func = alc_fixup_inv_dmic_0x12,
5003 }, 5128 },
5129 [ALC668_FIXUP_AUTO_MUTE] = {
5130 .type = HDA_FIXUP_FUNC,
5131 .v.func = alc_fixup_auto_mute_via_amp,
5132 .chained = true,
5133 .chain_id = ALC668_FIXUP_DELL_MIC_NO_PRESENCE
5134 },
5004 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = { 5135 [ALC668_FIXUP_DELL_MIC_NO_PRESENCE] = {
5005 .type = HDA_FIXUP_PINS, 5136 .type = HDA_FIXUP_PINS,
5006 .v.pins = (const struct hda_pintbl[]) { 5137 .v.pins = (const struct hda_pintbl[]) {
@@ -5046,11 +5177,13 @@ static const struct snd_pci_quirk alc662_fixup_tbl[] = {
5046 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE), 5177 SND_PCI_QUIRK(0x1025, 0x038b, "Acer Aspire 8943G", ALC662_FIXUP_ASPIRE),
5047 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5178 SND_PCI_QUIRK(0x1028, 0x05d8, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5048 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5179 SND_PCI_QUIRK(0x1028, 0x05db, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5049 SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5180 SND_PCI_QUIRK(0x1028, 0x060a, "Dell XPS 13", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5050 SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5181 SND_PCI_QUIRK(0x1028, 0x0623, "Dell", ALC668_FIXUP_AUTO_MUTE),
5182 SND_PCI_QUIRK(0x1028, 0x0624, "Dell", ALC668_FIXUP_AUTO_MUTE),
5051 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5183 SND_PCI_QUIRK(0x1028, 0x0625, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5052 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5184 SND_PCI_QUIRK(0x1028, 0x0626, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE),
5053 SND_PCI_QUIRK(0x1028, 0x0628, "Dell", ALC668_FIXUP_DELL_MIC_NO_PRESENCE), 5185 SND_PCI_QUIRK(0x1028, 0x0628, "Dell", ALC668_FIXUP_AUTO_MUTE),
5186 SND_PCI_QUIRK(0x1028, 0x064e, "Dell", ALC668_FIXUP_AUTO_MUTE),
5054 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800), 5187 SND_PCI_QUIRK(0x103c, 0x1632, "HP RP5800", ALC662_FIXUP_HP_RP5800),
5055 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP), 5188 SND_PCI_QUIRK(0x1043, 0x11cd, "Asus N550", ALC662_FIXUP_BASS_1A_CHMAP),
5056 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP), 5189 SND_PCI_QUIRK(0x1043, 0x1477, "ASUS N56VZ", ALC662_FIXUP_BASS_CHMAP),