summaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-04-23 15:19:25 +0200
committerTakashi Iwai <tiwai@suse.de>2018-04-24 13:36:28 +0200
commit2b54f785b4d4894ab7ab3bf5e461e0819d221c1c (patch)
tree0e5a0425bea9f41d405ef214689c10b9a40c4370 /sound/usb/mixer.c
parent2de841efaeafa9f597e495ffdf5a024079c4bfe7 (diff)
downloadlinux-2b54f785b4d4894ab7ab3bf5e461e0819d221c1c.tar.gz
linux-2b54f785b4d4894ab7ab3bf5e461e0819d221c1c.tar.bz2
linux-2b54f785b4d4894ab7ab3bf5e461e0819d221c1c.zip
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: 5a222e849452 ("ALSA: usb-audio: UAC2 jack detection") Tested-by: Andrew Chant <achant@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 3387483310b1..344d7b069d59 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1860,7 +1860,7 @@ static int parse_audio_input_terminal(struct mixer_build *state, int unitid,
check_input_term(state, d->bTerminalID, &iterm);
if (state->mixer->protocol == UAC_VERSION_2) {
/* 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)) {
build_connector_control(state, &iterm, true);
}
@@ -2562,7 +2562,7 @@ static int snd_usb_mixer_controls(struct usb_mixer_interface *mixer)
if (err < 0 && err != -EINVAL)
return err;
- if (uac_v2v3_control_is_readable(desc->bmControls,
+ if (uac_v2v3_control_is_readable(le16_to_cpu(desc->bmControls),
UAC2_TE_CONNECTOR)) {
build_connector_control(&state, &state.oterm,
false);