blob: 87b8bd5fa9db238c76082add4852ed6b082048a8 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_USB_AUDIO_H
20#define _UAPI__LINUX_USB_AUDIO_H
21#include <linux/types.h>
22#define UAC_VERSION_1 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define UAC_VERSION_2 0x20
Christopher Ferris76a1d452018-06-27 14:12:29 -070024#define UAC_VERSION_3 0x30
Ben Cheng655a7c02013-10-16 16:09:24 -070025#define USB_SUBCLASS_AUDIOCONTROL 0x01
26#define USB_SUBCLASS_AUDIOSTREAMING 0x02
27#define USB_SUBCLASS_MIDISTREAMING 0x03
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define UAC_HEADER 0x01
29#define UAC_INPUT_TERMINAL 0x02
30#define UAC_OUTPUT_TERMINAL 0x03
31#define UAC_MIXER_UNIT 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define UAC_SELECTOR_UNIT 0x05
33#define UAC_FEATURE_UNIT 0x06
34#define UAC1_PROCESSING_UNIT 0x07
35#define UAC1_EXTENSION_UNIT 0x08
Ben Cheng655a7c02013-10-16 16:09:24 -070036#define UAC_AS_GENERAL 0x01
37#define UAC_FORMAT_TYPE 0x02
38#define UAC_FORMAT_SPECIFIC 0x03
39#define UAC_PROCESS_UNDEFINED 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -070040#define UAC_PROCESS_UP_DOWNMIX 0x01
41#define UAC_PROCESS_DOLBY_PROLOGIC 0x02
42#define UAC_PROCESS_STEREO_EXTENDER 0x03
43#define UAC_PROCESS_REVERB 0x04
Ben Cheng655a7c02013-10-16 16:09:24 -070044#define UAC_PROCESS_CHORUS 0x05
45#define UAC_PROCESS_DYN_RANGE_COMP 0x06
46#define UAC_EP_GENERAL 0x01
47#define UAC_SET_ 0x00
Ben Cheng655a7c02013-10-16 16:09:24 -070048#define UAC_GET_ 0x80
49#define UAC__CUR 0x1
50#define UAC__MIN 0x2
51#define UAC__MAX 0x3
Ben Cheng655a7c02013-10-16 16:09:24 -070052#define UAC__RES 0x4
53#define UAC__MEM 0x5
54#define UAC_SET_CUR (UAC_SET_ | UAC__CUR)
55#define UAC_GET_CUR (UAC_GET_ | UAC__CUR)
Ben Cheng655a7c02013-10-16 16:09:24 -070056#define UAC_SET_MIN (UAC_SET_ | UAC__MIN)
57#define UAC_GET_MIN (UAC_GET_ | UAC__MIN)
58#define UAC_SET_MAX (UAC_SET_ | UAC__MAX)
59#define UAC_GET_MAX (UAC_GET_ | UAC__MAX)
Ben Cheng655a7c02013-10-16 16:09:24 -070060#define UAC_SET_RES (UAC_SET_ | UAC__RES)
61#define UAC_GET_RES (UAC_GET_ | UAC__RES)
62#define UAC_SET_MEM (UAC_SET_ | UAC__MEM)
63#define UAC_GET_MEM (UAC_GET_ | UAC__MEM)
Ben Cheng655a7c02013-10-16 16:09:24 -070064#define UAC_GET_STAT 0xff
65#define UAC_TERM_COPY_PROTECT 0x01
66#define UAC_FU_MUTE 0x01
67#define UAC_FU_VOLUME 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -070068#define UAC_FU_BASS 0x03
69#define UAC_FU_MID 0x04
70#define UAC_FU_TREBLE 0x05
71#define UAC_FU_GRAPHIC_EQUALIZER 0x06
Ben Cheng655a7c02013-10-16 16:09:24 -070072#define UAC_FU_AUTOMATIC_GAIN 0x07
73#define UAC_FU_DELAY 0x08
74#define UAC_FU_BASS_BOOST 0x09
75#define UAC_FU_LOUDNESS 0x0a
Ben Cheng655a7c02013-10-16 16:09:24 -070076#define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1))
77#define UAC_UD_ENABLE 0x01
78#define UAC_UD_MODE_SELECT 0x02
79#define UAC_DP_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070080#define UAC_DP_MODE_SELECT 0x02
81#define UAC_3D_ENABLE 0x01
82#define UAC_3D_SPACE 0x02
83#define UAC_REVERB_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070084#define UAC_REVERB_LEVEL 0x02
85#define UAC_REVERB_TIME 0x03
86#define UAC_REVERB_FEEDBACK 0x04
87#define UAC_CHORUS_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070088#define UAC_CHORUS_LEVEL 0x02
89#define UAC_CHORUS_RATE 0x03
90#define UAC_CHORUS_DEPTH 0x04
91#define UAC_DCR_ENABLE 0x01
Ben Cheng655a7c02013-10-16 16:09:24 -070092#define UAC_DCR_RATE 0x02
93#define UAC_DCR_MAXAMPL 0x03
94#define UAC_DCR_THRESHOLD 0x04
95#define UAC_DCR_ATTACK_TIME 0x05
Ben Cheng655a7c02013-10-16 16:09:24 -070096#define UAC_DCR_RELEASE_TIME 0x06
97#define UAC_XU_ENABLE 0x01
98#define UAC_MS_HEADER 0x01
99#define UAC_MIDI_IN_JACK 0x02
Ben Cheng655a7c02013-10-16 16:09:24 -0700100#define UAC_MIDI_OUT_JACK 0x03
101#define UAC_MS_GENERAL 0x01
102#define UAC_TERMINAL_UNDEFINED 0x100
103#define UAC_TERMINAL_STREAMING 0x101
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#define UAC_TERMINAL_VENDOR_SPEC 0x1FF
105struct uac1_ac_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800106 __u8 bLength;
107 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800108 __u8 bDescriptorSubtype;
109 __le16 bcdADC;
110 __le16 wTotalLength;
111 __u8 bInCollection;
Tao Baod7db5942015-01-28 10:07:51 -0800112 __u8 baInterfaceNr[];
113} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700114#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n))
Tao Baod7db5942015-01-28 10:07:51 -0800115#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) struct uac1_ac_header_descriptor_ ##n { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __le16 bcdADC; __le16 wTotalLength; __u8 bInCollection; __u8 baInterfaceNr[n]; \
116} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700117struct uac_input_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800118 __u8 bLength;
119 __u8 bDescriptorType;
120 __u8 bDescriptorSubtype;
Tao Baod7db5942015-01-28 10:07:51 -0800121 __u8 bTerminalID;
122 __le16 wTerminalType;
123 __u8 bAssocTerminal;
124 __u8 bNrChannels;
Tao Baod7db5942015-01-28 10:07:51 -0800125 __le16 wChannelConfig;
126 __u8 iChannelNames;
127 __u8 iTerminal;
128} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700129#define UAC_DT_INPUT_TERMINAL_SIZE 12
130#define UAC_INPUT_TERMINAL_UNDEFINED 0x200
131#define UAC_INPUT_TERMINAL_MICROPHONE 0x201
132#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202
Ben Cheng655a7c02013-10-16 16:09:24 -0700133#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203
134#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204
135#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
136#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206
Ben Cheng655a7c02013-10-16 16:09:24 -0700137#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01
138struct uac1_output_terminal_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800139 __u8 bLength;
140 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800141 __u8 bDescriptorSubtype;
142 __u8 bTerminalID;
143 __le16 wTerminalType;
144 __u8 bAssocTerminal;
Tao Baod7db5942015-01-28 10:07:51 -0800145 __u8 bSourceID;
146 __u8 iTerminal;
147} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700148#define UAC_DT_OUTPUT_TERMINAL_SIZE 9
Ben Cheng655a7c02013-10-16 16:09:24 -0700149#define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300
150#define UAC_OUTPUT_TERMINAL_SPEAKER 0x301
151#define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302
152#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303
Ben Cheng655a7c02013-10-16 16:09:24 -0700153#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304
154#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305
155#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306
156#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307
Ben Cheng655a7c02013-10-16 16:09:24 -0700157#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2)
Tao Baod7db5942015-01-28 10:07:51 -0800158#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) struct uac_feature_unit_descriptor_ ##ch { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bUnitID; __u8 bSourceID; __u8 bControlSize; __le16 bmaControls[ch + 1]; __u8 iFeature; \
159} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700160struct uac_mixer_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800161 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800162 __u8 bDescriptorType;
163 __u8 bDescriptorSubtype;
164 __u8 bUnitID;
165 __u8 bNrInPins;
Tao Baod7db5942015-01-28 10:07:51 -0800166 __u8 baSourceID[];
167} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700168struct uac_selector_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800169 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800170 __u8 bDescriptorType;
171 __u8 bDescriptorSubtype;
172 __u8 bUintID;
173 __u8 bNrInPins;
Tao Baod7db5942015-01-28 10:07:51 -0800174 __u8 baSourceID[];
175} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700176struct uac_feature_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800178 __u8 bDescriptorType;
179 __u8 bDescriptorSubtype;
180 __u8 bUnitID;
181 __u8 bSourceID;
Tao Baod7db5942015-01-28 10:07:51 -0800182 __u8 bControlSize;
183 __u8 bmaControls[0];
Ben Cheng655a7c02013-10-16 16:09:24 -0700184} __attribute__((packed));
185struct uac_processing_unit_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800186 __u8 bLength;
187 __u8 bDescriptorType;
188 __u8 bDescriptorSubtype;
189 __u8 bUnitID;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800190 __le16 wProcessType;
Tao Baod7db5942015-01-28 10:07:51 -0800191 __u8 bNrInPins;
192 __u8 baSourceID[];
193} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700194struct uac1_as_header_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800195 __u8 bLength;
196 __u8 bDescriptorType;
197 __u8 bDescriptorSubtype;
Tao Baod7db5942015-01-28 10:07:51 -0800198 __u8 bTerminalLink;
199 __u8 bDelay;
200 __le16 wFormatTag;
201} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700202#define UAC_DT_AS_HEADER_SIZE 7
203#define UAC_FORMAT_TYPE_I_UNDEFINED 0x0
204#define UAC_FORMAT_TYPE_I_PCM 0x1
205#define UAC_FORMAT_TYPE_I_PCM8 0x2
Ben Cheng655a7c02013-10-16 16:09:24 -0700206#define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3
207#define UAC_FORMAT_TYPE_I_ALAW 0x4
208#define UAC_FORMAT_TYPE_I_MULAW 0x5
209struct uac_format_type_i_continuous_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800210 __u8 bLength;
211 __u8 bDescriptorType;
212 __u8 bDescriptorSubtype;
213 __u8 bFormatType;
Tao Baod7db5942015-01-28 10:07:51 -0800214 __u8 bNrChannels;
215 __u8 bSubframeSize;
216 __u8 bBitResolution;
217 __u8 bSamFreqType;
Tao Baod7db5942015-01-28 10:07:51 -0800218 __u8 tLowerSamFreq[3];
219 __u8 tUpperSamFreq[3];
220} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700221#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14
Ben Cheng655a7c02013-10-16 16:09:24 -0700222struct uac_format_type_i_discrete_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800223 __u8 bLength;
224 __u8 bDescriptorType;
225 __u8 bDescriptorSubtype;
Tao Baod7db5942015-01-28 10:07:51 -0800226 __u8 bFormatType;
227 __u8 bNrChannels;
228 __u8 bSubframeSize;
229 __u8 bBitResolution;
Tao Baod7db5942015-01-28 10:07:51 -0800230 __u8 bSamFreqType;
231 __u8 tSamFreq[][3];
232} __attribute__((packed));
233#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) struct uac_format_type_i_discrete_descriptor_ ##n { __u8 bLength; __u8 bDescriptorType; __u8 bDescriptorSubtype; __u8 bFormatType; __u8 bNrChannels; __u8 bSubframeSize; __u8 bBitResolution; __u8 bSamFreqType; __u8 tSamFreq[n][3]; \
234} __attribute__((packed))
Ben Cheng655a7c02013-10-16 16:09:24 -0700235#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3))
236struct uac_format_type_i_ext_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800237 __u8 bLength;
238 __u8 bDescriptorType;
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u8 bDescriptorSubtype;
240 __u8 bFormatType;
241 __u8 bSubslotSize;
242 __u8 bBitResolution;
Tao Baod7db5942015-01-28 10:07:51 -0800243 __u8 bHeaderLength;
244 __u8 bControlSize;
245 __u8 bSideBandProtocol;
Ben Cheng655a7c02013-10-16 16:09:24 -0700246} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700247#define UAC_FORMAT_TYPE_II_MPEG 0x1001
248#define UAC_FORMAT_TYPE_II_AC3 0x1002
249struct uac_format_type_ii_discrete_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800250 __u8 bLength;
Tao Baod7db5942015-01-28 10:07:51 -0800251 __u8 bDescriptorType;
252 __u8 bDescriptorSubtype;
253 __u8 bFormatType;
254 __le16 wMaxBitRate;
Tao Baod7db5942015-01-28 10:07:51 -0800255 __le16 wSamplesPerFrame;
256 __u8 bSamFreqType;
257 __u8 tSamFreq[][3];
Ben Cheng655a7c02013-10-16 16:09:24 -0700258} __attribute__((packed));
Ben Cheng655a7c02013-10-16 16:09:24 -0700259struct uac_format_type_ii_ext_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800260 __u8 bLength;
261 __u8 bDescriptorType;
262 __u8 bDescriptorSubtype;
Tao Baod7db5942015-01-28 10:07:51 -0800263 __u8 bFormatType;
Christopher Ferris1308ad32017-11-14 17:32:13 -0800264 __le16 wMaxBitRate;
265 __le16 wSamplesPerFrame;
Tao Baod7db5942015-01-28 10:07:51 -0800266 __u8 bHeaderLength;
Tao Baod7db5942015-01-28 10:07:51 -0800267 __u8 bSideBandProtocol;
Ben Cheng655a7c02013-10-16 16:09:24 -0700268} __attribute__((packed));
269#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
270#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
Ben Cheng655a7c02013-10-16 16:09:24 -0700271#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
272#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
273#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
274#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006
Ben Cheng655a7c02013-10-16 16:09:24 -0700275#define UAC_FORMAT_TYPE_UNDEFINED 0x0
276#define UAC_FORMAT_TYPE_I 0x1
277#define UAC_FORMAT_TYPE_II 0x2
278#define UAC_FORMAT_TYPE_III 0x3
Ben Cheng655a7c02013-10-16 16:09:24 -0700279#define UAC_EXT_FORMAT_TYPE_I 0x81
280#define UAC_EXT_FORMAT_TYPE_II 0x82
281#define UAC_EXT_FORMAT_TYPE_III 0x83
282struct uac_iso_endpoint_descriptor {
Tao Baod7db5942015-01-28 10:07:51 -0800283 __u8 bLength;
284 __u8 bDescriptorType;
285 __u8 bDescriptorSubtype;
286 __u8 bmAttributes;
Tao Baod7db5942015-01-28 10:07:51 -0800287 __u8 bLockDelayUnits;
288 __le16 wLockDelay;
Ben Cheng655a7c02013-10-16 16:09:24 -0700289} __attribute__((packed));
290#define UAC_ISO_ENDPOINT_DESC_SIZE 7
Ben Cheng655a7c02013-10-16 16:09:24 -0700291#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01
292#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
293#define UAC_EP_CS_ATTR_FILL_MAX 0x80
294#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f
Ben Cheng655a7c02013-10-16 16:09:24 -0700295#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
296#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1
297#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2
298#define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7)
Ben Cheng655a7c02013-10-16 16:09:24 -0700299#define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6)
300struct uac1_status_word {
Tao Baod7db5942015-01-28 10:07:51 -0800301 __u8 bStatusType;
302 __u8 bOriginator;
Ben Cheng655a7c02013-10-16 16:09:24 -0700303} __attribute__((packed));
304#endif