ALSA: usb-audio: UAC2: clean up parsing of bmaControls

Introduce two new static inline functions for a more readable parsing
of UAC2 bmaControls.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Daniel Mack
2010-05-31 13:35:36 +02:00
committed by Takashi Iwai
parent 67a3e12b05
commit dcbe7bcfa3
2 changed files with 14 additions and 4 deletions

View File

@@ -18,6 +18,16 @@
/* v1.0 and v2.0 of this standard have many things in common. For the rest
* of the definitions, please refer to audio.h */
static inline bool uac2_control_is_readable(u32 bmControls, u8 control)
{
return (bmControls >> (control * 2)) & 0x1;
}
static inline bool uac2_control_is_writeable(u32 bmControls, u8 control)
{
return (bmControls >> (control * 2)) & 0x2;
}
/* 4.7.2.1 Clock Source Descriptor */
struct uac_clock_source_descriptor {