aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_auto_parser.c1
-rw-r--r--sound/pci/hda/hda_i915.c67
-rw-r--r--sound/pci/hda/hda_i915.h6
-rw-r--r--sound/pci/hda/hda_intel.c40
-rw-r--r--sound/pci/hda/hda_local.h21
-rw-r--r--sound/pci/hda/patch_hdmi.c2
-rw-r--r--sound/pci/hda/patch_realtek.c502
-rw-r--r--sound/pci/hda/patch_sigmatel.c58
8 files changed, 373 insertions, 324 deletions
diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c
index b684c6e4f301..dabe41975a9d 100644
--- a/sound/pci/hda/hda_auto_parser.c
+++ b/sound/pci/hda/hda_auto_parser.c
@@ -898,6 +898,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
898 if (!strcmp(codec->modelname, models->name)) { 898 if (!strcmp(codec->modelname, models->name)) {
899 codec->fixup_id = models->id; 899 codec->fixup_id = models->id;
900 codec->fixup_name = models->name; 900 codec->fixup_name = models->name;
901 codec->fixup_list = fixlist;
901 codec->fixup_forced = 1; 902 codec->fixup_forced = 1;
902 return; 903 return;
903 } 904 }
diff --git a/sound/pci/hda/hda_i915.c b/sound/pci/hda/hda_i915.c
index 9d07e4edacdb..8b4940ba33d6 100644
--- a/sound/pci/hda/hda_i915.c
+++ b/sound/pci/hda/hda_i915.c
@@ -20,24 +20,71 @@
20#include <linux/module.h> 20#include <linux/module.h>
21#include <sound/core.h> 21#include <sound/core.h>
22#include <drm/i915_powerwell.h> 22#include <drm/i915_powerwell.h>
23#include "hda_priv.h"
23#include "hda_i915.h" 24#include "hda_i915.h"
24 25
25static void (*get_power)(void); 26/* Intel HSW/BDW display HDA controller Extended Mode registers.
26static void (*put_power)(void); 27 * EM4 (M value) and EM5 (N Value) are used to convert CDClk (Core Display
28 * Clock) to 24MHz BCLK: BCLK = CDCLK * M / N
29 * The values will be lost when the display power well is disabled.
30 */
31#define ICH6_REG_EM4 0x100c
32#define ICH6_REG_EM5 0x1010
33
34static int (*get_power)(void);
35static int (*put_power)(void);
36static int (*get_cdclk)(void);
27 37
28void hda_display_power(bool enable) 38int hda_display_power(bool enable)
29{ 39{
30 if (!get_power || !put_power) 40 if (!get_power || !put_power)
31 return; 41 return -ENODEV;
32 42
33 pr_debug("HDA display power %s \n", 43 pr_debug("HDA display power %s \n",
34 enable ? "Enable" : "Disable"); 44 enable ? "Enable" : "Disable");
35 if (enable) 45 if (enable)
36 get_power(); 46 return get_power();
37 else 47 else
38 put_power(); 48 return put_power();
49}
50
51void haswell_set_bclk(struct azx *chip)
52{
53 int cdclk_freq;
54 unsigned int bclk_m, bclk_n;
55
56 if (!get_cdclk)
57 return;
58
59 cdclk_freq = get_cdclk();
60 switch (cdclk_freq) {
61 case 337500:
62 bclk_m = 16;
63 bclk_n = 225;
64 break;
65
66 case 450000:
67 default: /* default CDCLK 450MHz */
68 bclk_m = 4;
69 bclk_n = 75;
70 break;
71
72 case 540000:
73 bclk_m = 4;
74 bclk_n = 90;
75 break;
76
77 case 675000:
78 bclk_m = 8;
79 bclk_n = 225;
80 break;
81 }
82
83 azx_writew(chip, EM4, bclk_m);
84 azx_writew(chip, EM5, bclk_n);
39} 85}
40 86
87
41int hda_i915_init(void) 88int hda_i915_init(void)
42{ 89{
43 int err = 0; 90 int err = 0;
@@ -55,6 +102,10 @@ int hda_i915_init(void)
55 return -ENODEV; 102 return -ENODEV;
56 } 103 }
57 104
105 get_cdclk = symbol_request(i915_get_cdclk_freq);
106 if (!get_cdclk) /* may have abnormal BCLK and audio playback rate */
107 pr_warn("hda-i915: get_cdclk symbol get fail\n");
108
58 pr_debug("HDA driver get symbol successfully from i915 module\n"); 109 pr_debug("HDA driver get symbol successfully from i915 module\n");
59 110
60 return err; 111 return err;
@@ -70,6 +121,10 @@ int hda_i915_exit(void)
70 symbol_put(i915_release_power_well); 121 symbol_put(i915_release_power_well);
71 put_power = NULL; 122 put_power = NULL;
72 } 123 }
124 if (get_cdclk) {
125 symbol_put(i915_get_cdclk_freq);
126 get_cdclk = NULL;
127 }
73 128
74 return 0; 129 return 0;
75} 130}
diff --git a/sound/pci/hda/hda_i915.h b/sound/pci/hda/hda_i915.h
index 5a63da2c53e5..e6072c627583 100644
--- a/sound/pci/hda/hda_i915.h
+++ b/sound/pci/hda/hda_i915.h
@@ -17,11 +17,13 @@
17#define __SOUND_HDA_I915_H 17#define __SOUND_HDA_I915_H
18 18
19#ifdef CONFIG_SND_HDA_I915 19#ifdef CONFIG_SND_HDA_I915
20void hda_display_power(bool enable); 20int hda_display_power(bool enable);
21void haswell_set_bclk(struct azx *chip);
21int hda_i915_init(void); 22int hda_i915_init(void);
22int hda_i915_exit(void); 23int hda_i915_exit(void);
23#else 24#else
24static inline void hda_display_power(bool enable) {} 25static inline int hda_display_power(bool enable) { return 0; }
26static inline void haswell_set_bclk(struct azx *chip) { return; }
25static inline int hda_i915_init(void) 27static inline int hda_i915_init(void)
26{ 28{
27 return -ENODEV; 29 return -ENODEV;
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index bb65a124e006..b6b4e71a0b0b 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -62,9 +62,9 @@
62#include <linux/vga_switcheroo.h> 62#include <linux/vga_switcheroo.h>
63#include <linux/firmware.h> 63#include <linux/firmware.h>
64#include "hda_codec.h" 64#include "hda_codec.h"
65#include "hda_i915.h"
66#include "hda_controller.h" 65#include "hda_controller.h"
67#include "hda_priv.h" 66#include "hda_priv.h"
67#include "hda_i915.h"
68 68
69 69
70static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; 70static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
@@ -288,6 +288,11 @@ static char *driver_short_names[] = {
288 [AZX_DRIVER_GENERIC] = "HD-Audio Generic", 288 [AZX_DRIVER_GENERIC] = "HD-Audio Generic",
289}; 289};
290 290
291struct hda_intel {
292 struct azx chip;
293};
294
295
291#ifdef CONFIG_X86 296#ifdef CONFIG_X86
292static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on) 297static void __mark_pages_wc(struct azx *chip, struct snd_dma_buffer *dmab, bool on)
293{ 298{
@@ -606,6 +611,7 @@ static int azx_suspend(struct device *dev)
606 free_irq(chip->irq, chip); 611 free_irq(chip->irq, chip);
607 chip->irq = -1; 612 chip->irq = -1;
608 } 613 }
614
609 if (chip->msi) 615 if (chip->msi)
610 pci_disable_msi(chip->pci); 616 pci_disable_msi(chip->pci);
611 pci_disable_device(pci); 617 pci_disable_device(pci);
@@ -625,8 +631,10 @@ static int azx_resume(struct device *dev)
625 if (chip->disabled) 631 if (chip->disabled)
626 return 0; 632 return 0;
627 633
628 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 634 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
629 hda_display_power(true); 635 hda_display_power(true);
636 haswell_set_bclk(chip);
637 }
630 pci_set_power_state(pci, PCI_D0); 638 pci_set_power_state(pci, PCI_D0);
631 pci_restore_state(pci); 639 pci_restore_state(pci);
632 if (pci_enable_device(pci) < 0) { 640 if (pci_enable_device(pci) < 0) {
@@ -672,6 +680,7 @@ static int azx_runtime_suspend(struct device *dev)
672 azx_clear_irq_pending(chip); 680 azx_clear_irq_pending(chip);
673 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 681 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
674 hda_display_power(false); 682 hda_display_power(false);
683
675 return 0; 684 return 0;
676} 685}
677 686
@@ -689,8 +698,10 @@ static int azx_runtime_resume(struct device *dev)
689 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME)) 698 if (!(chip->driver_caps & AZX_DCAPS_PM_RUNTIME))
690 return 0; 699 return 0;
691 700
692 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) 701 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) {
693 hda_display_power(true); 702 hda_display_power(true);
703 haswell_set_bclk(chip);
704 }
694 705
695 /* Read STATESTS before controller reset */ 706 /* Read STATESTS before controller reset */
696 status = azx_readw(chip, STATESTS); 707 status = azx_readw(chip, STATESTS);
@@ -883,6 +894,8 @@ static int register_vga_switcheroo(struct azx *chip)
883static int azx_free(struct azx *chip) 894static int azx_free(struct azx *chip)
884{ 895{
885 struct pci_dev *pci = chip->pci; 896 struct pci_dev *pci = chip->pci;
897 struct hda_intel *hda = container_of(chip, struct hda_intel, chip);
898
886 int i; 899 int i;
887 900
888 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME) 901 if ((chip->driver_caps & AZX_DCAPS_PM_RUNTIME)
@@ -930,7 +943,7 @@ static int azx_free(struct azx *chip)
930 hda_display_power(false); 943 hda_display_power(false);
931 hda_i915_exit(); 944 hda_i915_exit();
932 } 945 }
933 kfree(chip); 946 kfree(hda);
934 947
935 return 0; 948 return 0;
936} 949}
@@ -1174,6 +1187,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
1174 static struct snd_device_ops ops = { 1187 static struct snd_device_ops ops = {
1175 .dev_free = azx_dev_free, 1188 .dev_free = azx_dev_free,
1176 }; 1189 };
1190 struct hda_intel *hda;
1177 struct azx *chip; 1191 struct azx *chip;
1178 int err; 1192 int err;
1179 1193
@@ -1183,13 +1197,14 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
1183 if (err < 0) 1197 if (err < 0)
1184 return err; 1198 return err;
1185 1199
1186 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 1200 hda = kzalloc(sizeof(*hda), GFP_KERNEL);
1187 if (!chip) { 1201 if (!hda) {
1188 dev_err(card->dev, "Cannot allocate chip\n"); 1202 dev_err(card->dev, "Cannot allocate hda\n");
1189 pci_disable_device(pci); 1203 pci_disable_device(pci);
1190 return -ENOMEM; 1204 return -ENOMEM;
1191 } 1205 }
1192 1206
1207 chip = &hda->chip;
1193 spin_lock_init(&chip->reg_lock); 1208 spin_lock_init(&chip->reg_lock);
1194 mutex_init(&chip->open_mutex); 1209 mutex_init(&chip->open_mutex);
1195 chip->card = card; 1210 chip->card = card;
@@ -1375,6 +1390,10 @@ static int azx_first_init(struct azx *chip)
1375 1390
1376 /* initialize chip */ 1391 /* initialize chip */
1377 azx_init_pci(chip); 1392 azx_init_pci(chip);
1393
1394 if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL)
1395 haswell_set_bclk(chip);
1396
1378 azx_init_chip(chip, (probe_only[dev] & 2) == 0); 1397 azx_init_chip(chip, (probe_only[dev] & 2) == 0);
1379 1398
1380 /* codec detection */ 1399 /* codec detection */
@@ -1656,8 +1675,13 @@ static int azx_probe_continue(struct azx *chip)
1656 "Error request power-well from i915\n"); 1675 "Error request power-well from i915\n");
1657 goto out_free; 1676 goto out_free;
1658 } 1677 }
1678 err = hda_display_power(true);
1679 if (err < 0) {
1680 dev_err(chip->card->dev,
1681 "Cannot turn on display power on i915\n");
1682 goto out_free;
1683 }
1659#endif 1684#endif
1660 hda_display_power(true);
1661 } 1685 }
1662 1686
1663 err = azx_first_init(chip); 1687 err = azx_first_init(chip);
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index ebd1fa6f015c..4e2d4863daa1 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -417,6 +417,27 @@ struct snd_hda_pin_quirk {
417 int value; /* quirk value */ 417 int value; /* quirk value */
418}; 418};
419 419
420#ifdef CONFIG_SND_DEBUG_VERBOSE
421
422#define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \
423 { .codec = _codec,\
424 .subvendor = _subvendor,\
425 .name = _name,\
426 .value = _value,\
427 .pins = (const struct hda_pintbl[]) { _pins } \
428 }
429#else
430
431#define SND_HDA_PIN_QUIRK(_codec, _subvendor, _name, _value, _pins...) \
432 { .codec = _codec,\
433 .subvendor = _subvendor,\
434 .value = _value,\
435 .pins = (const struct hda_pintbl[]) { _pins } \
436 }
437
438#endif
439
440
420/* fixup types */ 441/* fixup types */
421enum { 442enum {
422 HDA_FIXUP_INVALID, 443 HDA_FIXUP_INVALID,
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index 3e4417b0ddbe..4fe876b65fda 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2204,7 +2204,7 @@ static int generic_hdmi_resume(struct hda_codec *codec)
2204 struct hdmi_spec *spec = codec->spec; 2204 struct hdmi_spec *spec = codec->spec;
2205 int pin_idx; 2205 int pin_idx;
2206 2206
2207 generic_hdmi_init(codec); 2207 codec->patch_ops.init(codec);
2208 snd_hda_codec_resume_amp(codec); 2208 snd_hda_codec_resume_amp(codec);
2209 snd_hda_codec_resume_cache(codec); 2209 snd_hda_codec_resume_cache(codec);
2210 2210
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index af76995fa966..b60824e90408 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4880,6 +4880,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
4880 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK), 4880 SND_PCI_QUIRK(0x17aa, 0x2208, "Thinkpad T431s", ALC269_FIXUP_LENOVO_DOCK),
4881 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK), 4881 SND_PCI_QUIRK(0x17aa, 0x220c, "Thinkpad T440s", ALC292_FIXUP_TPT440_DOCK),
4882 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK), 4882 SND_PCI_QUIRK(0x17aa, 0x220e, "Thinkpad T440p", ALC292_FIXUP_TPT440_DOCK),
4883 SND_PCI_QUIRK(0x17aa, 0x2210, "Thinkpad T540p", ALC292_FIXUP_TPT440_DOCK),
4883 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4884 SND_PCI_QUIRK(0x17aa, 0x2212, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4884 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4885 SND_PCI_QUIRK(0x17aa, 0x2214, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
4885 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), 4886 SND_PCI_QUIRK(0x17aa, 0x2215, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST),
@@ -4962,228 +4963,141 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
4962}; 4963};
4963 4964
4964static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { 4965static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = {
4965 { 4966 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4966 .codec = 0x10ec0255, 4967 {0x12, 0x90a60140},
4967 .subvendor = 0x1028, 4968 {0x14, 0x90170110},
4968#ifdef CONFIG_SND_DEBUG_VERBOSE 4969 {0x17, 0x40000000},
4969 .name = "Dell", 4970 {0x18, 0x411111f0},
4970#endif 4971 {0x19, 0x411111f0},
4971 .pins = (const struct hda_pintbl[]) { 4972 {0x1a, 0x411111f0},
4972 {0x12, 0x90a60140}, 4973 {0x1b, 0x411111f0},
4973 {0x14, 0x90170110}, 4974 {0x1d, 0x40700001},
4974 {0x17, 0x40000000}, 4975 {0x1e, 0x411111f0},
4975 {0x18, 0x411111f0}, 4976 {0x21, 0x02211020}),
4976 {0x19, 0x411111f0}, 4977 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4977 {0x1a, 0x411111f0}, 4978 {0x12, 0x90a60160},
4978 {0x1b, 0x411111f0}, 4979 {0x14, 0x90170120},
4979 {0x1d, 0x40700001}, 4980 {0x17, 0x40000000},
4980 {0x1e, 0x411111f0}, 4981 {0x18, 0x411111f0},
4981 {0x21, 0x02211020}, 4982 {0x19, 0x411111f0},
4982 }, 4983 {0x1a, 0x411111f0},
4983 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 4984 {0x1b, 0x411111f0},
4984 }, 4985 {0x1d, 0x40700001},
4985 { 4986 {0x1e, 0x411111f0},
4986 .codec = 0x10ec0255, 4987 {0x21, 0x02211030}),
4987 .subvendor = 0x1028, 4988 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4988#ifdef CONFIG_SND_DEBUG_VERBOSE 4989 {0x12, 0x90a60160},
4989 .name = "Dell", 4990 {0x14, 0x90170120},
4990#endif 4991 {0x17, 0x90170140},
4991 .pins = (const struct hda_pintbl[]) { 4992 {0x18, 0x40000000},
4992 {0x12, 0x90a60160}, 4993 {0x19, 0x411111f0},
4993 {0x14, 0x90170120}, 4994 {0x1a, 0x411111f0},
4994 {0x17, 0x40000000}, 4995 {0x1b, 0x411111f0},
4995 {0x18, 0x411111f0}, 4996 {0x1d, 0x41163b05},
4996 {0x19, 0x411111f0}, 4997 {0x1e, 0x411111f0},
4997 {0x1a, 0x411111f0}, 4998 {0x21, 0x0321102f}),
4998 {0x1b, 0x411111f0}, 4999 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
4999 {0x1d, 0x40700001}, 5000 {0x12, 0x90a60160},
5000 {0x1e, 0x411111f0}, 5001 {0x14, 0x90170130},
5001 {0x21, 0x02211030}, 5002 {0x17, 0x40000000},
5002 }, 5003 {0x18, 0x411111f0},
5003 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5004 {0x19, 0x411111f0},
5004 }, 5005 {0x1a, 0x411111f0},
5005 { 5006 {0x1b, 0x411111f0},
5006 .codec = 0x10ec0255, 5007 {0x1d, 0x40700001},
5007 .subvendor = 0x1028, 5008 {0x1e, 0x411111f0},
5008#ifdef CONFIG_SND_DEBUG_VERBOSE 5009 {0x21, 0x02211040}),
5009 .name = "Dell", 5010 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5010#endif 5011 {0x12, 0x90a60160},
5011 .pins = (const struct hda_pintbl[]) { 5012 {0x14, 0x90170140},
5012 {0x12, 0x90a60160}, 5013 {0x17, 0x40000000},
5013 {0x14, 0x90170120}, 5014 {0x18, 0x411111f0},
5014 {0x17, 0x90170140}, 5015 {0x19, 0x411111f0},
5015 {0x18, 0x40000000}, 5016 {0x1a, 0x411111f0},
5016 {0x19, 0x411111f0}, 5017 {0x1b, 0x411111f0},
5017 {0x1a, 0x411111f0}, 5018 {0x1d, 0x40700001},
5018 {0x1b, 0x411111f0}, 5019 {0x1e, 0x411111f0},
5019 {0x1d, 0x41163b05}, 5020 {0x21, 0x02211050}),
5020 {0x1e, 0x411111f0}, 5021 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5021 {0x21, 0x0321102f}, 5022 {0x12, 0x90a60170},
5022 }, 5023 {0x14, 0x90170120},
5023 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5024 {0x17, 0x40000000},
5024 }, 5025 {0x18, 0x411111f0},
5025 { 5026 {0x19, 0x411111f0},
5026 .codec = 0x10ec0255, 5027 {0x1a, 0x411111f0},
5027 .subvendor = 0x1028, 5028 {0x1b, 0x411111f0},
5028#ifdef CONFIG_SND_DEBUG_VERBOSE 5029 {0x1d, 0x40700001},
5029 .name = "Dell", 5030 {0x1e, 0x411111f0},
5030#endif 5031 {0x21, 0x02211030}),
5031 .pins = (const struct hda_pintbl[]) { 5032 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5032 {0x12, 0x90a60160}, 5033 {0x12, 0x90a60170},
5033 {0x14, 0x90170130}, 5034 {0x14, 0x90170130},
5034 {0x17, 0x40000000}, 5035 {0x17, 0x40000000},
5035 {0x18, 0x411111f0}, 5036 {0x18, 0x411111f0},
5036 {0x19, 0x411111f0}, 5037 {0x19, 0x411111f0},
5037 {0x1a, 0x411111f0}, 5038 {0x1a, 0x411111f0},
5038 {0x1b, 0x411111f0}, 5039 {0x1b, 0x411111f0},
5039 {0x1d, 0x40700001}, 5040 {0x1d, 0x40700001},
5040 {0x1e, 0x411111f0}, 5041 {0x1e, 0x411111f0},
5041 {0x21, 0x02211040}, 5042 {0x21, 0x02211040}),
5042 }, 5043 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5043 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5044 {0x12, 0x90a60130},
5044 }, 5045 {0x14, 0x90170110},
5045 { 5046 {0x17, 0x40020008},
5046 .codec = 0x10ec0255, 5047 {0x18, 0x411111f0},
5047 .subvendor = 0x1028, 5048 {0x19, 0x411111f0},
5048#ifdef CONFIG_SND_DEBUG_VERBOSE 5049 {0x1a, 0x411111f0},
5049 .name = "Dell", 5050 {0x1b, 0x411111f0},
5050#endif 5051 {0x1d, 0x40e00001},
5051 .pins = (const struct hda_pintbl[]) { 5052 {0x1e, 0x411111f0},
5052 {0x12, 0x90a60160}, 5053 {0x21, 0x0321101f}),
5053 {0x14, 0x90170140}, 5054 SND_HDA_PIN_QUIRK(0x10ec0283, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5054 {0x17, 0x40000000}, 5055 {0x12, 0x90a60160},
5055 {0x18, 0x411111f0}, 5056 {0x14, 0x90170120},
5056 {0x19, 0x411111f0}, 5057 {0x17, 0x40000000},
5057 {0x1a, 0x411111f0}, 5058 {0x18, 0x411111f0},
5058 {0x1b, 0x411111f0}, 5059 {0x19, 0x411111f0},
5059 {0x1d, 0x40700001}, 5060 {0x1a, 0x411111f0},
5060 {0x1e, 0x411111f0}, 5061 {0x1b, 0x411111f0},
5061 {0x21, 0x02211050}, 5062 {0x1d, 0x40700001},
5062 }, 5063 {0x1e, 0x411111f0},
5063 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5064 {0x21, 0x02211030}),
5064 }, 5065 SND_HDA_PIN_QUIRK(0x10ec0292, 0x1028, "Dell", ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5065 { 5066 {0x12, 0x90a60140},
5066 .codec = 0x10ec0255, 5067 {0x13, 0x411111f0},
5067 .subvendor = 0x1028, 5068 {0x14, 0x90170110},
5068#ifdef CONFIG_SND_DEBUG_VERBOSE 5069 {0x15, 0x0221401f},
5069 .name = "Dell", 5070 {0x16, 0x411111f0},
5070#endif 5071 {0x18, 0x411111f0},
5071 .pins = (const struct hda_pintbl[]) { 5072 {0x19, 0x411111f0},
5072 {0x12, 0x90a60170}, 5073 {0x1a, 0x411111f0},
5073 {0x14, 0x90170120}, 5074 {0x1b, 0x411111f0},
5074 {0x17, 0x40000000}, 5075 {0x1d, 0x40700001},
5075 {0x18, 0x411111f0}, 5076 {0x1e, 0x411111f0}),
5076 {0x19, 0x411111f0}, 5077 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5077 {0x1a, 0x411111f0}, 5078 {0x12, 0x40000000},
5078 {0x1b, 0x411111f0}, 5079 {0x13, 0x90a60140},
5079 {0x1d, 0x40700001}, 5080 {0x14, 0x90170110},
5080 {0x1e, 0x411111f0}, 5081 {0x15, 0x0221401f},
5081 {0x21, 0x02211030}, 5082 {0x16, 0x21014020},
5082 }, 5083 {0x18, 0x411111f0},
5083 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE, 5084 {0x19, 0x21a19030},
5084 }, 5085 {0x1a, 0x411111f0},
5085 { 5086 {0x1b, 0x411111f0},
5086 .codec = 0x10ec0255, 5087 {0x1d, 0x40700001},
5087 .subvendor = 0x1028, 5088 {0x1e, 0x411111f0}),
5088#ifdef CONFIG_SND_DEBUG_VERBOSE 5089 SND_HDA_PIN_QUIRK(0x10ec0293, 0x1028, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5089 .name = "Dell", 5090 {0x12, 0x40000000},
5090#endif 5091 {0x13, 0x90a60140},
5091 .pins = (const struct hda_pintbl[]) { 5092 {0x14, 0x90170110},
5092 {0x12, 0x90a60170}, 5093 {0x15, 0x0221401f},
5093 {0x14, 0x90170130}, 5094 {0x16, 0x411111f0},
5094 {0x17, 0x40000000}, 5095 {0x18, 0x411111f0},
5095 {0x18, 0x411111f0}, 5096 {0x19, 0x411111f0},
5096 {0x19, 0x411111f0}, 5097 {0x1a, 0x411111f0},
5097 {0x1a, 0x411111f0}, 5098 {0x1b, 0x411111f0},
5098 {0x1b, 0x411111f0}, 5099 {0x1d, 0x40700001},
5099 {0x1d, 0x40700001}, 5100 {0x1e, 0x411111f0}),
5100 {0x1e, 0x411111f0},
5101 {0x21, 0x02211040},
5102 },
5103 .value = ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
5104 },
5105 {
5106 .codec = 0x10ec0283,
5107 .subvendor = 0x1028,
5108#ifdef CONFIG_SND_DEBUG_VERBOSE
5109 .name = "Dell",
5110#endif
5111 .pins = (const struct hda_pintbl[]) {
5112 {0x12, 0x90a60130},
5113 {0x14, 0x90170110},
5114 {0x17, 0x40020008},
5115 {0x18, 0x411111f0},
5116 {0x19, 0x411111f0},
5117 {0x1a, 0x411111f0},
5118 {0x1b, 0x411111f0},
5119 {0x1d, 0x40e00001},
5120 {0x1e, 0x411111f0},
5121 {0x21, 0x0321101f},
5122 },
5123 .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5124 },
5125 {
5126 .codec = 0x10ec0283,
5127 .subvendor = 0x1028,
5128#ifdef CONFIG_SND_DEBUG_VERBOSE
5129 .name = "Dell",
5130#endif
5131 .pins = (const struct hda_pintbl[]) {
5132 {0x12, 0x90a60160},
5133 {0x14, 0x90170120},
5134 {0x17, 0x40000000},
5135 {0x18, 0x411111f0},
5136 {0x19, 0x411111f0},
5137 {0x1a, 0x411111f0},
5138 {0x1b, 0x411111f0},
5139 {0x1d, 0x40700001},
5140 {0x1e, 0x411111f0},
5141 {0x21, 0x02211030},
5142 },
5143 .value = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE,
5144 },
5145 {
5146 .codec = 0x10ec0292,
5147 .subvendor = 0x1028,
5148#ifdef CONFIG_SND_DEBUG_VERBOSE
5149 .name = "Dell",
5150#endif
5151 .pins = (const struct hda_pintbl[]) {
5152 {0x12, 0x90a60140},
5153 {0x13, 0x411111f0},
5154 {0x14, 0x90170110},
5155 {0x15, 0x0221401f},
5156 {0x16, 0x411111f0},
5157 {0x18, 0x411111f0},
5158 {0x19, 0x411111f0},
5159 {0x1a, 0x411111f0},
5160 {0x1b, 0x411111f0},
5161 {0x1d, 0x40700001},
5162 {0x1e, 0x411111f0},
5163 },
5164 .value = ALC269_FIXUP_DELL3_MIC_NO_PRESENCE,
5165 },
5166 {
5167 .codec = 0x10ec0293,
5168 .subvendor = 0x1028,
5169#ifdef CONFIG_SND_DEBUG_VERBOSE
5170 .name = "Dell",
5171#endif
5172 .pins = (const struct hda_pintbl[]) {
5173 {0x12, 0x40000000},
5174 {0x13, 0x90a60140},
5175 {0x14, 0x90170110},
5176 {0x15, 0x0221401f},
5177 {0x16, 0x21014020},
5178 {0x18, 0x411111f0},
5179 {0x19, 0x21a19030},
5180 {0x1a, 0x411111f0},
5181 {0x1b, 0x411111f0},
5182 {0x1d, 0x40700001},
5183 {0x1e, 0x411111f0},
5184 },
5185 .value = ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
5186 },
5187 {} 5101 {}
5188}; 5102};
5189 5103
@@ -6039,90 +5953,66 @@ static const struct hda_model_fixup alc662_fixup_models[] = {
6039}; 5953};
6040 5954
6041static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = { 5955static const struct snd_hda_pin_quirk alc662_pin_fixup_tbl[] = {
6042 { 5956 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6043 .codec = 0x10ec0668, 5957 {0x12, 0x99a30130},
6044 .subvendor = 0x1028, 5958 {0x14, 0x90170110},
6045#ifdef CONFIG_SND_DEBUG_VERBOSE 5959 {0x15, 0x0321101f},
6046 .name = "Dell", 5960 {0x16, 0x03011020},
6047#endif 5961 {0x18, 0x40000008},
6048 .pins = (const struct hda_pintbl[]) { 5962 {0x19, 0x411111f0},
6049 {0x12, 0x99a30130}, 5963 {0x1a, 0x411111f0},
6050 {0x14, 0x90170110}, 5964 {0x1b, 0x411111f0},
6051 {0x15, 0x0321101f}, 5965 {0x1d, 0x41000001},
6052 {0x16, 0x03011020}, 5966 {0x1e, 0x411111f0},
6053 {0x18, 0x40000008}, 5967 {0x1f, 0x411111f0}),
6054 {0x19, 0x411111f0}, 5968 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6055 {0x1a, 0x411111f0}, 5969 {0x12, 0x99a30140},
6056 {0x1b, 0x411111f0}, 5970 {0x14, 0x90170110},
6057 {0x1d, 0x41000001}, 5971 {0x15, 0x0321101f},
6058 {0x1e, 0x411111f0}, 5972 {0x16, 0x03011020},
6059 {0x1f, 0x411111f0}, 5973 {0x18, 0x40000008},
6060 }, 5974 {0x19, 0x411111f0},
6061 .value = ALC668_FIXUP_AUTO_MUTE, 5975 {0x1a, 0x411111f0},
6062 }, 5976 {0x1b, 0x411111f0},
6063 { 5977 {0x1d, 0x41000001},
6064 .codec = 0x10ec0668, 5978 {0x1e, 0x411111f0},
6065 .subvendor = 0x1028, 5979 {0x1f, 0x411111f0}),
6066#ifdef CONFIG_SND_DEBUG_VERBOSE 5980 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6067 .name = "Dell", 5981 {0x12, 0x99a30150},
6068#endif 5982 {0x14, 0x90170110},
6069 .pins = (const struct hda_pintbl[]) { 5983 {0x15, 0x0321101f},
6070 {0x12, 0x99a30140}, 5984 {0x16, 0x03011020},
6071 {0x14, 0x90170110}, 5985 {0x18, 0x40000008},
6072 {0x15, 0x0321101f}, 5986 {0x19, 0x411111f0},
6073 {0x16, 0x03011020}, 5987 {0x1a, 0x411111f0},
6074 {0x18, 0x40000008}, 5988 {0x1b, 0x411111f0},
6075 {0x19, 0x411111f0}, 5989 {0x1d, 0x41000001},
6076 {0x1a, 0x411111f0}, 5990 {0x1e, 0x411111f0},
6077 {0x1b, 0x411111f0}, 5991 {0x1f, 0x411111f0}),
6078 {0x1d, 0x41000001}, 5992 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell", ALC668_FIXUP_AUTO_MUTE,
6079 {0x1e, 0x411111f0}, 5993 {0x12, 0x411111f0},
6080 {0x1f, 0x411111f0}, 5994 {0x14, 0x90170110},
6081 }, 5995 {0x15, 0x0321101f},
6082 .value = ALC668_FIXUP_AUTO_MUTE, 5996 {0x16, 0x03011020},
6083 }, 5997 {0x18, 0x40000008},
6084 { 5998 {0x19, 0x411111f0},
6085 .codec = 0x10ec0668, 5999 {0x1a, 0x411111f0},
6086 .subvendor = 0x1028, 6000 {0x1b, 0x411111f0},
6087#ifdef CONFIG_SND_DEBUG_VERBOSE 6001 {0x1d, 0x41000001},
6088 .name = "Dell", 6002 {0x1e, 0x411111f0},
6089#endif 6003 {0x1f, 0x411111f0}),
6090 .pins = (const struct hda_pintbl[]) { 6004 SND_HDA_PIN_QUIRK(0x10ec0668, 0x1028, "Dell XPS 15", ALC668_FIXUP_AUTO_MUTE,
6091 {0x12, 0x99a30150}, 6005 {0x12, 0x90a60130},
6092 {0x14, 0x90170110}, 6006 {0x14, 0x90170110},
6093 {0x15, 0x0321101f}, 6007 {0x15, 0x0321101f},
6094 {0x16, 0x03011020}, 6008 {0x16, 0x40000000},
6095 {0x18, 0x40000008}, 6009 {0x18, 0x411111f0},
6096 {0x19, 0x411111f0}, 6010 {0x19, 0x411111f0},
6097 {0x1a, 0x411111f0}, 6011 {0x1a, 0x411111f0},
6098 {0x1b, 0x411111f0}, 6012 {0x1b, 0x411111f0},
6099 {0x1d, 0x41000001}, 6013 {0x1d, 0x40d6832d},
6100 {0x1e, 0x411111f0}, 6014 {0x1e, 0x411111f0},
6101 {0x1f, 0x411111f0}, 6015 {0x1f, 0x411111f0}),
6102 },
6103 .value = ALC668_FIXUP_AUTO_MUTE,
6104 },
6105 {
6106 .codec = 0x10ec0668,
6107 .subvendor = 0x1028,
6108#ifdef CONFIG_SND_DEBUG_VERBOSE
6109 .name = "Dell",
6110#endif
6111 .pins = (const struct hda_pintbl[]) {
6112 {0x12, 0x411111f0},
6113 {0x14, 0x90170110},
6114 {0x15, 0x0321101f},
6115 {0x16, 0x03011020},
6116 {0x18, 0x40000008},
6117 {0x19, 0x411111f0},
6118 {0x1a, 0x411111f0},
6119 {0x1b, 0x411111f0},
6120 {0x1d, 0x41000001},
6121 {0x1e, 0x411111f0},
6122 {0x1f, 0x411111f0},
6123 },
6124 .value = ALC668_FIXUP_AUTO_MUTE,
6125 },
6126 {} 6016 {}
6127}; 6017};
6128 6018
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 7f40a150899c..3744ea4e843d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -122,6 +122,12 @@ enum {
122}; 122};
123 123
124enum { 124enum {
125 STAC_92HD95_HP_LED,
126 STAC_92HD95_HP_BASS,
127 STAC_92HD95_MODELS
128};
129
130enum {
125 STAC_925x_REF, 131 STAC_925x_REF,
126 STAC_M1, 132 STAC_M1,
127 STAC_M1_2, 133 STAC_M1_2,
@@ -4128,6 +4134,48 @@ static const struct snd_pci_quirk stac9205_fixup_tbl[] = {
4128 {} /* terminator */ 4134 {} /* terminator */
4129}; 4135};
4130 4136
4137static void stac92hd95_fixup_hp_led(struct hda_codec *codec,
4138 const struct hda_fixup *fix, int action)
4139{
4140 struct sigmatel_spec *spec = codec->spec;
4141
4142 if (action != HDA_FIXUP_ACT_PRE_PROBE)
4143 return;
4144
4145 if (find_mute_led_cfg(codec, spec->default_polarity))
4146 codec_dbg(codec, "mute LED gpio %d polarity %d\n",
4147 spec->gpio_led,
4148 spec->gpio_led_polarity);
4149}
4150
4151static const struct hda_fixup stac92hd95_fixups[] = {
4152 [STAC_92HD95_HP_LED] = {
4153 .type = HDA_FIXUP_FUNC,
4154 .v.func = stac92hd95_fixup_hp_led,
4155 },
4156 [STAC_92HD95_HP_BASS] = {
4157 .type = HDA_FIXUP_VERBS,
4158 .v.verbs = (const struct hda_verb[]) {
4159 {0x1a, 0x795, 0x00}, /* HPF to 100Hz */
4160 {}
4161 },
4162 .chained = true,
4163 .chain_id = STAC_92HD95_HP_LED,
4164 },
4165};
4166
4167static const struct snd_pci_quirk stac92hd95_fixup_tbl[] = {
4168 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1911, "HP Spectre 13", STAC_92HD95_HP_BASS),
4169 {} /* terminator */
4170};
4171
4172static const struct hda_model_fixup stac92hd95_models[] = {
4173 { .id = STAC_92HD95_HP_LED, .name = "hp-led" },
4174 { .id = STAC_92HD95_HP_BASS, .name = "hp-bass" },
4175 {}
4176};
4177
4178
4131static int stac_parse_auto_config(struct hda_codec *codec) 4179static int stac_parse_auto_config(struct hda_codec *codec)
4132{ 4180{
4133 struct sigmatel_spec *spec = codec->spec; 4181 struct sigmatel_spec *spec = codec->spec;
@@ -4580,10 +4628,16 @@ static int patch_stac92hd95(struct hda_codec *codec)
4580 spec->gen.beep_nid = 0x19; /* digital beep */ 4628 spec->gen.beep_nid = 0x19; /* digital beep */
4581 spec->pwr_nids = stac92hd95_pwr_nids; 4629 spec->pwr_nids = stac92hd95_pwr_nids;
4582 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids); 4630 spec->num_pwrs = ARRAY_SIZE(stac92hd95_pwr_nids);
4583 spec->default_polarity = -1; /* no default cfg */ 4631 spec->default_polarity = 0;
4584 4632
4585 codec->patch_ops = stac_patch_ops; 4633 codec->patch_ops = stac_patch_ops;
4586 4634
4635 snd_hda_pick_fixup(codec, stac92hd95_models, stac92hd95_fixup_tbl,
4636 stac92hd95_fixups);
4637 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PRE_PROBE);
4638
4639 stac_setup_gpio(codec);
4640
4587 err = stac_parse_auto_config(codec); 4641 err = stac_parse_auto_config(codec);
4588 if (err < 0) { 4642 if (err < 0) {
4589 stac_free(codec); 4643 stac_free(codec);
@@ -4592,6 +4646,8 @@ static int patch_stac92hd95(struct hda_codec *codec)
4592 4646
4593 codec->proc_widget_hook = stac92hd_proc_hook; 4647 codec->proc_widget_hook = stac92hd_proc_hook;
4594 4648
4649 snd_hda_apply_fixup(codec, HDA_FIXUP_ACT_PROBE);
4650
4595 return 0; 4651 return 0;
4596} 4652}
4597 4653