mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
ALSA: usb-audio: fix uac control query argument
This patch fixes code readability and should have no functional change. Correct uac control query functions to account for the 1-based indexing of USB Audio Class control identifiers. The function parameter, u8 control, should be the constant defined in audio-v2.h to identify the control to be checked for readability or writeability. This patch fixes all callers that had adjusted, and makes explicit the mapping between audio_feature_info[] array index and the associated control identifier. Signed-off-by: Andrew Chant <achant@google.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
9a2fe9b801
commit
21e9b3e931
3 changed files with 48 additions and 30 deletions
|
@ -36,12 +36,12 @@
|
|||
|
||||
static inline bool uac_v2v3_control_is_readable(u32 bmControls, u8 control)
|
||||
{
|
||||
return (bmControls >> (control * 2)) & 0x1;
|
||||
return (bmControls >> ((control - 1) * 2)) & 0x1;
|
||||
}
|
||||
|
||||
static inline bool uac_v2v3_control_is_writeable(u32 bmControls, u8 control)
|
||||
{
|
||||
return (bmControls >> (control * 2)) & 0x2;
|
||||
return (bmControls >> ((control - 1) * 2)) & 0x2;
|
||||
}
|
||||
|
||||
/* 4.7.2 Class-Specific AC Interface Descriptor */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue