aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-02-22 17:49:10 -0500
committerTakashi Iwai <tiwai@suse.de>2010-02-23 02:40:20 -0500
commit8fee4aff8c89c229593b76a6ab172a9cad24b412 (patch)
treefa04320ed558000ee0e131808e14698ddd4fe3ce /include/linux/usb
parent28e1b773083d349d5223f586a39fa30f5d0f1c36 (diff)
ALSA: usbaudio: introduce new types for audio class v2
This patch adds some definitions for audio class v2. Unfortunately, the UNIT types PROCESSING_UNIT and EXTENSION_UNIT have different numerical representations in both standards, so there is need for a _V1 add-on now. usbmixer.c is changed accordingly. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/audio.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 44f82d8e09c5..fb1a97bf943d 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -25,6 +25,9 @@
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 25#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 26#define USB_SUBCLASS_MIDISTREAMING 0x03
27 27
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
28/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
29#define UAC_HEADER 0x01 32#define UAC_HEADER 0x01
30#define UAC_INPUT_TERMINAL 0x02 33#define UAC_INPUT_TERMINAL 0x02
@@ -180,6 +183,19 @@ struct uac_as_header_descriptor_v1 {
180 __le16 wFormatTag; /* The Audio Data Format */ 183 __le16 wFormatTag; /* The Audio Data Format */
181} __attribute__ ((packed)); 184} __attribute__ ((packed));
182 185
186struct uac_as_header_descriptor_v2 {
187 __u8 bLength;
188 __u8 bDescriptorType;
189 __u8 bDescriptorSubtype;
190 __u8 bTerminalLink;
191 __u8 bmControls;
192 __u8 bFormatType;
193 __u32 bmFormats;
194 __u8 bNrChannels;
195 __u32 bmChannelConfig;
196 __u8 iChannelNames;
197} __attribute__((packed));
198
183#define UAC_DT_AS_HEADER_SIZE 7 199#define UAC_DT_AS_HEADER_SIZE 7
184 200
185/* Formats - A.1.1 Audio Data Format Type I Codes */ 201/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -232,6 +248,19 @@ struct uac_format_type_i_discrete_descriptor_##n { \
232 248
233#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) 249#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
234 250
251struct uac_format_type_i_ext_descriptor {
252 __u8 bLength;
253 __u8 bDescriptorType;
254 __u8 bDescriptorSubtype;
255 __u8 bSubslotSize;
256 __u8 bFormatType;
257 __u8 bBitResolution;
258 __u8 bHeaderLength;
259 __u8 bControlSize;
260 __u8 bSideBandProtocol;
261} __attribute__((packed));
262
263
235/* Formats - Audio Data Format Type I Codes */ 264/* Formats - Audio Data Format Type I Codes */
236 265
237struct uac_format_type_ii_discrete_descriptor { 266struct uac_format_type_ii_discrete_descriptor {
@@ -245,11 +274,26 @@ struct uac_format_type_ii_discrete_descriptor {
245 __u8 tSamFreq[][3]; 274 __u8 tSamFreq[][3];
246} __attribute__((packed)); 275} __attribute__((packed));
247 276
277struct uac_format_type_ii_ext_descriptor {
278 __u8 bLength;
279 __u8 bDescriptorType;
280 __u8 bDescriptorSubtype;
281 __u8 bFormatType;
282 __u16 wMaxBitRate;
283 __u16 wSamplesPerFrame;
284 __u8 bHeaderLength;
285 __u8 bSideBandProtocol;
286} __attribute__((packed));
287
288
248/* Formats - A.2 Format Type Codes */ 289/* Formats - A.2 Format Type Codes */
249#define UAC_FORMAT_TYPE_UNDEFINED 0x0 290#define UAC_FORMAT_TYPE_UNDEFINED 0x0
250#define UAC_FORMAT_TYPE_I 0x1 291#define UAC_FORMAT_TYPE_I 0x1
251#define UAC_FORMAT_TYPE_II 0x2 292#define UAC_FORMAT_TYPE_II 0x2
252#define UAC_FORMAT_TYPE_III 0x3 293#define UAC_FORMAT_TYPE_III 0x3
294#define UAC_EXT_FORMAT_TYPE_I 0x81
295#define UAC_EXT_FORMAT_TYPE_II 0x82
296#define UAC_EXT_FORMAT_TYPE_III 0x83
253 297
254struct uac_iso_endpoint_descriptor { 298struct uac_iso_endpoint_descriptor {
255 __u8 bLength; /* in bytes: 7 */ 299 __u8 bLength; /* in bytes: 7 */
@@ -265,6 +309,19 @@ struct uac_iso_endpoint_descriptor {
265#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 309#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
266#define UAC_EP_CS_ATTR_FILL_MAX 0x80 310#define UAC_EP_CS_ATTR_FILL_MAX 0x80
267 311
312/* Audio class v2.0: CLOCK_SOURCE descriptor */
313
314struct uac_clock_source_descriptor {
315 __u8 bLength;
316 __u8 bDescriptorType;
317 __u8 bDescriptorSubtype;
318 __u8 bClockID;
319 __u8 bmAttributes;
320 __u8 bmControls;
321 __u8 bAssocTerminal;
322 __u8 iClockSource;
323} __attribute__((packed));
324
268/* A.10.2 Feature Unit Control Selectors */ 325/* A.10.2 Feature Unit Control Selectors */
269 326
270struct uac_feature_unit_descriptor { 327struct uac_feature_unit_descriptor {