提交 bf511d28 编写于 作者: T Takashi Iwai 提交者: Yang Yingliang

ALSA: usb-audio: Don't create jack controls for PCM terminals

commit 7dc3c5a0 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.deSigned-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 1a6ea68a
...@@ -2107,7 +2107,8 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid, ...@@ -2107,7 +2107,8 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
check_input_term(state, term_id, &iterm); check_input_term(state, term_id, &iterm);
/* Check for jack detection. */ /* 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); build_connector_control(state->mixer, &iterm, true);
return 0; return 0;
...@@ -3147,7 +3148,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) ...@@ -3147,7 +3148,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
if (err < 0 && err != -EINVAL) if (err < 0 && err != -EINVAL)
return err; 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)) { UAC2_TE_CONNECTOR)) {
build_connector_control(state.mixer, &state.oterm, build_connector_control(state.mixer, &state.oterm,
false); false);
...@@ -3172,7 +3174,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) ...@@ -3172,7 +3174,8 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
if (err < 0 && err != -EINVAL) if (err < 0 && err != -EINVAL)
return err; 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)) { UAC3_TE_INSERTION)) {
build_connector_control(state.mixer, &state.oterm, build_connector_control(state.mixer, &state.oterm,
false); false);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册