diff options
author | Takashi Iwai <tiwai@suse.de> | 2016-04-26 04:04:19 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2016-04-26 04:12:46 -0400 |
commit | a33d59599653edc6469c582f0ffd99c5fc58af04 (patch) | |
tree | 3edf0d94ce44dc12139d90ff850bbf222e82db5e | |
parent | 58a8738cfcdec389b3764a636303f97b57f85193 (diff) | |
parent | bb03ed216370cb021f377f923471e56d1de3ff5d (diff) |
Merge branch 'for-linus' into for-next
For taking back the recent change of HDA HDMI fixes for i915 HSW/BDW.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | include/sound/hda_i915.h | 5 | ||||
-rw-r--r-- | include/sound/hda_regmap.h | 2 | ||||
-rw-r--r-- | sound/hda/hdac_device.c | 10 | ||||
-rw-r--r-- | sound/hda/hdac_i915.c | 60 | ||||
-rw-r--r-- | sound/hda/hdac_regmap.c | 40 | ||||
-rw-r--r-- | sound/isa/sscape.c | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/hda_intel.c | 59 | ||||
-rw-r--r-- | sound/pci/hda/patch_cirrus.c | 14 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 12 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 12 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr_core.c | 1 | ||||
-rw-r--r-- | sound/usb/mixer_maps.c | 14 | ||||
-rw-r--r-- | sound/usb/quirks.c | 1 |
14 files changed, 146 insertions, 92 deletions
diff --git a/include/sound/hda_i915.h b/include/sound/hda_i915.h index eed87a7559b7..796cabf6be5e 100644 --- a/include/sound/hda_i915.h +++ b/include/sound/hda_i915.h | |||
@@ -9,7 +9,7 @@ | |||
9 | #ifdef CONFIG_SND_HDA_I915 | 9 | #ifdef CONFIG_SND_HDA_I915 |
10 | int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable); | 10 | int snd_hdac_set_codec_wakeup(struct hdac_bus *bus, bool enable); |
11 | int snd_hdac_display_power(struct hdac_bus *bus, bool enable); | 11 | int snd_hdac_display_power(struct hdac_bus *bus, bool enable); |
12 | int snd_hdac_get_display_clk(struct hdac_bus *bus); | 12 | void snd_hdac_i915_set_bclk(struct hdac_bus *bus); |
13 | int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid, int rate); | 13 | int snd_hdac_sync_audio_rate(struct hdac_device *codec, hda_nid_t nid, int rate); |
14 | int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, | 14 | int snd_hdac_acomp_get_eld(struct hdac_device *codec, hda_nid_t nid, |
15 | bool *audio_enabled, char *buffer, int max_bytes); | 15 | bool *audio_enabled, char *buffer, int max_bytes); |
@@ -25,9 +25,8 @@ static inline int snd_hdac_display_power(struct hdac_bus *bus, bool enable) | |||
25 | { | 25 | { |
26 | return 0; | 26 | return 0; |
27 | } | 27 | } |
28 | static inline int snd_hdac_get_display_clk(struct hdac_bus *bus) | 28 | static inline void snd_hdac_i915_set_bclk(struct hdac_bus *bus) |
29 | { | 29 | { |
30 | return 0; | ||
31 | } | 30 | } |
32 | static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec, | 31 | static inline int snd_hdac_sync_audio_rate(struct hdac_device *codec, |
33 | hda_nid_t nid, int rate) | 32 | hda_nid_t nid, int rate) |
diff --git a/include/sound/hda_regmap.h b/include/sound/hda_regmap.h index 2767c55a641e..ca64f0f50b45 100644 --- a/include/sound/hda_regmap.h +++ b/include/sound/hda_regmap.h | |||
@@ -17,6 +17,8 @@ int snd_hdac_regmap_add_vendor_verb(struct hdac_device *codec, | |||
17 | unsigned int verb); | 17 | unsigned int verb); |
18 | int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, | 18 | int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, |
19 | unsigned int *val); | 19 | unsigned int *val); |
20 | int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec, | ||
21 | unsigned int reg, unsigned int *val); | ||
20 | int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, | 22 | int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, |
21 | unsigned int val); | 23 | unsigned int val); |
22 | int snd_hdac_regmap_update_raw(struct hdac_device *codec, unsigned int reg, | 24 | int snd_hdac_regmap_update_raw(struct hdac_device *codec, unsigned int reg, |
diff --git a/sound/hda/hdac_device.c b/sound/hda/hdac_device.c index d1a4d6973330..03c9872c31cf 100644 --- a/sound/hda/hdac_device.c +++ b/sound/hda/hdac_device.c | |||
@@ -299,13 +299,11 @@ EXPORT_SYMBOL_GPL(_snd_hdac_read_parm); | |||
299 | int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid, | 299 | int snd_hdac_read_parm_uncached(struct hdac_device *codec, hda_nid_t nid, |
300 | int parm) | 300 | int parm) |
301 | { | 301 | { |
302 | int val; | 302 | unsigned int cmd, val; |
303 | 303 | ||
304 | if (codec->regmap) | 304 | cmd = snd_hdac_regmap_encode_verb(nid, AC_VERB_PARAMETERS) | parm; |
305 | regcache_cache_bypass(codec->regmap, true); | 305 | if (snd_hdac_regmap_read_raw_uncached(codec, cmd, &val) < 0) |
306 | val = snd_hdac_read_parm(codec, nid, parm); | 306 | return -1; |
307 | if (codec->regmap) | ||
308 | regcache_cache_bypass(codec->regmap, false); | ||
309 | return val; | 307 | return val; |
310 | } | 308 | } |
311 | EXPORT_SYMBOL_GPL(snd_hdac_read_parm_uncached); | 309 | EXPORT_SYMBOL_GPL(snd_hdac_read_parm_uncached); |
diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c index 6800e0c5a38f..c9af022676c2 100644 --- a/sound/hda/hdac_i915.c +++ b/sound/hda/hdac_i915.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <sound/core.h> | 20 | #include <sound/core.h> |
21 | #include <sound/hdaudio.h> | 21 | #include <sound/hdaudio.h> |
22 | #include <sound/hda_i915.h> | 22 | #include <sound/hda_i915.h> |
23 | #include <sound/hda_register.h> | ||
23 | 24 | ||
24 | static struct i915_audio_component *hdac_acomp; | 25 | static struct i915_audio_component *hdac_acomp; |
25 | 26 | ||
@@ -97,26 +98,65 @@ int snd_hdac_display_power(struct hdac_bus *bus, bool enable) | |||
97 | } | 98 | } |
98 | EXPORT_SYMBOL_GPL(snd_hdac_display_power); | 99 | EXPORT_SYMBOL_GPL(snd_hdac_display_power); |
99 | 100 | ||
101 | #define CONTROLLER_IN_GPU(pci) (((pci)->device == 0x0a0c) || \ | ||
102 | ((pci)->device == 0x0c0c) || \ | ||
103 | ((pci)->device == 0x0d0c) || \ | ||
104 | ((pci)->device == 0x160c)) | ||
105 | |||
100 | /** | 106 | /** |
101 | * snd_hdac_get_display_clk - Get CDCLK in kHz | 107 | * snd_hdac_i915_set_bclk - Reprogram BCLK for HSW/BDW |
102 | * @bus: HDA core bus | 108 | * @bus: HDA core bus |
103 | * | 109 | * |
104 | * This function is supposed to be used only by a HD-audio controller | 110 | * Intel HSW/BDW display HDA controller is in GPU. Both its power and link BCLK |
105 | * driver that needs the interaction with i915 graphics. | 111 | * depends on GPU. Two Extended Mode registers EM4 (M value) and EM5 (N Value) |
112 | * are used to convert CDClk (Core Display Clock) to 24MHz BCLK: | ||
113 | * BCLK = CDCLK * M / N | ||
114 | * The values will be lost when the display power well is disabled and need to | ||
115 | * be restored to avoid abnormal playback speed. | ||
106 | * | 116 | * |
107 | * This function queries CDCLK value in kHz from the graphics driver and | 117 | * Call this function at initializing and changing power well, as well as |
108 | * returns the value. A negative code is returned in error. | 118 | * at ELD notifier for the hotplug. |
109 | */ | 119 | */ |
110 | int snd_hdac_get_display_clk(struct hdac_bus *bus) | 120 | void snd_hdac_i915_set_bclk(struct hdac_bus *bus) |
111 | { | 121 | { |
112 | struct i915_audio_component *acomp = bus->audio_component; | 122 | struct i915_audio_component *acomp = bus->audio_component; |
123 | struct pci_dev *pci = to_pci_dev(bus->dev); | ||
124 | int cdclk_freq; | ||
125 | unsigned int bclk_m, bclk_n; | ||
126 | |||
127 | if (!acomp || !acomp->ops || !acomp->ops->get_cdclk_freq) | ||
128 | return; /* only for i915 binding */ | ||
129 | if (!CONTROLLER_IN_GPU(pci)) | ||
130 | return; /* only HSW/BDW */ | ||
131 | |||
132 | cdclk_freq = acomp->ops->get_cdclk_freq(acomp->dev); | ||
133 | switch (cdclk_freq) { | ||
134 | case 337500: | ||
135 | bclk_m = 16; | ||
136 | bclk_n = 225; | ||
137 | break; | ||
113 | 138 | ||
114 | if (!acomp || !acomp->ops) | 139 | case 450000: |
115 | return -ENODEV; | 140 | default: /* default CDCLK 450MHz */ |
141 | bclk_m = 4; | ||
142 | bclk_n = 75; | ||
143 | break; | ||
144 | |||
145 | case 540000: | ||
146 | bclk_m = 4; | ||
147 | bclk_n = 90; | ||
148 | break; | ||
149 | |||
150 | case 675000: | ||
151 | bclk_m = 8; | ||
152 | bclk_n = 225; | ||
153 | break; | ||
154 | } | ||
116 | 155 | ||
117 | return acomp->ops->get_cdclk_freq(acomp->dev); | 156 | snd_hdac_chip_writew(bus, HSW_EM4, bclk_m); |
157 | snd_hdac_chip_writew(bus, HSW_EM5, bclk_n); | ||
118 | } | 158 | } |
119 | EXPORT_SYMBOL_GPL(snd_hdac_get_display_clk); | 159 | EXPORT_SYMBOL_GPL(snd_hdac_i915_set_bclk); |
120 | 160 | ||
121 | /* There is a fixed mapping between audio pin node and display port. | 161 | /* There is a fixed mapping between audio pin node and display port. |
122 | * on SNB, IVY, HSW, BSW, SKL, BXT, KBL: | 162 | * on SNB, IVY, HSW, BSW, SKL, BXT, KBL: |
diff --git a/sound/hda/hdac_regmap.c b/sound/hda/hdac_regmap.c index bdbcd6b75ff6..87041ddd29cb 100644 --- a/sound/hda/hdac_regmap.c +++ b/sound/hda/hdac_regmap.c | |||
@@ -453,14 +453,30 @@ int snd_hdac_regmap_write_raw(struct hdac_device *codec, unsigned int reg, | |||
453 | EXPORT_SYMBOL_GPL(snd_hdac_regmap_write_raw); | 453 | EXPORT_SYMBOL_GPL(snd_hdac_regmap_write_raw); |
454 | 454 | ||
455 | static int reg_raw_read(struct hdac_device *codec, unsigned int reg, | 455 | static int reg_raw_read(struct hdac_device *codec, unsigned int reg, |
456 | unsigned int *val) | 456 | unsigned int *val, bool uncached) |
457 | { | 457 | { |
458 | if (!codec->regmap) | 458 | if (uncached || !codec->regmap) |
459 | return hda_reg_read(codec, reg, val); | 459 | return hda_reg_read(codec, reg, val); |
460 | else | 460 | else |
461 | return regmap_read(codec->regmap, reg, val); | 461 | return regmap_read(codec->regmap, reg, val); |
462 | } | 462 | } |
463 | 463 | ||
464 | static int __snd_hdac_regmap_read_raw(struct hdac_device *codec, | ||
465 | unsigned int reg, unsigned int *val, | ||
466 | bool uncached) | ||
467 | { | ||
468 | int err; | ||
469 | |||
470 | err = reg_raw_read(codec, reg, val, uncached); | ||
471 | if (err == -EAGAIN) { | ||
472 | err = snd_hdac_power_up_pm(codec); | ||
473 | if (!err) | ||
474 | err = reg_raw_read(codec, reg, val, uncached); | ||
475 | snd_hdac_power_down_pm(codec); | ||
476 | } | ||
477 | return err; | ||
478 | } | ||
479 | |||
464 | /** | 480 | /** |
465 | * snd_hdac_regmap_read_raw - read a pseudo register with power mgmt | 481 | * snd_hdac_regmap_read_raw - read a pseudo register with power mgmt |
466 | * @codec: the codec object | 482 | * @codec: the codec object |
@@ -472,19 +488,19 @@ static int reg_raw_read(struct hdac_device *codec, unsigned int reg, | |||
472 | int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, | 488 | int snd_hdac_regmap_read_raw(struct hdac_device *codec, unsigned int reg, |
473 | unsigned int *val) | 489 | unsigned int *val) |
474 | { | 490 | { |
475 | int err; | 491 | return __snd_hdac_regmap_read_raw(codec, reg, val, false); |
476 | |||
477 | err = reg_raw_read(codec, reg, val); | ||
478 | if (err == -EAGAIN) { | ||
479 | err = snd_hdac_power_up_pm(codec); | ||
480 | if (!err) | ||
481 | err = reg_raw_read(codec, reg, val); | ||
482 | snd_hdac_power_down_pm(codec); | ||
483 | } | ||
484 | return err; | ||
485 | } | 492 | } |
486 | EXPORT_SYMBOL_GPL(snd_hdac_regmap_read_raw); | 493 | EXPORT_SYMBOL_GPL(snd_hdac_regmap_read_raw); |
487 | 494 | ||
495 | /* Works like snd_hdac_regmap_read_raw(), but this doesn't read from the | ||
496 | * cache but always via hda verbs. | ||
497 | */ | ||
498 | int snd_hdac_regmap_read_raw_uncached(struct hdac_device *codec, | ||
499 | unsigned int reg, unsigned int *val) | ||
500 | { | ||
501 | return __snd_hdac_regmap_read_raw(codec, reg, val, true); | ||
502 | } | ||
503 | |||
488 | /** | 504 | /** |
489 | * snd_hdac_regmap_update_raw - update a pseudo register with power mgmt | 505 | * snd_hdac_regmap_update_raw - update a pseudo register with power mgmt |
490 | * @codec: the codec object | 506 | * @codec: the codec object |
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c index 7b248cdf06e2..fdcfa29e2205 100644 --- a/sound/isa/sscape.c +++ b/sound/isa/sscape.c | |||
@@ -591,7 +591,7 @@ static int sscape_upload_microcode(struct snd_card *card, int version) | |||
591 | } | 591 | } |
592 | err = upload_dma_data(sscape, init_fw->data, init_fw->size); | 592 | err = upload_dma_data(sscape, init_fw->data, init_fw->size); |
593 | if (err == 0) | 593 | if (err == 0) |
594 | snd_printk(KERN_INFO "sscape: MIDI firmware loaded %d KBs\n", | 594 | snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n", |
595 | init_fw->size >> 10); | 595 | init_fw->size >> 10); |
596 | 596 | ||
597 | release_firmware(init_fw); | 597 | release_firmware(init_fw); |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index dc2c13687118..320445f3bf73 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -826,7 +826,7 @@ static hda_nid_t path_power_update(struct hda_codec *codec, | |||
826 | bool allow_powerdown) | 826 | bool allow_powerdown) |
827 | { | 827 | { |
828 | hda_nid_t nid, changed = 0; | 828 | hda_nid_t nid, changed = 0; |
829 | int i, state; | 829 | int i, state, power; |
830 | 830 | ||
831 | for (i = 0; i < path->depth; i++) { | 831 | for (i = 0; i < path->depth; i++) { |
832 | nid = path->path[i]; | 832 | nid = path->path[i]; |
@@ -838,7 +838,9 @@ static hda_nid_t path_power_update(struct hda_codec *codec, | |||
838 | state = AC_PWRST_D0; | 838 | state = AC_PWRST_D0; |
839 | else | 839 | else |
840 | state = AC_PWRST_D3; | 840 | state = AC_PWRST_D3; |
841 | if (!snd_hda_check_power_state(codec, nid, state)) { | 841 | power = snd_hda_codec_read(codec, nid, 0, |
842 | AC_VERB_GET_POWER_STATE, 0); | ||
843 | if (power != (state | (state << 4))) { | ||
842 | snd_hda_codec_write(codec, nid, 0, | 844 | snd_hda_codec_write(codec, nid, 0, |
843 | AC_VERB_SET_POWER_STATE, state); | 845 | AC_VERB_SET_POWER_STATE, state); |
844 | changed = nid; | 846 | changed = nid; |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b680be0e937d..9a0d1445ca5c 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -857,50 +857,6 @@ static int param_set_xint(const char *val, const struct kernel_param *kp) | |||
857 | #define azx_del_card_list(chip) /* NOP */ | 857 | #define azx_del_card_list(chip) /* NOP */ |
858 | #endif /* CONFIG_PM */ | 858 | #endif /* CONFIG_PM */ |
859 | 859 | ||
860 | /* Intel HSW/BDW display HDA controller is in GPU. Both its power and link BCLK | ||
861 | * depends on GPU. Two Extended Mode registers EM4 (M value) and EM5 (N Value) | ||
862 | * are used to convert CDClk (Core Display Clock) to 24MHz BCLK: | ||
863 | * BCLK = CDCLK * M / N | ||
864 | * The values will be lost when the display power well is disabled and need to | ||
865 | * be restored to avoid abnormal playback speed. | ||
866 | */ | ||
867 | static void haswell_set_bclk(struct hda_intel *hda) | ||
868 | { | ||
869 | struct azx *chip = &hda->chip; | ||
870 | int cdclk_freq; | ||
871 | unsigned int bclk_m, bclk_n; | ||
872 | |||
873 | if (!hda->need_i915_power) | ||
874 | return; | ||
875 | |||
876 | cdclk_freq = snd_hdac_get_display_clk(azx_bus(chip)); | ||
877 | switch (cdclk_freq) { | ||
878 | case 337500: | ||
879 | bclk_m = 16; | ||
880 | bclk_n = 225; | ||
881 | break; | ||
882 | |||
883 | case 450000: | ||
884 | default: /* default CDCLK 450MHz */ | ||
885 | bclk_m = 4; | ||
886 | bclk_n = 75; | ||
887 | break; | ||
888 | |||
889 | case 540000: | ||
890 | bclk_m = 4; | ||
891 | bclk_n = 90; | ||
892 | break; | ||
893 | |||
894 | case 675000: | ||
895 | bclk_m = 8; | ||
896 | bclk_n = 225; | ||
897 | break; | ||
898 | } | ||
899 | |||
900 | azx_writew(chip, HSW_EM4, bclk_m); | ||
901 | azx_writew(chip, HSW_EM5, bclk_n); | ||
902 | } | ||
903 | |||
904 | #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) | 860 | #if defined(CONFIG_PM_SLEEP) || defined(SUPPORT_VGA_SWITCHEROO) |
905 | /* | 861 | /* |
906 | * power management | 862 | * power management |
@@ -958,7 +914,7 @@ static int azx_resume(struct device *dev) | |||
958 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL | 914 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL |
959 | && hda->need_i915_power) { | 915 | && hda->need_i915_power) { |
960 | snd_hdac_display_power(azx_bus(chip), true); | 916 | snd_hdac_display_power(azx_bus(chip), true); |
961 | haswell_set_bclk(hda); | 917 | snd_hdac_i915_set_bclk(azx_bus(chip)); |
962 | } | 918 | } |
963 | if (chip->msi) | 919 | if (chip->msi) |
964 | if (pci_enable_msi(pci) < 0) | 920 | if (pci_enable_msi(pci) < 0) |
@@ -1058,7 +1014,7 @@ static int azx_runtime_resume(struct device *dev) | |||
1058 | bus = azx_bus(chip); | 1014 | bus = azx_bus(chip); |
1059 | if (hda->need_i915_power) { | 1015 | if (hda->need_i915_power) { |
1060 | snd_hdac_display_power(bus, true); | 1016 | snd_hdac_display_power(bus, true); |
1061 | haswell_set_bclk(hda); | 1017 | snd_hdac_i915_set_bclk(bus); |
1062 | } else { | 1018 | } else { |
1063 | /* toggle codec wakeup bit for STATESTS read */ | 1019 | /* toggle codec wakeup bit for STATESTS read */ |
1064 | snd_hdac_set_codec_wakeup(bus, true); | 1020 | snd_hdac_set_codec_wakeup(bus, true); |
@@ -1796,12 +1752,8 @@ static int azx_first_init(struct azx *chip) | |||
1796 | /* initialize chip */ | 1752 | /* initialize chip */ |
1797 | azx_init_pci(chip); | 1753 | azx_init_pci(chip); |
1798 | 1754 | ||
1799 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) { | 1755 | if (chip->driver_caps & AZX_DCAPS_I915_POWERWELL) |
1800 | struct hda_intel *hda; | 1756 | snd_hdac_i915_set_bclk(bus); |
1801 | |||
1802 | hda = container_of(chip, struct hda_intel, chip); | ||
1803 | haswell_set_bclk(hda); | ||
1804 | } | ||
1805 | 1757 | ||
1806 | hda_intel_init_chip(chip, (probe_only[dev] & 2) == 0); | 1758 | hda_intel_init_chip(chip, (probe_only[dev] & 2) == 0); |
1807 | 1759 | ||
@@ -2232,6 +2184,9 @@ static const struct pci_device_id azx_ids[] = { | |||
2232 | /* Broxton-P(Apollolake) */ | 2184 | /* Broxton-P(Apollolake) */ |
2233 | { PCI_DEVICE(0x8086, 0x5a98), | 2185 | { PCI_DEVICE(0x8086, 0x5a98), |
2234 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, | 2186 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, |
2187 | /* Broxton-T */ | ||
2188 | { PCI_DEVICE(0x8086, 0x1a98), | ||
2189 | .driver_data = AZX_DRIVER_PCH | AZX_DCAPS_INTEL_BROXTON }, | ||
2235 | /* Haswell */ | 2190 | /* Haswell */ |
2236 | { PCI_DEVICE(0x8086, 0x0a0c), | 2191 | { PCI_DEVICE(0x8086, 0x0a0c), |
2237 | .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL }, | 2192 | .driver_data = AZX_DRIVER_HDMI | AZX_DCAPS_INTEL_HASWELL }, |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index a47e8ae0eb30..80bbadc83721 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
@@ -361,6 +361,7 @@ static int cs_parse_auto_config(struct hda_codec *codec) | |||
361 | { | 361 | { |
362 | struct cs_spec *spec = codec->spec; | 362 | struct cs_spec *spec = codec->spec; |
363 | int err; | 363 | int err; |
364 | int i; | ||
364 | 365 | ||
365 | err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); | 366 | err = snd_hda_parse_pin_defcfg(codec, &spec->gen.autocfg, NULL, 0); |
366 | if (err < 0) | 367 | if (err < 0) |
@@ -370,6 +371,19 @@ static int cs_parse_auto_config(struct hda_codec *codec) | |||
370 | if (err < 0) | 371 | if (err < 0) |
371 | return err; | 372 | return err; |
372 | 373 | ||
374 | /* keep the ADCs powered up when it's dynamically switchable */ | ||
375 | if (spec->gen.dyn_adc_switch) { | ||
376 | unsigned int done = 0; | ||
377 | for (i = 0; i < spec->gen.input_mux.num_items; i++) { | ||
378 | int idx = spec->gen.dyn_adc_idx[i]; | ||
379 | if (done & (1 << idx)) | ||
380 | continue; | ||
381 | snd_hda_gen_fix_pin_power(codec, | ||
382 | spec->gen.adc_nids[idx]); | ||
383 | done |= 1 << idx; | ||
384 | } | ||
385 | } | ||
386 | |||
373 | return 0; | 387 | return 0; |
374 | } | 388 | } |
375 | 389 | ||
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 9452384d2000..d2e57c72ba94 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -1397,7 +1397,6 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, | |||
1397 | struct hda_codec *codec = per_pin->codec; | 1397 | struct hda_codec *codec = per_pin->codec; |
1398 | struct hdmi_spec *spec = codec->spec; | 1398 | struct hdmi_spec *spec = codec->spec; |
1399 | struct hdmi_eld *eld = &spec->temp_eld; | 1399 | struct hdmi_eld *eld = &spec->temp_eld; |
1400 | struct hdmi_eld *pin_eld = &per_pin->sink_eld; | ||
1401 | hda_nid_t pin_nid = per_pin->pin_nid; | 1400 | hda_nid_t pin_nid = per_pin->pin_nid; |
1402 | /* | 1401 | /* |
1403 | * Always execute a GetPinSense verb here, even when called from | 1402 | * Always execute a GetPinSense verb here, even when called from |
@@ -1414,15 +1413,15 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, | |||
1414 | present = snd_hda_pin_sense(codec, pin_nid); | 1413 | present = snd_hda_pin_sense(codec, pin_nid); |
1415 | 1414 | ||
1416 | mutex_lock(&per_pin->lock); | 1415 | mutex_lock(&per_pin->lock); |
1417 | pin_eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); | 1416 | eld->monitor_present = !!(present & AC_PINSENSE_PRESENCE); |
1418 | if (pin_eld->monitor_present) | 1417 | if (eld->monitor_present) |
1419 | eld->eld_valid = !!(present & AC_PINSENSE_ELDV); | 1418 | eld->eld_valid = !!(present & AC_PINSENSE_ELDV); |
1420 | else | 1419 | else |
1421 | eld->eld_valid = false; | 1420 | eld->eld_valid = false; |
1422 | 1421 | ||
1423 | codec_dbg(codec, | 1422 | codec_dbg(codec, |
1424 | "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", | 1423 | "HDMI status: Codec=%d Pin=%d Presence_Detect=%d ELD_Valid=%d\n", |
1425 | codec->addr, pin_nid, pin_eld->monitor_present, eld->eld_valid); | 1424 | codec->addr, pin_nid, eld->monitor_present, eld->eld_valid); |
1426 | 1425 | ||
1427 | if (eld->eld_valid) { | 1426 | if (eld->eld_valid) { |
1428 | if (spec->ops.pin_get_eld(codec, pin_nid, eld->eld_buffer, | 1427 | if (spec->ops.pin_get_eld(codec, pin_nid, eld->eld_buffer, |
@@ -1442,7 +1441,7 @@ static bool hdmi_present_sense_via_verbs(struct hdmi_spec_per_pin *per_pin, | |||
1442 | else | 1441 | else |
1443 | update_eld(codec, per_pin, eld); | 1442 | update_eld(codec, per_pin, eld); |
1444 | 1443 | ||
1445 | ret = !repoll || !pin_eld->monitor_present || pin_eld->eld_valid; | 1444 | ret = !repoll || !eld->monitor_present || eld->eld_valid; |
1446 | 1445 | ||
1447 | jack = snd_hda_jack_tbl_get(codec, pin_nid); | 1446 | jack = snd_hda_jack_tbl_get(codec, pin_nid); |
1448 | if (jack) | 1447 | if (jack) |
@@ -1870,6 +1869,8 @@ static void hdmi_set_chmap(struct hdac_device *hdac, int pcm_idx, | |||
1870 | struct hdmi_spec *spec = codec->spec; | 1869 | struct hdmi_spec *spec = codec->spec; |
1871 | struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); | 1870 | struct hdmi_spec_per_pin *per_pin = pcm_idx_to_pin(spec, pcm_idx); |
1872 | 1871 | ||
1872 | if (!per_pin) | ||
1873 | return; | ||
1873 | mutex_lock(&per_pin->lock); | 1874 | mutex_lock(&per_pin->lock); |
1874 | per_pin->chmap_set = true; | 1875 | per_pin->chmap_set = true; |
1875 | memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap)); | 1876 | memcpy(per_pin->chmap, chmap, ARRAY_SIZE(per_pin->chmap)); |
@@ -2313,6 +2314,7 @@ static void intel_pin_eld_notify(void *audio_ptr, int port) | |||
2313 | if (atomic_read(&(codec)->core.in_pm)) | 2314 | if (atomic_read(&(codec)->core.in_pm)) |
2314 | return; | 2315 | return; |
2315 | 2316 | ||
2317 | snd_hdac_i915_set_bclk(&codec->bus->core); | ||
2316 | check_presence_and_report(codec, pin_nid); | 2318 | check_presence_and_report(codec, pin_nid); |
2317 | } | 2319 | } |
2318 | 2320 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index fefe83f2beab..ac4490a96863 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4760,6 +4760,7 @@ enum { | |||
4760 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, | 4760 | ALC225_FIXUP_DELL1_MIC_NO_PRESENCE, |
4761 | ALC280_FIXUP_HP_HEADSET_MIC, | 4761 | ALC280_FIXUP_HP_HEADSET_MIC, |
4762 | ALC221_FIXUP_HP_FRONT_MIC, | 4762 | ALC221_FIXUP_HP_FRONT_MIC, |
4763 | ALC292_FIXUP_TPT460, | ||
4763 | }; | 4764 | }; |
4764 | 4765 | ||
4765 | static const struct hda_fixup alc269_fixups[] = { | 4766 | static const struct hda_fixup alc269_fixups[] = { |
@@ -5409,6 +5410,12 @@ static const struct hda_fixup alc269_fixups[] = { | |||
5409 | { } | 5410 | { } |
5410 | }, | 5411 | }, |
5411 | }, | 5412 | }, |
5413 | [ALC292_FIXUP_TPT460] = { | ||
5414 | .type = HDA_FIXUP_FUNC, | ||
5415 | .v.func = alc_fixup_tpt440_dock, | ||
5416 | .chained = true, | ||
5417 | .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE, | ||
5418 | }, | ||
5412 | }; | 5419 | }; |
5413 | 5420 | ||
5414 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 5421 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -5442,6 +5449,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
5442 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 5449 | SND_PCI_QUIRK(0x1028, 0x064a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
5443 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 5450 | SND_PCI_QUIRK(0x1028, 0x064b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
5444 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), | 5451 | SND_PCI_QUIRK(0x1028, 0x0665, "Dell XPS 13", ALC288_FIXUP_DELL_XPS_13), |
5452 | SND_PCI_QUIRK(0x1028, 0x0669, "Dell Optiplex 9020m", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | ||
5445 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), | 5453 | SND_PCI_QUIRK(0x1028, 0x069a, "Dell Vostro 5480", ALC290_FIXUP_SUBWOOFER_HSJACK), |
5446 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), | 5454 | SND_PCI_QUIRK(0x1028, 0x06c7, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE), |
5447 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 5455 | SND_PCI_QUIRK(0x1028, 0x06d9, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
@@ -5563,7 +5571,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
5563 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), | 5571 | SND_PCI_QUIRK(0x17aa, 0x2218, "Thinkpad X1 Carbon 2nd", ALC292_FIXUP_TPT440_DOCK), |
5564 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), | 5572 | SND_PCI_QUIRK(0x17aa, 0x2223, "ThinkPad T550", ALC292_FIXUP_TPT440_DOCK), |
5565 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), | 5573 | SND_PCI_QUIRK(0x17aa, 0x2226, "ThinkPad X250", ALC292_FIXUP_TPT440_DOCK), |
5566 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), | 5574 | SND_PCI_QUIRK(0x17aa, 0x2233, "Thinkpad", ALC292_FIXUP_TPT460), |
5567 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 5575 | SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
5568 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), | 5576 | SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY), |
5569 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), | 5577 | SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI), |
@@ -5576,6 +5584,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
5576 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), | 5584 | SND_PCI_QUIRK(0x17aa, 0x5034, "Thinkpad T450", ALC292_FIXUP_TPT440_DOCK), |
5577 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), | 5585 | SND_PCI_QUIRK(0x17aa, 0x5036, "Thinkpad T450s", ALC292_FIXUP_TPT440_DOCK), |
5578 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), | 5586 | SND_PCI_QUIRK(0x17aa, 0x503c, "Thinkpad L450", ALC292_FIXUP_TPT440_DOCK), |
5587 | SND_PCI_QUIRK(0x17aa, 0x504a, "ThinkPad X260", ALC292_FIXUP_TPT440_DOCK), | ||
5579 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), | 5588 | SND_PCI_QUIRK(0x17aa, 0x504b, "Thinkpad", ALC293_FIXUP_LENOVO_SPK_NOISE), |
5580 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), | 5589 | SND_PCI_QUIRK(0x17aa, 0x5109, "Thinkpad", ALC269_FIXUP_LIMIT_INT_MIC_BOOST), |
5581 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), | 5590 | SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K), |
@@ -5658,6 +5667,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
5658 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, | 5667 | {.id = ALC283_FIXUP_SENSE_COMBO_JACK, .name = "alc283-sense-combo"}, |
5659 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, | 5668 | {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"}, |
5660 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, | 5669 | {.id = ALC292_FIXUP_TPT440, .name = "tpt440"}, |
5670 | {.id = ALC292_FIXUP_TPT460, .name = "tpt460"}, | ||
5661 | {} | 5671 | {} |
5662 | }; | 5672 | }; |
5663 | #define ALC225_STANDARD_PINS \ | 5673 | #define ALC225_STANDARD_PINS \ |
diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c index c5194f5b150a..d7e71f309299 100644 --- a/sound/pci/pcxhr/pcxhr_core.c +++ b/sound/pci/pcxhr/pcxhr_core.c | |||
@@ -1341,5 +1341,6 @@ irqreturn_t pcxhr_threaded_irq(int irq, void *dev_id) | |||
1341 | } | 1341 | } |
1342 | 1342 | ||
1343 | pcxhr_msg_thread(mgr); | 1343 | pcxhr_msg_thread(mgr); |
1344 | mutex_unlock(&mgr->lock); | ||
1344 | return IRQ_HANDLED; | 1345 | return IRQ_HANDLED; |
1345 | } | 1346 | } |
diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c index ddca6547399b..1f8fb0d904e0 100644 --- a/sound/usb/mixer_maps.c +++ b/sound/usb/mixer_maps.c | |||
@@ -349,6 +349,16 @@ static struct usbmix_name_map bose_companion5_map[] = { | |||
349 | }; | 349 | }; |
350 | 350 | ||
351 | /* | 351 | /* |
352 | * Dell usb dock with ALC4020 codec had a firmware problem where it got | ||
353 | * screwed up when zero volume is passed; just skip it as a workaround | ||
354 | */ | ||
355 | static const struct usbmix_name_map dell_alc4020_map[] = { | ||
356 | { 16, NULL }, | ||
357 | { 19, NULL }, | ||
358 | { 0 } | ||
359 | }; | ||
360 | |||
361 | /* | ||
352 | * Control map entries | 362 | * Control map entries |
353 | */ | 363 | */ |
354 | 364 | ||
@@ -431,6 +441,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { | |||
431 | .map = aureon_51_2_map, | 441 | .map = aureon_51_2_map, |
432 | }, | 442 | }, |
433 | { | 443 | { |
444 | .id = USB_ID(0x0bda, 0x4014), | ||
445 | .map = dell_alc4020_map, | ||
446 | }, | ||
447 | { | ||
434 | .id = USB_ID(0x0dba, 0x1000), | 448 | .id = USB_ID(0x0dba, 0x1000), |
435 | .map = mbox1_map, | 449 | .map = mbox1_map, |
436 | }, | 450 | }, |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 24c7c2311b47..0adfd9537cf7 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1134,6 +1134,7 @@ bool snd_usb_get_sample_rate_quirk(struct snd_usb_audio *chip) | |||
1134 | case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ | 1134 | case USB_ID(0x045E, 0x076F): /* MS Lifecam HD-6000 */ |
1135 | case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ | 1135 | case USB_ID(0x045E, 0x0772): /* MS Lifecam Studio */ |
1136 | case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ | 1136 | case USB_ID(0x045E, 0x0779): /* MS Lifecam HD-3000 */ |
1137 | case USB_ID(0x047F, 0x0415): /* Plantronics BT-300 */ | ||
1137 | case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ | 1138 | case USB_ID(0x047F, 0xAA05): /* Plantronics DA45 */ |
1138 | case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ | 1139 | case USB_ID(0x04D8, 0xFEEA): /* Benchmark DAC1 Pre */ |
1139 | case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ | 1140 | case USB_ID(0x074D, 0x3553): /* Outlaw RR2150 (Micronas UAC3553B) */ |