summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-04-12 10:13:30 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-21 09:06:39 +0200
commit6bd82d427fb0b55bc4788ad7f7df9d3bd2f1f290 (patch)
treefd94f082cc7e57f219fa6aba2a1f5bd471b40fdd
parentd127d6327339c4e1a7eeadc8a3ef87927b614b30 (diff)
downloadlinux-6bd82d427fb0b55bc4788ad7f7df9d3bd2f1f290.tar.gz
linux-6bd82d427fb0b55bc4788ad7f7df9d3bd2f1f290.zip
ALSA: usb-audio: Don't create jack controls for PCM terminals
commit 7dc3c5a0172e6c0449502103356c3628d05bc0e0 upstream. Some funky firmwares set the connector flag even on PCM terminals although it doesn't make sense (and even actually the firmware doesn't react properly!). Let's skip creation of jack controls in such a case. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206873 Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20200412081331.4742-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--sound/usb/mixer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 2e808218eb2b..2575056e408d 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -2088,7 +2088,8 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
check_input_term(state, term_id, &iterm);
/* Check for jack detection. */
- if (uac_v2v3_control_is_readable(bmctls, control))
+ if ((iterm.type & 0xff00) != 0x0100 &&
+ uac_v2v3_control_is_readable(bmctls, control))
build_connector_control(state->mixer, &iterm, true);
return 0;
@@ -3128,7 +3129,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
if (err < 0 && err != -EINVAL)
return err;
- if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
+ if ((state.oterm.type & 0xff00) != 0x0100 &&
+ uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
UAC2_TE_CONNECTOR)) {
build_connector_control(state.mixer, &state.oterm,
false);
@@ -3153,7 +3155,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
if (err < 0 && err != -EINVAL)
return err;
- if (uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
+ if ((state.oterm.type & 0xff00) != 0x0100 &&
+ uac_v2v3_control_is_readable(le32_to_cpu(desc->bmControls),
UAC3_TE_INSERTION)) {
build_connector_control(state.mixer, &state.oterm,
false);