aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/audio.h
diff options
context:
space:
mode:
authorDaniel Mack <daniel@caiaq.de>2010-03-11 15:13:20 -0500
committerTakashi Iwai <tiwai@suse.de>2010-03-12 06:19:49 -0500
commit7e847894039d7590321de306fca2b1ae58662f29 (patch)
tree09ff9fc43280cf3263a0501fec6b6feee50e8939 /include/linux/usb/audio.h
parent36e632d61ae2febf55d5cd93b9e5ae0f5a5c6207 (diff)
linux/usb/audio.h: split header
- Split the audio.h file in two to clearly denote the differences between the standards. - Add many more defines to audio-v2.h. Most of them are not currently used. - Replaced a magic value with a proper define Signed-off-by: Daniel Mack <daniel@caiaq.de> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/linux/usb/audio.h')
-rw-r--r--include/linux/usb/audio.h50
1 files changed, 7 insertions, 43 deletions
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 4d3e450e2b03..cdad728543ae 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -13,6 +13,9 @@
13 * Comments below reference relevant sections of that document: 13 * Comments below reference relevant sections of that document:
14 * 14 *
15 * http://www.usb.org/developers/devclass_docs/audio10.pdf 15 * http://www.usb.org/developers/devclass_docs/audio10.pdf
16 *
17 * Types and defines in this file are either specific to version 1.0 of
18 * this standard or common for newer versions.
16 */ 19 */
17 20
18#ifndef __LINUX_USB_AUDIO_H 21#ifndef __LINUX_USB_AUDIO_H
@@ -20,14 +23,15 @@
20 23
21#include <linux/types.h> 24#include <linux/types.h>
22 25
26/* bInterfaceProtocol values to denote the version of the standard used */
27#define UAC_VERSION_1 0x00
28#define UAC_VERSION_2 0x20
29
23/* A.2 Audio Interface Subclass Codes */ 30/* A.2 Audio Interface Subclass Codes */
24#define USB_SUBCLASS_AUDIOCONTROL 0x01 31#define USB_SUBCLASS_AUDIOCONTROL 0x01
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 32#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 33#define USB_SUBCLASS_MIDISTREAMING 0x03
27 34
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 35/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
32#define UAC_HEADER 0x01 36#define UAC_HEADER 0x01
33#define UAC_INPUT_TERMINAL 0x02 37#define UAC_INPUT_TERMINAL 0x02
@@ -38,15 +42,6 @@
38#define UAC_PROCESSING_UNIT_V1 0x07 42#define UAC_PROCESSING_UNIT_V1 0x07
39#define UAC_EXTENSION_UNIT_V1 0x08 43#define UAC_EXTENSION_UNIT_V1 0x08
40 44
41/* UAC v2.0 types */
42#define UAC_EFFECT_UNIT 0x07
43#define UAC_PROCESSING_UNIT_V2 0x08
44#define UAC_EXTENSION_UNIT_V2 0x09
45#define UAC_CLOCK_SOURCE 0x0a
46#define UAC_CLOCK_SELECTOR 0x0b
47#define UAC_CLOCK_MULTIPLIER 0x0c
48#define UAC_SAMPLE_RATE_CONVERTER 0x0d
49
50/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 45/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
51#define UAC_AS_GENERAL 0x01 46#define UAC_AS_GENERAL 0x01
52#define UAC_FORMAT_TYPE 0x02 47#define UAC_FORMAT_TYPE 0x02
@@ -78,10 +73,6 @@
78 73
79#define UAC_GET_STAT 0xff 74#define UAC_GET_STAT 0xff
80 75
81/* Audio class v2.0 handles all the parameter calls differently */
82#define UAC2_CS_CUR 0x01
83#define UAC2_CS_RANGE 0x02
84
85/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 76/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
86#define UAC_MS_HEADER 0x01 77#define UAC_MS_HEADER 0x01
87#define UAC_MIDI_IN_JACK 0x02 78#define UAC_MIDI_IN_JACK 0x02
@@ -200,19 +191,6 @@ struct uac_as_header_descriptor_v1 {
200 __le16 wFormatTag; /* The Audio Data Format */ 191 __le16 wFormatTag; /* The Audio Data Format */
201} __attribute__ ((packed)); 192} __attribute__ ((packed));
202 193
203struct uac_as_header_descriptor_v2 {
204 __u8 bLength;
205 __u8 bDescriptorType;
206 __u8 bDescriptorSubtype;
207 __u8 bTerminalLink;
208 __u8 bmControls;
209 __u8 bFormatType;
210 __u32 bmFormats;
211 __u8 bNrChannels;
212 __u32 bmChannelConfig;
213 __u8 iChannelNames;
214} __attribute__((packed));
215
216#define UAC_DT_AS_HEADER_SIZE 7 194#define UAC_DT_AS_HEADER_SIZE 7
217 195
218/* Formats - A.1.1 Audio Data Format Type I Codes */ 196/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -277,7 +255,6 @@ struct uac_format_type_i_ext_descriptor {
277 __u8 bSideBandProtocol; 255 __u8 bSideBandProtocol;
278} __attribute__((packed)); 256} __attribute__((packed));
279 257
280
281/* Formats - Audio Data Format Type I Codes */ 258/* Formats - Audio Data Format Type I Codes */
282 259
283#define UAC_FORMAT_TYPE_II_MPEG 0x1001 260#define UAC_FORMAT_TYPE_II_MPEG 0x1001
@@ -336,19 +313,6 @@ struct uac_iso_endpoint_descriptor {
336#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 313#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
337#define UAC_EP_CS_ATTR_FILL_MAX 0x80 314#define UAC_EP_CS_ATTR_FILL_MAX 0x80
338 315
339/* Audio class v2.0: CLOCK_SOURCE descriptor */
340
341struct uac_clock_source_descriptor {
342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubtype;
345 __u8 bClockID;
346 __u8 bmAttributes;
347 __u8 bmControls;
348 __u8 bAssocTerminal;
349 __u8 iClockSource;
350} __attribute__((packed));
351
352/* A.10.2 Feature Unit Control Selectors */ 316/* A.10.2 Feature Unit Control Selectors */
353 317
354struct uac_feature_unit_descriptor { 318struct uac_feature_unit_descriptor {