diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-20 16:03:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-12-20 16:03:20 -0500 |
commit | a5f89a5015d4ca86e4fe48e924146ded01627fbb (patch) | |
tree | 309485691f312b73ce6b735f67143ab74ac0b9b8 | |
parent | 10a7e9d849150a2879efc0b04d8a51068c9dd0c5 (diff) | |
parent | 5a15f289ee87eaf33f13f08a4909ec99d837ec5f (diff) |
Merge tag 'sound-4.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"All stable fixes here:
- a regression fix of USB-audio for the previous hardening patch
- a potential UAF fix in rawmidi
- HD-audio and USB-audio quirks, the missing new ID"
* tag 'sound-4.15-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: usb-audio: Fix the missing ctl name suffix at parsing SU
ALSA: hda/realtek - Fix Dell AIO LineOut issue
ALSA: rawmidi: Avoid racy info ioctl via ctl device
ALSA: hda - Add vendor id for Cannonlake HDMI codec
ALSA: usb-audio: Add native DSD support for Esoteric D-05X
-rw-r--r-- | sound/core/rawmidi.c | 15 | ||||
-rw-r--r-- | sound/pci/hda/patch_hdmi.c | 6 | ||||
-rw-r--r-- | sound/pci/hda/patch_realtek.c | 35 | ||||
-rw-r--r-- | sound/usb/mixer.c | 27 | ||||
-rw-r--r-- | sound/usb/quirks.c | 7 |
5 files changed, 70 insertions, 20 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index b3b353d72527..f055ca10bbc1 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -579,15 +579,14 @@ static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream, | |||
579 | return 0; | 579 | return 0; |
580 | } | 580 | } |
581 | 581 | ||
582 | int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) | 582 | static int __snd_rawmidi_info_select(struct snd_card *card, |
583 | struct snd_rawmidi_info *info) | ||
583 | { | 584 | { |
584 | struct snd_rawmidi *rmidi; | 585 | struct snd_rawmidi *rmidi; |
585 | struct snd_rawmidi_str *pstr; | 586 | struct snd_rawmidi_str *pstr; |
586 | struct snd_rawmidi_substream *substream; | 587 | struct snd_rawmidi_substream *substream; |
587 | 588 | ||
588 | mutex_lock(®ister_mutex); | ||
589 | rmidi = snd_rawmidi_search(card, info->device); | 589 | rmidi = snd_rawmidi_search(card, info->device); |
590 | mutex_unlock(®ister_mutex); | ||
591 | if (!rmidi) | 590 | if (!rmidi) |
592 | return -ENXIO; | 591 | return -ENXIO; |
593 | if (info->stream < 0 || info->stream > 1) | 592 | if (info->stream < 0 || info->stream > 1) |
@@ -603,6 +602,16 @@ int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info | |||
603 | } | 602 | } |
604 | return -ENXIO; | 603 | return -ENXIO; |
605 | } | 604 | } |
605 | |||
606 | int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) | ||
607 | { | ||
608 | int ret; | ||
609 | |||
610 | mutex_lock(®ister_mutex); | ||
611 | ret = __snd_rawmidi_info_select(card, info); | ||
612 | mutex_unlock(®ister_mutex); | ||
613 | return ret; | ||
614 | } | ||
606 | EXPORT_SYMBOL(snd_rawmidi_info_select); | 615 | EXPORT_SYMBOL(snd_rawmidi_info_select); |
607 | 616 | ||
608 | static int snd_rawmidi_info_select_user(struct snd_card *card, | 617 | static int snd_rawmidi_info_select_user(struct snd_card *card, |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index c19c81d230bd..b4f1b6e88305 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
@@ -55,10 +55,11 @@ MODULE_PARM_DESC(static_hdmi_pcm, "Don't restrict PCM parameters per ELD info"); | |||
55 | #define is_kabylake(codec) ((codec)->core.vendor_id == 0x8086280b) | 55 | #define is_kabylake(codec) ((codec)->core.vendor_id == 0x8086280b) |
56 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ | 56 | #define is_geminilake(codec) (((codec)->core.vendor_id == 0x8086280d) || \ |
57 | ((codec)->core.vendor_id == 0x80862800)) | 57 | ((codec)->core.vendor_id == 0x80862800)) |
58 | #define is_cannonlake(codec) ((codec)->core.vendor_id == 0x8086280c) | ||
58 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ | 59 | #define is_haswell_plus(codec) (is_haswell(codec) || is_broadwell(codec) \ |
59 | || is_skylake(codec) || is_broxton(codec) \ | 60 | || is_skylake(codec) || is_broxton(codec) \ |
60 | || is_kabylake(codec)) || is_geminilake(codec) | 61 | || is_kabylake(codec)) || is_geminilake(codec) \ |
61 | 62 | || is_cannonlake(codec) | |
62 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) | 63 | #define is_valleyview(codec) ((codec)->core.vendor_id == 0x80862882) |
63 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) | 64 | #define is_cherryview(codec) ((codec)->core.vendor_id == 0x80862883) |
64 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) | 65 | #define is_valleyview_plus(codec) (is_valleyview(codec) || is_cherryview(codec)) |
@@ -3841,6 +3842,7 @@ HDA_CODEC_ENTRY(0x80862808, "Broadwell HDMI", patch_i915_hsw_hdmi), | |||
3841 | HDA_CODEC_ENTRY(0x80862809, "Skylake HDMI", patch_i915_hsw_hdmi), | 3842 | HDA_CODEC_ENTRY(0x80862809, "Skylake HDMI", patch_i915_hsw_hdmi), |
3842 | HDA_CODEC_ENTRY(0x8086280a, "Broxton HDMI", patch_i915_hsw_hdmi), | 3843 | HDA_CODEC_ENTRY(0x8086280a, "Broxton HDMI", patch_i915_hsw_hdmi), |
3843 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), | 3844 | HDA_CODEC_ENTRY(0x8086280b, "Kabylake HDMI", patch_i915_hsw_hdmi), |
3845 | HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi), | ||
3844 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), | 3846 | HDA_CODEC_ENTRY(0x8086280d, "Geminilake HDMI", patch_i915_glk_hdmi), |
3845 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), | 3847 | HDA_CODEC_ENTRY(0x80862800, "Geminilake HDMI", patch_i915_glk_hdmi), |
3846 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), | 3848 | HDA_CODEC_ENTRY(0x80862880, "CedarTrail HDMI", patch_generic_hdmi), |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4b21f71d685c..6a4db00511ab 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -5185,6 +5185,22 @@ static void alc233_alc662_fixup_lenovo_dual_codecs(struct hda_codec *codec, | |||
5185 | } | 5185 | } |
5186 | } | 5186 | } |
5187 | 5187 | ||
5188 | /* Forcibly assign NID 0x03 to HP/LO while NID 0x02 to SPK for EQ */ | ||
5189 | static void alc274_fixup_bind_dacs(struct hda_codec *codec, | ||
5190 | const struct hda_fixup *fix, int action) | ||
5191 | { | ||
5192 | struct alc_spec *spec = codec->spec; | ||
5193 | static hda_nid_t preferred_pairs[] = { | ||
5194 | 0x21, 0x03, 0x1b, 0x03, 0x16, 0x02, | ||
5195 | 0 | ||
5196 | }; | ||
5197 | |||
5198 | if (action != HDA_FIXUP_ACT_PRE_PROBE) | ||
5199 | return; | ||
5200 | |||
5201 | spec->gen.preferred_dacs = preferred_pairs; | ||
5202 | } | ||
5203 | |||
5188 | /* for hda_fixup_thinkpad_acpi() */ | 5204 | /* for hda_fixup_thinkpad_acpi() */ |
5189 | #include "thinkpad_helper.c" | 5205 | #include "thinkpad_helper.c" |
5190 | 5206 | ||
@@ -5302,6 +5318,8 @@ enum { | |||
5302 | ALC233_FIXUP_LENOVO_MULTI_CODECS, | 5318 | ALC233_FIXUP_LENOVO_MULTI_CODECS, |
5303 | ALC294_FIXUP_LENOVO_MIC_LOCATION, | 5319 | ALC294_FIXUP_LENOVO_MIC_LOCATION, |
5304 | ALC700_FIXUP_INTEL_REFERENCE, | 5320 | ALC700_FIXUP_INTEL_REFERENCE, |
5321 | ALC274_FIXUP_DELL_BIND_DACS, | ||
5322 | ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, | ||
5305 | }; | 5323 | }; |
5306 | 5324 | ||
5307 | static const struct hda_fixup alc269_fixups[] = { | 5325 | static const struct hda_fixup alc269_fixups[] = { |
@@ -6112,6 +6130,21 @@ static const struct hda_fixup alc269_fixups[] = { | |||
6112 | {} | 6130 | {} |
6113 | } | 6131 | } |
6114 | }, | 6132 | }, |
6133 | [ALC274_FIXUP_DELL_BIND_DACS] = { | ||
6134 | .type = HDA_FIXUP_FUNC, | ||
6135 | .v.func = alc274_fixup_bind_dacs, | ||
6136 | .chained = true, | ||
6137 | .chain_id = ALC269_FIXUP_DELL1_MIC_NO_PRESENCE | ||
6138 | }, | ||
6139 | [ALC274_FIXUP_DELL_AIO_LINEOUT_VERB] = { | ||
6140 | .type = HDA_FIXUP_PINS, | ||
6141 | .v.pins = (const struct hda_pintbl[]) { | ||
6142 | { 0x1b, 0x0401102f }, | ||
6143 | { } | ||
6144 | }, | ||
6145 | .chained = true, | ||
6146 | .chain_id = ALC274_FIXUP_DELL_BIND_DACS | ||
6147 | }, | ||
6115 | }; | 6148 | }; |
6116 | 6149 | ||
6117 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { | 6150 | static const struct snd_pci_quirk alc269_fixup_tbl[] = { |
@@ -6578,7 +6611,7 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
6578 | {0x14, 0x90170110}, | 6611 | {0x14, 0x90170110}, |
6579 | {0x1b, 0x90a70130}, | 6612 | {0x1b, 0x90a70130}, |
6580 | {0x21, 0x03211020}), | 6613 | {0x21, 0x03211020}), |
6581 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | 6614 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC274_FIXUP_DELL_AIO_LINEOUT_VERB, |
6582 | {0x12, 0xb7a60130}, | 6615 | {0x12, 0xb7a60130}, |
6583 | {0x13, 0xb8a61140}, | 6616 | {0x13, 0xb8a61140}, |
6584 | {0x16, 0x90170110}, | 6617 | {0x16, 0x90170110}, |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 7c9e361b2200..2b4ceda36291 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -2173,20 +2173,25 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, | |||
2173 | kctl->private_value = (unsigned long)namelist; | 2173 | kctl->private_value = (unsigned long)namelist; |
2174 | kctl->private_free = usb_mixer_selector_elem_free; | 2174 | kctl->private_free = usb_mixer_selector_elem_free; |
2175 | 2175 | ||
2176 | nameid = uac_selector_unit_iSelector(desc); | 2176 | /* check the static mapping table at first */ |
2177 | len = check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name)); | 2177 | len = check_mapped_name(map, kctl->id.name, sizeof(kctl->id.name)); |
2178 | if (len) | ||
2179 | ; | ||
2180 | else if (nameid) | ||
2181 | len = snd_usb_copy_string_desc(state, nameid, kctl->id.name, | ||
2182 | sizeof(kctl->id.name)); | ||
2183 | else | ||
2184 | len = get_term_name(state, &state->oterm, | ||
2185 | kctl->id.name, sizeof(kctl->id.name), 0); | ||
2186 | |||
2187 | if (!len) { | 2178 | if (!len) { |
2188 | strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name)); | 2179 | /* no mapping ? */ |
2180 | /* if iSelector is given, use it */ | ||
2181 | nameid = uac_selector_unit_iSelector(desc); | ||
2182 | if (nameid) | ||
2183 | len = snd_usb_copy_string_desc(state, nameid, | ||
2184 | kctl->id.name, | ||
2185 | sizeof(kctl->id.name)); | ||
2186 | /* ... or pick up the terminal name at next */ | ||
2187 | if (!len) | ||
2188 | len = get_term_name(state, &state->oterm, | ||
2189 | kctl->id.name, sizeof(kctl->id.name), 0); | ||
2190 | /* ... or use the fixed string "USB" as the last resort */ | ||
2191 | if (!len) | ||
2192 | strlcpy(kctl->id.name, "USB", sizeof(kctl->id.name)); | ||
2189 | 2193 | ||
2194 | /* and add the proper suffix */ | ||
2190 | if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR) | 2195 | if (desc->bDescriptorSubtype == UAC2_CLOCK_SELECTOR) |
2191 | append_ctl_name(kctl, " Clock Source"); | 2196 | append_ctl_name(kctl, " Clock Source"); |
2192 | else if ((state->oterm.type & 0xff00) == 0x0100) | 2197 | else if ((state->oterm.type & 0xff00) == 0x0100) |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 77eecaa4db1f..a66ef5777887 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
@@ -1166,10 +1166,11 @@ static bool is_marantz_denon_dac(unsigned int id) | |||
1166 | /* TEAC UD-501/UD-503/NT-503 USB DACs need a vendor cmd to switch | 1166 | /* TEAC UD-501/UD-503/NT-503 USB DACs need a vendor cmd to switch |
1167 | * between PCM/DOP and native DSD mode | 1167 | * between PCM/DOP and native DSD mode |
1168 | */ | 1168 | */ |
1169 | static bool is_teac_50X_dac(unsigned int id) | 1169 | static bool is_teac_dsd_dac(unsigned int id) |
1170 | { | 1170 | { |
1171 | switch (id) { | 1171 | switch (id) { |
1172 | case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */ | 1172 | case USB_ID(0x0644, 0x8043): /* TEAC UD-501/UD-503/NT-503 */ |
1173 | case USB_ID(0x0644, 0x8044): /* Esoteric D-05X */ | ||
1173 | return true; | 1174 | return true; |
1174 | } | 1175 | } |
1175 | return false; | 1176 | return false; |
@@ -1202,7 +1203,7 @@ int snd_usb_select_mode_quirk(struct snd_usb_substream *subs, | |||
1202 | break; | 1203 | break; |
1203 | } | 1204 | } |
1204 | mdelay(20); | 1205 | mdelay(20); |
1205 | } else if (is_teac_50X_dac(subs->stream->chip->usb_id)) { | 1206 | } else if (is_teac_dsd_dac(subs->stream->chip->usb_id)) { |
1206 | /* Vendor mode switch cmd is required. */ | 1207 | /* Vendor mode switch cmd is required. */ |
1207 | switch (fmt->altsetting) { | 1208 | switch (fmt->altsetting) { |
1208 | case 3: /* DSD mode (DSD_U32) requested */ | 1209 | case 3: /* DSD mode (DSD_U32) requested */ |
@@ -1392,7 +1393,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
1392 | } | 1393 | } |
1393 | 1394 | ||
1394 | /* TEAC devices with USB DAC functionality */ | 1395 | /* TEAC devices with USB DAC functionality */ |
1395 | if (is_teac_50X_dac(chip->usb_id)) { | 1396 | if (is_teac_dsd_dac(chip->usb_id)) { |
1396 | if (fp->altsetting == 3) | 1397 | if (fp->altsetting == 3) |
1397 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | 1398 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
1398 | } | 1399 | } |