summaryrefslogtreecommitdiff
path: root/sound/usb/mixer.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2021-06-23 02:30:49 +0930
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:52:59 +0200
commit1908d78a87cf40b35a4d9d342105cd6ba403040c (patch)
treecc493a592b69eae34f24479bb9b1b3dc3232b9c5 /sound/usb/mixer.h
parent49e5b37fdd0188052c9d9691eabda076ac3e60e3 (diff)
ALSA: usb-audio: scarlett2: Fix wrong resume call
commit 785b6f29a795f109685f286b91e0250c206fbffb upstream. The current way of the scarlett2 mixer code managing the usb_mixer_elem_info object is wrong in two ways: it passes its internal index to the head.id field, and the val_type field is uninitialized. This ended up with the wrong execution at the resume because a bogus unit id is passed wrongly. Also, in the later code extensions, we'll have more mixer elements, and passing the index will overflow the unit id size (of 256). This patch corrects those issues. It introduces a new value type, USB_MIXER_BESPOKEN, which indicates a non-standard mixer element, and use this type for all scarlett2 mixer elements, as well as initializing the fixed unit id 0 for avoiding the overflow. Tested-by: Geoffrey D. Bennett <g@b4.vu> Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/49721219f45b7e175e729b0d9d9c142fd8f4342a.1624379707.git.g@b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'sound/usb/mixer.h')
-rw-r--r--sound/usb/mixer.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/usb/mixer.h b/sound/usb/mixer.h
index 01b5e5cc2221..0e813cd85bee 100644
--- a/sound/usb/mixer.h
+++ b/sound/usb/mixer.h
@@ -55,6 +55,7 @@ enum {
USB_MIXER_U16,
USB_MIXER_S32,
USB_MIXER_U32,
+ USB_MIXER_BESPOKEN, /* non-standard type */
};
typedef void (*usb_mixer_elem_dump_func_t)(struct snd_info_buffer *buffer,