Commit 2b54f785 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: usb-audio: Fix missing endian conversion

The UAC2 jack detection support introduced the bmControls checks in a
couple of places, but they forgot the endian conversion; the
bmControls of UAC2 terminal descriptor is __le16, not a byte like in
UAC1.

Fixes: 5a222e84 ("ALSA: usb-audio: UAC2 jack detection")
Tested-by: default avatarAndrew Chant <achant@google.com>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 2de841ef
...@@ -1860,7 +1860,7 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid, ...@@ -1860,7 +1860,7 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
check_input_term(state, d->bTerminalID, &iterm); check_input_term(state, d->bTerminalID, &iterm);
if (state->mixer->protocol == UAC_VERSION_2) { if (state->mixer->protocol == UAC_VERSION_2) {
/* Check for jack detection. */ /* Check for jack detection. */
if (uac_v2v3_control_is_readable(d->bmControls, if (uac_v2v3_control_is_readable(le16_to_cpu(d->bmControls),
UAC2_TE_CONNECTOR)) { UAC2_TE_CONNECTOR)) {
build_connector_control(state, &iterm, true); build_connector_control(state, &iterm, true);
} }
...@@ -2562,7 +2562,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer) ...@@ -2562,7 +2562,7 @@ 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(desc->bmControls, if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
UAC2_TE_CONNECTOR)) { UAC2_TE_CONNECTOR)) {
build_connector_control(&state, &state.oterm, build_connector_control(&state, &state.oterm,
false); false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment