aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/audio-v2.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/audio-v2.h')
-rw-r--r--include/linux/usb/audio-v2.h31
1 files changed, 30 insertions, 1 deletions
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
index 92f1d99f0f17..383b94ba8c20 100644
--- a/include/linux/usb/audio-v2.h
+++ b/include/linux/usb/audio-v2.h
@@ -18,6 +18,16 @@
18/* v1.0 and v2.0 of this standard have many things in common. For the rest 18/* v1.0 and v2.0 of this standard have many things in common. For the rest
19 * of the definitions, please refer to audio.h */ 19 * of the definitions, please refer to audio.h */
20 20
21static inline bool uac2_control_is_readable(u32 bmControls, u8 control)
22{
23 return (bmControls >> (control * 2)) & 0x1;
24}
25
26static inline bool uac2_control_is_writeable(u32 bmControls, u8 control)
27{
28 return (bmControls >> (control * 2)) & 0x2;
29}
30
21/* 4.7.2.1 Clock Source Descriptor */ 31/* 4.7.2.1 Clock Source Descriptor */
22 32
23struct uac_clock_source_descriptor { 33struct uac_clock_source_descriptor {
@@ -31,6 +41,13 @@ struct uac_clock_source_descriptor {
31 __u8 iClockSource; 41 __u8 iClockSource;
32} __attribute__((packed)); 42} __attribute__((packed));
33 43
44/* bmAttribute fields */
45#define UAC_CLOCK_SOURCE_TYPE_EXT 0x0
46#define UAC_CLOCK_SOURCE_TYPE_INT_FIXED 0x1
47#define UAC_CLOCK_SOURCE_TYPE_INT_VAR 0x2
48#define UAC_CLOCK_SOURCE_TYPE_INT_PROG 0x3
49#define UAC_CLOCK_SOURCE_SYNCED_TO_SOF (1 << 2)
50
34/* 4.7.2.2 Clock Source Descriptor */ 51/* 4.7.2.2 Clock Source Descriptor */
35 52
36struct uac_clock_selector_descriptor { 53struct uac_clock_selector_descriptor {
@@ -39,8 +56,20 @@ struct uac_clock_selector_descriptor {
39 __u8 bDescriptorSubtype; 56 __u8 bDescriptorSubtype;
40 __u8 bClockID; 57 __u8 bClockID;
41 __u8 bNrInPins; 58 __u8 bNrInPins;
42 __u8 bmControls;
43 __u8 baCSourceID[]; 59 __u8 baCSourceID[];
60 /* bmControls, bAssocTerminal and iClockSource omitted */
61} __attribute__((packed));
62
63/* 4.7.2.3 Clock Multiplier Descriptor */
64
65struct uac_clock_multiplier_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType;
68 __u8 bDescriptorSubtype;
69 __u8 bClockID;
70 __u8 bCSourceID;
71 __u8 bmControls;
72 __u8 iClockMultiplier;
44} __attribute__((packed)); 73} __attribute__((packed));
45 74
46/* 4.7.2.4 Input terminal descriptor */ 75/* 4.7.2.4 Input terminal descriptor */