diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-15 17:05:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-15 17:05:00 -0400 |
commit | 2dbb0e6c1961d823354c12bc1b66b005d1c78092 (patch) | |
tree | 166732407ebb9bfac32e4d23044ad300d9b867be /sound | |
parent | 8264fd046a0884d6bf475a784412978dbbd93175 (diff) | |
parent | da484d00f020af3dd7cfcc6c4b69a7f856832883 (diff) |
Merge tag 'sound-fix-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Some cleaning after the first batch; mostly about HD-audio quirks but
also some NULL dereference fixes in corner cases and a random build
error fix, too"
* tag 'sound-fix-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda/realtek - Add support headset mode for New DELL WYSE NB
ALSA: hda/realtek - Add support headset mode for DELL WYSE AIO
ALSA: hda/realtek: merge alc_fixup_headset_jack to alc295_fixup_chromebook
ALSA: pcm: Fix function name in kernel-doc comment
ALSA: hda: hdmi - add Icelake support
ALSA: hda - add more quirks for HP Z2 G4 and HP Z240
ALSA: hda/realtek - Fixed Headset Mic JD not stable
ALSA: hda/realtek: Enable headset MIC of Acer TravelMate X514-51T with ALC255
ALSA: hda/tegra: avoid build error without CONFIG_PM
ALSA: usx2y: Fix potential NULL pointer dereference
ALSA: hda: Avoid NULL pointer dereference at snd_hdac_stream_start()
Diffstat (limited to 'sound')
-rw-r--r-- | sound/hda/hdac_stream.c | 5 | ||||
-rw-r--r-- | sound/pci/hda/hda_tegra.c | 12 | ||||
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 3 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 67 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 65 | ||||
-rw-r--r-- | sound/usb/usx2y/usb_stream.c | 5 |
6 files changed, 125 insertions, 32 deletions
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c index f5dd288d1a7a..76e9b41fcea2 100644 --- a/sound/hda/hdac_stream.c +++ b/sound/hda/hdac_stream.c | |||
@@ -95,7 +95,10 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start) | |||
95 | 1 << azx_dev->index, | 95 | 1 << azx_dev->index, |
96 | 1 << azx_dev->index); | 96 | 1 << azx_dev->index); |
97 | /* set stripe control */ | 97 | /* set stripe control */ |
98 | stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream); | 98 | if (azx_dev->substream) |
99 | stripe_ctl = snd_hdac_get_stream_stripe_ctl(bus, azx_dev->substream); | ||
100 | else | ||
101 | stripe_ctl = 0; | ||
99 | snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK, | 102 | snd_hdac_stream_updateb(azx_dev, SD_CTL_3B, SD_CTL_STRIPE_MASK, |
100 | stripe_ctl); | 103 | stripe_ctl); |
101 | /* set DMA start and interrupt mask */ | 104 | /* set DMA start and interrupt mask */ |
diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c index dbd8da5685cb..3d68f9ef7694 100644 --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c | |||
@@ -219,7 +219,6 @@ disable_hda: | |||
219 | return rc; | 219 | return rc; |
220 | } | 220 | } |
221 | 221 | ||
222 | #ifdef CONFIG_PM_SLEEP | ||
223 | static void hda_tegra_disable_clocks(struct hda_tegra *data) | 222 | static void hda_tegra_disable_clocks(struct hda_tegra *data) |
224 | { | 223 | { |
225 | clk_disable_unprepare(data->hda2hdmi_clk); | 224 | clk_disable_unprepare(data->hda2hdmi_clk); |
@@ -230,7 +229,7 @@ static void hda_tegra_disable_clocks(struct hda_tegra *data) | |||
230 | /* | 229 | /* |
231 | * power management | 230 | * power management |
232 | */ | 231 | */ |
233 | static int hda_tegra_suspend(struct device *dev) | 232 | static int __maybe_unused hda_tegra_suspend(struct device *dev) |
234 | { | 233 | { |
235 | struct snd_card *card = dev_get_drvdata(dev); | 234 | struct snd_card *card = dev_get_drvdata(dev); |
236 | int rc; | 235 | int rc; |
@@ -243,7 +242,7 @@ static int hda_tegra_suspend(struct device *dev) | |||
243 | return 0; | 242 | return 0; |
244 | } | 243 | } |
245 | 244 | ||
246 | static int hda_tegra_resume(struct device *dev) | 245 | static int __maybe_unused hda_tegra_resume(struct device *dev) |
247 | { | 246 | { |
248 | struct snd_card *card = dev_get_drvdata(dev); | 247 | struct snd_card *card = dev_get_drvdata(dev); |
249 | int rc; | 248 | int rc; |
@@ -255,10 +254,8 @@ static int hda_tegra_resume(struct device *dev) | |||
255 | 254 | ||
256 | return 0; | 255 | return 0; |
257 | } | 256 | } |
258 | #endif /* CONFIG_PM_SLEEP */ | ||
259 | 257 | ||
260 | #ifdef CONFIG_PM | 258 | static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev) |
261 | static int hda_tegra_runtime_suspend(struct device *dev) | ||
262 | { | 259 | { |
263 | struct snd_card *card = dev_get_drvdata(dev); | 260 | struct snd_card *card = dev_get_drvdata(dev); |
264 | struct azx *chip = card->private_data; | 261 | struct azx *chip = card->private_data; |
@@ -275,7 +272,7 @@ static int hda_tegra_runtime_suspend(struct device *dev) | |||
275 | return 0; | 272 | return 0; |
276 | } | 273 | } |
277 | 274 | ||
278 | static int hda_tegra_runtime_resume(struct device *dev) | 275 | static int __maybe_unused hda_tegra_runtime_resume(struct device *dev) |
279 | { | 276 | { |
280 | struct snd_card *card = dev_get_drvdata(dev); | 277 | struct snd_card *card = dev_get_drvdata(dev); |
281 | struct azx *chip = card->private_data; | 278 | struct azx *chip = card->private_data; |
@@ -292,7 +289,6 @@ static int hda_tegra_runtime_resume(struct device *dev) | |||
292 | 289 | ||
293 | return 0; | 290 | return 0; |
294 | } | 291 | } |
295 | #endif /* CONFIG_PM */ | ||
296 | 292 | ||
297 | static const struct dev_pm_ops hda_tegra_pm = { | 293 | static const struct dev_pm_ops hda_tegra_pm = { |
298 | SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume) | 294 | SET_SYSTEM_SLEEP_PM_OPS(hda_tegra_suspend, hda_tegra_resume) |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index a4ee7656d9ee..fb65ad31e86c 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -936,6 +936,9 @@ static const struct snd_pci_quirk cxt5066_fixups[] = { | |||
936 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 936 | SND_PCI_QUIRK(0x103c, 0x8299, "HP 800 G3 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
937 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 937 | SND_PCI_QUIRK(0x103c, 0x829a, "HP 800 G3 DM", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
938 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), | 938 | SND_PCI_QUIRK(0x103c, 0x8455, "HP Z2 G4", CXT_FIXUP_HP_MIC_NO_PRESENCE), |
939 | SND_PCI_QUIRK(0x103c, 0x8456, "HP Z2 G4 SFF", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
940 | SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
941 | SND_PCI_QUIRK(0x103c, 0x8458, "HP Z2 G4 mini premium", CXT_FIXUP_HP_MIC_NO_PRESENCE), | ||
939 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), | 942 | SND_PCI_QUIRK(0x1043, 0x138d, "Asus", CXT_FIXUP_HEADPHONE_MIC_PIN), |
940 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), | 943 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT_FIXUP_OLPC_XO), |
941 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), | 944 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400", CXT_PINCFG_LENOVO_TP410), |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index 73d7042ff884..8b3ac690efa3 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -57,10 +57,11 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); | |||
57 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ | 57 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ |
58 | ((codec)->core.vendor_id == 0x80862800)) | 58 | ((codec)->core.vendor_id == 0x80862800)) |
59 | #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) | 59 | #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) |
60 | #define is_icelake(codec) ((codec)->core.vendor_id == 0x8086280f) | ||
60 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ | 61 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ |
61 | || is_skylake(codec) || is_broxton(codec) \ | 62 | || is_skylake(codec) || is_broxton(codec) \ |
62 | || is_kabylake(codec)) || is_geminilake(codec) \ | 63 | || is_kabylake(codec) || is_geminilake(codec) \ |
63 | || is_cannonlake(codec) | 64 | || is_cannonlake(codec) || is_icelake(codec)) |
64 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) | 65 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) |
65 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) | 66 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) |
66 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) | 67 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) |
@@ -181,6 +182,8 @@ struct hdmi_spec { | |||
181 | 182 | ||
182 | struct hdac_chmap chmap; | 183 | struct hdac_chmap chmap; |
183 | hda_nid_t vendor_nid; | 184 | hda_nid_t vendor_nid; |
185 | const int *port_map; | ||
186 | int port_num; | ||
184 | }; | 187 | }; |
185 | 188 | ||
186 | #ifdef CONFIG_SND_HDA_COMPONENT | 189 | #ifdef CONFIG_SND_HDA_COMPONENT |
@@ -2418,12 +2421,11 @@ static void intel_haswell_fixup_connect_list(struct hda_codec *codec, | |||
2418 | snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); | 2421 | snd_hda_override_conn_list(codec, nid, spec->num_cvts, spec->cvt_nids); |
2419 | } | 2422 | } |
2420 | 2423 | ||
2421 | #define INTEL_VENDOR_NID 0x08 | 2424 | #define INTEL_GET_VENDOR_VERB 0xf81 |
2422 | #define INTEL_GLK_VENDOR_NID 0x0B | 2425 | #define INTEL_GET_VENDOR_VERB 0xf81 |
2423 | #define INTEL_GET_VENDOR_VERB 0xf81 | 2426 | #define INTEL_SET_VENDOR_VERB 0x781 |
2424 | #define INTEL_SET_VENDOR_VERB 0x781 | 2427 | #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ |
2425 | #define INTEL_EN_DP12 0x02 /* enable DP 1.2 features */ | 2428 | #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ |
2426 | #define INTEL_EN_ALL_PIN_CVTS 0x01 /* enable 2nd & 3rd pins and convertors */ | ||
2427 | 2429 | ||
2428 | static void intel_haswell_enable_all_pins(struct hda_codec *codec, | 2430 | static void intel_haswell_enable_all_pins(struct hda_codec *codec, |
2429 | bool update_tree) | 2431 | bool update_tree) |
@@ -2503,11 +2505,29 @@ static int intel_base_nid(struct hda_codec *codec) | |||
2503 | 2505 | ||
2504 | static int intel_pin2port(void *audio_ptr, int pin_nid) | 2506 | static int intel_pin2port(void *audio_ptr, int pin_nid) |
2505 | { | 2507 | { |
2506 | int base_nid = intel_base_nid(audio_ptr); | 2508 | struct hda_codec *codec = audio_ptr; |
2509 | struct hdmi_spec *spec = codec->spec; | ||
2510 | int base_nid, i; | ||
2507 | 2511 | ||
2508 | if (WARN_ON(pin_nid < base_nid || pin_nid >= base_nid + 3)) | 2512 | if (!spec->port_num) { |
2509 | return -1; | 2513 | base_nid = intel_base_nid(codec); |
2510 | return pin_nid - base_nid + 1; /* intel port is 1-based */ | 2514 | if (WARN_ON(pin_nid < base_nid || pin_nid >= base_nid + 3)) |
2515 | return -1; | ||
2516 | return pin_nid - base_nid + 1; /* intel port is 1-based */ | ||
2517 | } | ||
2518 | |||
2519 | /* | ||
2520 | * looking for the pin number in the mapping table and return | ||
2521 | * the index which indicate the port number | ||
2522 | */ | ||
2523 | for (i = 0; i < spec->port_num; i++) { | ||
2524 | if (pin_nid == spec->port_map[i]) | ||
2525 | return i + 1; | ||
2526 | } | ||
2527 | |||
2528 | /* return -1 if pin number exceeds our expectation */ | ||
2529 | codec_info(codec, "Can't find the HDMI/DP port for pin %d\n", pin_nid); | ||
2530 | return -1; | ||
2511 | } | 2531 | } |
2512 | 2532 | ||
2513 | static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) | 2533 | static void intel_pin_eld_notify(void *audio_ptr, int port, int pipe) |
@@ -2608,7 +2628,8 @@ static int parse_intel_hdmi(struct hda_codec *codec) | |||
2608 | } | 2628 | } |
2609 | 2629 | ||
2610 | /* Intel Haswell and onwards; audio component with eld notifier */ | 2630 | /* Intel Haswell and onwards; audio component with eld notifier */ |
2611 | static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | 2631 | static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid, |
2632 | const int *port_map, int port_num) | ||
2612 | { | 2633 | { |
2613 | struct hdmi_spec *spec; | 2634 | struct hdmi_spec *spec; |
2614 | int err; | 2635 | int err; |
@@ -2620,6 +2641,8 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | |||
2620 | codec->dp_mst = true; | 2641 | codec->dp_mst = true; |
2621 | spec->dyn_pcm_assign = true; | 2642 | spec->dyn_pcm_assign = true; |
2622 | spec->vendor_nid = vendor_nid; | 2643 | spec->vendor_nid = vendor_nid; |
2644 | spec->port_map = port_map; | ||
2645 | spec->port_num = port_num; | ||
2623 | 2646 | ||
2624 | intel_haswell_enable_all_pins(codec, true); | 2647 | intel_haswell_enable_all_pins(codec, true); |
2625 | intel_haswell_fixup_enable_dp12(codec); | 2648 | intel_haswell_fixup_enable_dp12(codec); |
@@ -2638,12 +2661,23 @@ static int intel_hsw_common_init(struct hda_codec *codec, hda_nid_t vendor_nid) | |||
2638 | 2661 | ||
2639 | static int patch_i915_hsw_hdmi(struct hda_codec *codec) | 2662 | static int patch_i915_hsw_hdmi(struct hda_codec *codec) |
2640 | { | 2663 | { |
2641 | return intel_hsw_common_init(codec, INTEL_VENDOR_NID); | 2664 | return intel_hsw_common_init(codec, 0x08, NULL, 0); |
2642 | } | 2665 | } |
2643 | 2666 | ||
2644 | static int patch_i915_glk_hdmi(struct hda_codec *codec) | 2667 | static int patch_i915_glk_hdmi(struct hda_codec *codec) |
2645 | { | 2668 | { |
2646 | return intel_hsw_common_init(codec, INTEL_GLK_VENDOR_NID); | 2669 | return intel_hsw_common_init(codec, 0x0b, NULL, 0); |
2670 | } | ||
2671 | |||
2672 | static int patch_i915_icl_hdmi(struct hda_codec *codec) | ||
2673 | { | ||
2674 | /* | ||
2675 | * pin to port mapping table where the value indicate the pin number and | ||
2676 | * the index indicate the port number with 1 base. | ||
2677 | */ | ||
2678 | static const int map[] = {0x4, 0x6, 0x8, 0xa, 0xb}; | ||
2679 | |||
2680 | return intel_hsw_common_init(codec, 0x02, map, ARRAY_SIZE(map)); | ||
2647 | } | 2681 | } |
2648 | 2682 | ||
2649 | /* Intel Baytrail and Braswell; with eld notifier */ | 2683 | /* Intel Baytrail and Braswell; with eld notifier */ |
@@ -3886,6 +3920,7 @@ HDA_CODEC_ENTRY(0x11069f81, "VX900 HDMI/DP", patch_via_hdmi), | |||
3886 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), | 3920 | HDA_CODEC_ENTRY(0x11069f84, "VX11 HDMI/DP", patch_generic_hdmi), |
3887 | HDA_CODEC_ENTRY(0x11069f85, "VX11 HDMI/DP", patch_generic_hdmi), | 3921 | HDA_CODEC_ENTRY(0x11069f85, "VX11 HDMI/DP", patch_generic_hdmi), |
3888 | HDA_CODEC_ENTRY(0x80860054, "IbexPeak HDMI", patch_i915_cpt_hdmi), | 3922 | HDA_CODEC_ENTRY(0x80860054, "IbexPeak HDMI", patch_i915_cpt_hdmi), |
3923 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), | ||
3889 | HDA_CODEC_ENTRY(0x80862801, "Bearlake HDMI", patch_generic_hdmi), | 3924 | HDA_CODEC_ENTRY(0x80862801, "Bearlake HDMI", patch_generic_hdmi), |
3890 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), | 3925 | HDA_CODEC_ENTRY(0x80862802, "Cantiga HDMI", patch_generic_hdmi), |
3891 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), | 3926 | HDA_CODEC_ENTRY(0x80862803, "Eaglelake HDMI", patch_generic_hdmi), |
@@ -3899,7 +3934,7 @@ HDA_CODEC_ENTRY(0x8086280a, "Broxton HDMI", patch_i915_hsw_hdmi), | |||
3899 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), | 3934 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), |
3900 | HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), | 3935 | HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), |
3901 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), | 3936 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), |
3902 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), | 3937 | HDA_CODEC_ENTRY(0x8086280f, "Icelake HDMI", patch_i915_icl_hdmi), |
3903 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), | 3938 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), |
3904 | HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), | 3939 | HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi), |
3905 | HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi), | 3940 | HDA_CODEC_ENTRY(0x80862883, "Braswell HDMI", patch_i915_byt_hdmi), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index c8413d44973c..384719d5c44e 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -5491,7 +5491,7 @@ static void alc_headset_btn_callback(struct hda_codec *codec, | |||
5491 | jack->jack->button_state = report; | 5491 | jack->jack->button_state = report; |
5492 | } | 5492 | } |
5493 | 5493 | ||
5494 | static void alc_fixup_headset_jack(struct hda_codec *codec, | 5494 | static void alc295_fixup_chromebook(struct hda_codec *codec, |
5495 | const struct hda_fixup *fix, int action) | 5495 | const struct hda_fixup *fix, int action) |
5496 | { | 5496 | { |
5497 | 5497 | ||
@@ -5501,6 +5501,16 @@ static void alc_fixup_headset_jack(struct hda_codec *codec, | |||
5501 | alc_headset_btn_callback); | 5501 | alc_headset_btn_callback); |
5502 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, | 5502 | snd_hda_jack_add_kctl(codec, 0x55, "Headset Jack", false, |
5503 | SND_JACK_HEADSET, alc_headset_btn_keymap); | 5503 | SND_JACK_HEADSET, alc_headset_btn_keymap); |
5504 | switch (codec->core.vendor_id) { | ||
5505 | case 0x10ec0295: | ||
5506 | alc_update_coef_idx(codec, 0x4a, 0x8000, 1 << 15); /* Reset HP JD */ | ||
5507 | alc_update_coef_idx(codec, 0x4a, 0x8000, 0 << 15); | ||
5508 | break; | ||
5509 | case 0x10ec0236: | ||
5510 | alc_update_coef_idx(codec, 0x1b, 0x8000, 1 << 15); /* Reset HP JD */ | ||
5511 | alc_update_coef_idx(codec, 0x1b, 0x8000, 0 << 15); | ||
5512 | break; | ||
5513 | } | ||
5504 | break; | 5514 | break; |
5505 | case HDA_FIXUP_ACT_INIT: | 5515 | case HDA_FIXUP_ACT_INIT: |
5506 | switch (codec->core.vendor_id) { | 5516 | switch (codec->core.vendor_id) { |
@@ -5670,9 +5680,13 @@ enum { | |||
5670 | ALC294_FIXUP_ASUS_MIC, | 5680 | ALC294_FIXUP_ASUS_MIC, |
5671 | ALC294_FIXUP_ASUS_HEADSET_MIC, | 5681 | ALC294_FIXUP_ASUS_HEADSET_MIC, |
5672 | ALC294_FIXUP_ASUS_SPK, | 5682 | ALC294_FIXUP_ASUS_SPK, |
5673 | ALC225_FIXUP_HEADSET_JACK, | ||
5674 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, | 5683 | ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE, |
5675 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, | 5684 | ALC285_FIXUP_LENOVO_PC_BEEP_IN_NOISE, |
5685 | ALC255_FIXUP_ACER_HEADSET_MIC, | ||
5686 | ALC295_FIXUP_CHROME_BOOK, | ||
5687 | ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE, | ||
5688 | ALC225_FIXUP_WYSE_AUTO_MUTE, | ||
5689 | ALC225_FIXUP_WYSE_DISABLE_MIC_VREF, | ||
5676 | }; | 5690 | }; |
5677 | 5691 | ||
5678 | static const struct hda_fixup alc269_fixups[] = { | 5692 | static const struct hda_fixup alc269_fixups[] = { |
@@ -6615,9 +6629,9 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6615 | .chained = true, | 6629 | .chained = true, |
6616 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC | 6630 | .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC |
6617 | }, | 6631 | }, |
6618 | [ALC225_FIXUP_HEADSET_JACK] = { | 6632 | [ALC295_FIXUP_CHROME_BOOK] = { |
6619 | .type = HDA_FIXUP_FUNC, | 6633 | .type = HDA_FIXUP_FUNC, |
6620 | .v.func = alc_fixup_headset_jack, | 6634 | .v.func = alc295_fixup_chromebook, |
6621 | }, | 6635 | }, |
6622 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { | 6636 | [ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE] = { |
6623 | .type = HDA_FIXUP_PINS, | 6637 | .type = HDA_FIXUP_PINS, |
@@ -6639,6 +6653,38 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6639 | .chained = true, | 6653 | .chained = true, |
6640 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE | 6654 | .chain_id = ALC285_FIXUP_LENOVO_HEADPHONE_NOISE |
6641 | }, | 6655 | }, |
6656 | [ALC255_FIXUP_ACER_HEADSET_MIC] = { | ||
6657 | .type = HDA_FIXUP_PINS, | ||
6658 | .v.pins = (const struct hda_pintbl[]) { | ||
6659 | { 0x19, 0x03a11130 }, | ||
6660 | { 0x1a, 0x90a60140 }, /* use as internal mic */ | ||
6661 | { } | ||
6662 | }, | ||
6663 | .chained = true, | ||
6664 | .chain_id = ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
6665 | }, | ||
6666 | [ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE] = { | ||
6667 | .type = HDA_FIXUP_PINS, | ||
6668 | .v.pins = (const struct hda_pintbl[]) { | ||
6669 | { 0x16, 0x01011020 }, /* Rear Line out */ | ||
6670 | { 0x19, 0x01a1913c }, /* use as Front headset mic, without its own jack detect */ | ||
6671 | { } | ||
6672 | }, | ||
6673 | .chained = true, | ||
6674 | .chain_id = ALC225_FIXUP_WYSE_AUTO_MUTE | ||
6675 | }, | ||
6676 | [ALC225_FIXUP_WYSE_AUTO_MUTE] = { | ||
6677 | .type = HDA_FIXUP_FUNC, | ||
6678 | .v.func = alc_fixup_auto_mute_via_amp, | ||
6679 | .chained = true, | ||
6680 | .chain_id = ALC225_FIXUP_WYSE_DISABLE_MIC_VREF | ||
6681 | }, | ||
6682 | [ALC225_FIXUP_WYSE_DISABLE_MIC_VREF] = { | ||
6683 | .type = HDA_FIXUP_FUNC, | ||
6684 | .v.func = alc_fixup_disable_mic_vref, | ||
6685 | .chained = true, | ||
6686 | .chain_id = ALC269_FIXUP_HEADSET_MODE_NO_HP_MIC | ||
6687 | }, | ||
6642 | }; | 6688 | }; |
6643 | 6689 | ||
6644 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 6690 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -6658,6 +6704,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6658 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6704 | SND_PCI_QUIRK(0x1025, 0x128f, "Acer Veriton Z6860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6659 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6705 | SND_PCI_QUIRK(0x1025, 0x1290, "Acer Veriton Z4860G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6660 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), | 6706 | SND_PCI_QUIRK(0x1025, 0x1291, "Acer Veriton Z4660G", ALC286_FIXUP_ACER_AIO_MIC_NO_PRESENCE), |
6707 | SND_PCI_QUIRK(0x1025, 0x1330, "Acer TravelMate X514-51T", ALC255_FIXUP_ACER_HEADSET_MIC), | ||
6661 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), | 6708 | SND_PCI_QUIRK(0x1028, 0x0470, "Dell M101z", ALC269_FIXUP_DELL_M101Z), |
6662 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), | 6709 | SND_PCI_QUIRK(0x1028, 0x054b, "Dell XPS one 2710", ALC275_FIXUP_DELL_XPS), |
6663 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), | 6710 | SND_PCI_QUIRK(0x1028, 0x05bd, "Dell Latitude E6440", ALC292_FIXUP_DELL_E7X), |
@@ -6702,6 +6749,8 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6702 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | 6749 | SND_PCI_QUIRK(0x1028, 0x0871, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
6703 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), | 6750 | SND_PCI_QUIRK(0x1028, 0x0872, "Dell Precision 3630", ALC255_FIXUP_DELL_HEADSET_MIC), |
6704 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), | 6751 | SND_PCI_QUIRK(0x1028, 0x0873, "Dell Precision 3930", ALC255_FIXUP_DUMMY_LINEOUT_VERB), |
6752 | SND_PCI_QUIRK(0x1028, 0x08ad, "Dell WYSE AIO", ALC225_FIXUP_DELL_WYSE_AIO_MIC_NO_PRESENCE), | ||
6753 | SND_PCI_QUIRK(0x1028, 0x08ae, "Dell WYSE NB", ALC225_FIXUP_DELL1_MIC_NO_PRESENCE), | ||
6705 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), | 6754 | SND_PCI_QUIRK(0x1028, 0x0935, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB), |
6706 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 6755 | SND_PCI_QUIRK(0x1028, 0x164a, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
6707 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), | 6756 | SND_PCI_QUIRK(0x1028, 0x164b, "Dell", ALC293_FIXUP_DELL1_MIC_NO_PRESENCE), |
@@ -6764,11 +6813,13 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { | |||
6764 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 6813 | SND_PCI_QUIRK(0x103c, 0x2336, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6765 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), | 6814 | SND_PCI_QUIRK(0x103c, 0x2337, "HP", ALC269_FIXUP_HP_MUTE_LED_MIC1), |
6766 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), | 6815 | SND_PCI_QUIRK(0x103c, 0x221c, "HP EliteBook 755 G2", ALC280_FIXUP_HP_HEADSET_MIC), |
6816 | SND_PCI_QUIRK(0x103c, 0x802e, "HP Z240 SFF", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | ||
6817 | SND_PCI_QUIRK(0x103c, 0x802f, "HP Z240", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | ||
6767 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), | 6818 | SND_PCI_QUIRK(0x103c, 0x820d, "HP Pavilion 15", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
6768 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), | 6819 | SND_PCI_QUIRK(0x103c, 0x8256, "HP", ALC221_FIXUP_HP_FRONT_MIC), |
6769 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), | 6820 | SND_PCI_QUIRK(0x103c, 0x827e, "HP x360", ALC295_FIXUP_HP_X360), |
6770 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6821 | SND_PCI_QUIRK(0x103c, 0x82bf, "HP G3 mini", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6771 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP", ALC221_FIXUP_HP_MIC_NO_PRESENCE), | 6822 | SND_PCI_QUIRK(0x103c, 0x82c0, "HP G3 mini premium", ALC221_FIXUP_HP_MIC_NO_PRESENCE), |
6772 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), | 6823 | SND_PCI_QUIRK(0x103c, 0x83b9, "HP Spectre x360", ALC269_FIXUP_HP_MUTE_LED_MIC3), |
6773 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), | 6824 | SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), |
6774 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), | 6825 | SND_PCI_QUIRK(0x1043, 0x103f, "ASUS TX300", ALC282_FIXUP_ASUS_TX300), |
@@ -7048,7 +7099,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = { | |||
7048 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, | 7099 | {.id = ALC255_FIXUP_DUMMY_LINEOUT_VERB, .name = "alc255-dummy-lineout"}, |
7049 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, | 7100 | {.id = ALC255_FIXUP_DELL_HEADSET_MIC, .name = "alc255-dell-headset"}, |
7050 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, | 7101 | {.id = ALC295_FIXUP_HP_X360, .name = "alc295-hp-x360"}, |
7051 | {.id = ALC225_FIXUP_HEADSET_JACK, .name = "alc-sense-combo"}, | 7102 | {.id = ALC295_FIXUP_CHROME_BOOK, .name = "alc-sense-combo"}, |
7052 | {} | 7103 | {} |
7053 | }; | 7104 | }; |
7054 | #define ALC225_STANDARD_PINS \ | 7105 | #define ALC225_STANDARD_PINS \ |
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c index b0f8979ff2d2..221adf68bd0c 100644 --- a/sound/usb/usx2y/usb_stream.c +++ b/sound/usb/usx2y/usb_stream.c | |||
@@ -104,7 +104,12 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize, | |||
104 | 104 | ||
105 | for (u = 0; u < USB_STREAM_NURBS; ++u) { | 105 | for (u = 0; u < USB_STREAM_NURBS; ++u) { |
106 | sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL); | 106 | sk->inurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL); |
107 | if (!sk->inurb[u]) | ||
108 | return -ENOMEM; | ||
109 | |||
107 | sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL); | 110 | sk->outurb[u] = usb_alloc_urb(sk->n_o_ps, GFP_KERNEL); |
111 | if (!sk->outurb[u]) | ||
112 | return -ENOMEM; | ||
108 | } | 113 | } |
109 | 114 | ||
110 | if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) || | 115 | if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) || |