@@ -18,7 +18,7 @@ static const uint8_t reference_ac_interface_descriptor[] = {
18
18
0x01 , /* bDescriptorSubtype = HEADER */
19
19
0x00 , 0x02 , /* bcdADC = 02.00 */
20
20
0x04 , /* bCategory = HEADSET */
21
- 0x4b , 0x00 , /* wTotalLength = 0x4b = 75 */
21
+ 0x6b , 0x00 , /* wTotalLength = 0x6b = 107 */
22
22
0x00 , /* bmControls = Latency Control not present */
23
23
};
24
24
@@ -50,15 +50,28 @@ static const uint8_t reference_ac_hp_input_terminal_descriptor[] = {
50
50
0x00 , /* iTerminal = 0 (no string descriptor) */
51
51
};
52
52
53
+ static const uint8_t reference_ac_hp_feature_unit_descriptor [] = {
54
+ /* 4.7.2.8 Feature Unit Descriptor */
55
+ 0x12 , /* bLength = 18 */
56
+ 0x24 , /* bDescriptorType = CS_INTERFACE */
57
+ 0x06 , /* bDescriptorSubtype = FEATURE_UNIT */
58
+ 0x03 , /* bUnitID = 3 */
59
+ 0x02 , /* bSourceID = 2 (streaming input) */
60
+ 0x03 , 0x30 , 0x00 , 0x00 , /* bmaControls(0): Mute and Auto Gain */
61
+ 0x00 , 0x30 , 0x00 , 0x00 , /* bmaControls(1): Auto Gain */
62
+ 0x00 , 0x30 , 0x00 , 0x00 , /* bmaControls(2): Auto Gain */
63
+ 0x00 , /* iFeature = 0 (no string descriptor)*/
64
+ };
65
+
53
66
static const uint8_t reference_ac_hp_output_terminal_descriptor [] = {
54
67
/* 4.7.2.5 Output Terminal Descriptor */
55
68
0x0c , /* bLength = 12 */
56
69
0x24 , /* bDescriptorType = CS_INTERFACE */
57
70
0x03 , /* bDescriptorSubtype = OUTPUT_TERMINAL */
58
- 0x03 , /* bTerminalID = 3 */
71
+ 0x04 , /* bTerminalID = 4 */
59
72
0x02 , 0x04 , /* wTerminalType = 0x0402 (Headset) */
60
- 0x04 , /* bAssocTerminal = 4 (headset input) */
61
- 0x02 , /* bSourceID = 2 (streaming input ) */
73
+ 0x05 , /* bAssocTerminal = 5 (headset input) */
74
+ 0x03 , /* bSourceID = 3 (headphones feature unit ) */
62
75
0x01 , /* bCSourceID = 1 (main clock) */
63
76
0x00 , 0x00 , /* bmControls = none present */
64
77
0x00 , /* iTerminal = 0 (no string descriptor) */
@@ -69,9 +82,9 @@ static const uint8_t reference_ac_mic_input_terminal_descriptor[] = {
69
82
0x11 , /* bLength = 17 */
70
83
0x24 , /* bDescriptorType = CS_INTERFACE */
71
84
0x02 , /* bDescriptorSubtype = INPUT_TERMINAL */
72
- 0x04 , /* bTerminalID = 4 */
85
+ 0x05 , /* bTerminalID = 5 */
73
86
0x02 , 0x04 , /* wTerminalType = 0x0402 (Headset) */
74
- 0x03 , /* bAssocTerminal = 3 (headset output) */
87
+ 0x04 , /* bAssocTerminal = 4 (headset output) */
75
88
0x01 , /* bCSourceID = 1 (main clock) */
76
89
0x01 , /* bNrChannels = 1 */
77
90
0x01 , 0x00 , 0x00 , 0x00 , /* bmChannelConfig = Front Left */
@@ -80,15 +93,27 @@ static const uint8_t reference_ac_mic_input_terminal_descriptor[] = {
80
93
0x00 , /* iTerminal = 0 (no string descriptor) */
81
94
};
82
95
96
+ static const uint8_t reference_ac_mic_feature_unit_descriptor [] = {
97
+ /* 4.7.2.8 Feature Unit Descriptor */
98
+ 0x0e , /* bLength = 14 */
99
+ 0x24 , /* bDescriptorType = CS_INTERFACE */
100
+ 0x06 , /* bDescriptorSubtype = FEATURE_UNIT */
101
+ 0x06 , /* bUnitID = 6 */
102
+ 0x05 , /* bSourceID = 5 (headset input) */
103
+ 0x03 , 0x00 , 0x00 , 0x00 , /* bmaControls(0): Mute */
104
+ 0x00 , 0x30 , 0x00 , 0x00 , /* bmaControls(1): Auto Gain */
105
+ 0x00 , /* iFeature = 0 (no string descriptor)*/
106
+ };
107
+
83
108
static const uint8_t reference_ac_mic_output_terminal_descriptor [] = {
84
109
/* 4.7.2.5 Output Terminal Descriptor */
85
110
0x0c , /* bLength = 12 */
86
111
0x24 , /* bDescriptorType = CS_INTERFACE */
87
112
0x03 , /* bDescriptorSubtype = OUTPUT_TERMINAL */
88
- 0x05 , /* bTerminalID = 5 */
113
+ 0x07 , /* bTerminalID = 7 */
89
114
0x01 , 0x01 , /* wTerminalType = 0x0101 (USB streaming) */
90
115
0x00 , /* bAssocTerminal = 0 (not associated) */
91
- 0x04 , /* bSourceID = 4 (headset input ) */
116
+ 0x06 , /* bSourceID = 6 (mic feature unit ) */
92
117
0x01 , /* bCSourceID = 1 (main clock) */
93
118
0x00 , 0x00 , /* bmControls = none present */
94
119
0x00 , /* iTerminal = 0 (no string descriptor) */
@@ -100,7 +125,7 @@ static const uint8_t reference_as_in_cs_general_descriptor[] = {
100
125
0x10 , /* bLength = 16 */
101
126
0x24 , /* bDescriptorType = CS_INTERFACE */
102
127
0x01 , /* bDescriptorSubtype = AS_GENERAL */
103
- 0x05 , /* bTerminalLink = 5 (USB streaming output) */
128
+ 0x07 , /* bTerminalLink = 7 (USB streaming output) */
104
129
0x00 , /* bmControls = non present */
105
130
0x01 , /* bFormatType = 1 */
106
131
0x01 , 0x00 , 0x00 , 0x00 , /* bmFormats = PCM */
@@ -308,12 +333,18 @@ static void test_uac2_descriptors(const struct usb_desc_header **descriptors,
308
333
zassert_mem_equal (reference_ac_hp_input_terminal_descriptor , * ptr ,
309
334
ARRAY_SIZE (reference_ac_hp_input_terminal_descriptor ));
310
335
ptr ++ ;
336
+ zassert_mem_equal (reference_ac_hp_feature_unit_descriptor , * ptr ,
337
+ ARRAY_SIZE (reference_ac_hp_feature_unit_descriptor ));
338
+ ptr ++ ;
311
339
zassert_mem_equal (reference_ac_hp_output_terminal_descriptor , * ptr ,
312
340
ARRAY_SIZE (reference_ac_hp_output_terminal_descriptor ));
313
341
ptr ++ ;
314
342
zassert_mem_equal (reference_ac_mic_input_terminal_descriptor , * ptr ,
315
343
ARRAY_SIZE (reference_ac_mic_input_terminal_descriptor ));
316
344
ptr ++ ;
345
+ zassert_mem_equal (reference_ac_mic_feature_unit_descriptor , * ptr ,
346
+ ARRAY_SIZE (reference_ac_mic_feature_unit_descriptor ));
347
+ ptr ++ ;
317
348
zassert_mem_equal (reference_ac_mic_output_terminal_descriptor , * ptr ,
318
349
ARRAY_SIZE (reference_ac_mic_output_terminal_descriptor ));
319
350
ptr ++ ;
0 commit comments