1 /**************************************************************************** 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 23 #define UAC_VERSION_2 0x20 24 #define USB_SUBCLASS_AUDIOCONTROL 0x01 25 #define USB_SUBCLASS_AUDIOSTREAMING 0x02 26 #define USB_SUBCLASS_MIDISTREAMING 0x03 27 #define UAC_HEADER 0x01 28 #define UAC_INPUT_TERMINAL 0x02 29 #define UAC_OUTPUT_TERMINAL 0x03 30 #define UAC_MIXER_UNIT 0x04 31 #define UAC_SELECTOR_UNIT 0x05 32 #define UAC_FEATURE_UNIT 0x06 33 #define UAC1_PROCESSING_UNIT 0x07 34 #define UAC1_EXTENSION_UNIT 0x08 35 #define UAC_AS_GENERAL 0x01 36 #define UAC_FORMAT_TYPE 0x02 37 #define UAC_FORMAT_SPECIFIC 0x03 38 #define UAC_PROCESS_UNDEFINED 0x00 39 #define UAC_PROCESS_UP_DOWNMIX 0x01 40 #define UAC_PROCESS_DOLBY_PROLOGIC 0x02 41 #define UAC_PROCESS_STEREO_EXTENDER 0x03 42 #define UAC_PROCESS_REVERB 0x04 43 #define UAC_PROCESS_CHORUS 0x05 44 #define UAC_PROCESS_DYN_RANGE_COMP 0x06 45 #define UAC_EP_GENERAL 0x01 46 #define UAC_SET_ 0x00 47 #define UAC_GET_ 0x80 48 #define UAC__CUR 0x1 49 #define UAC__MIN 0x2 50 #define UAC__MAX 0x3 51 #define UAC__RES 0x4 52 #define UAC__MEM 0x5 53 #define UAC_SET_CUR (UAC_SET_ | UAC__CUR) 54 #define UAC_GET_CUR (UAC_GET_ | UAC__CUR) 55 #define UAC_SET_MIN (UAC_SET_ | UAC__MIN) 56 #define UAC_GET_MIN (UAC_GET_ | UAC__MIN) 57 #define UAC_SET_MAX (UAC_SET_ | UAC__MAX) 58 #define UAC_GET_MAX (UAC_GET_ | UAC__MAX) 59 #define UAC_SET_RES (UAC_SET_ | UAC__RES) 60 #define UAC_GET_RES (UAC_GET_ | UAC__RES) 61 #define UAC_SET_MEM (UAC_SET_ | UAC__MEM) 62 #define UAC_GET_MEM (UAC_GET_ | UAC__MEM) 63 #define UAC_GET_STAT 0xff 64 #define UAC_TERM_COPY_PROTECT 0x01 65 #define UAC_FU_MUTE 0x01 66 #define UAC_FU_VOLUME 0x02 67 #define UAC_FU_BASS 0x03 68 #define UAC_FU_MID 0x04 69 #define UAC_FU_TREBLE 0x05 70 #define UAC_FU_GRAPHIC_EQUALIZER 0x06 71 #define UAC_FU_AUTOMATIC_GAIN 0x07 72 #define UAC_FU_DELAY 0x08 73 #define UAC_FU_BASS_BOOST 0x09 74 #define UAC_FU_LOUDNESS 0x0a 75 #define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1)) 76 #define UAC_UD_ENABLE 0x01 77 #define UAC_UD_MODE_SELECT 0x02 78 #define UAC_DP_ENABLE 0x01 79 #define UAC_DP_MODE_SELECT 0x02 80 #define UAC_3D_ENABLE 0x01 81 #define UAC_3D_SPACE 0x02 82 #define UAC_REVERB_ENABLE 0x01 83 #define UAC_REVERB_LEVEL 0x02 84 #define UAC_REVERB_TIME 0x03 85 #define UAC_REVERB_FEEDBACK 0x04 86 #define UAC_CHORUS_ENABLE 0x01 87 #define UAC_CHORUS_LEVEL 0x02 88 #define UAC_CHORUS_RATE 0x03 89 #define UAC_CHORUS_DEPTH 0x04 90 #define UAC_DCR_ENABLE 0x01 91 #define UAC_DCR_RATE 0x02 92 #define UAC_DCR_MAXAMPL 0x03 93 #define UAC_DCR_THRESHOLD 0x04 94 #define UAC_DCR_ATTACK_TIME 0x05 95 #define UAC_DCR_RELEASE_TIME 0x06 96 #define UAC_XU_ENABLE 0x01 97 #define UAC_MS_HEADER 0x01 98 #define UAC_MIDI_IN_JACK 0x02 99 #define UAC_MIDI_OUT_JACK 0x03 100 #define UAC_MS_GENERAL 0x01 101 #define UAC_TERMINAL_UNDEFINED 0x100 102 #define UAC_TERMINAL_STREAMING 0x101 103 #define UAC_TERMINAL_VENDOR_SPEC 0x1FF 104 struct uac1_ac_header_descriptor { 105 __u8 bLength; 106 __u8 bDescriptorType; 107 __u8 bDescriptorSubtype; 108 __le16 bcdADC; 109 __le16 wTotalLength; 110 __u8 bInCollection; 111 __u8 baInterfaceNr[]; 112 } __attribute__((packed)); 113 #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) 114 #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]; \ 115 } __attribute__((packed)) 116 struct uac_input_terminal_descriptor { 117 __u8 bLength; 118 __u8 bDescriptorType; 119 __u8 bDescriptorSubtype; 120 __u8 bTerminalID; 121 __le16 wTerminalType; 122 __u8 bAssocTerminal; 123 __u8 bNrChannels; 124 __le16 wChannelConfig; 125 __u8 iChannelNames; 126 __u8 iTerminal; 127 } __attribute__((packed)); 128 #define UAC_DT_INPUT_TERMINAL_SIZE 12 129 #define UAC_INPUT_TERMINAL_UNDEFINED 0x200 130 #define UAC_INPUT_TERMINAL_MICROPHONE 0x201 131 #define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 132 #define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 133 #define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 134 #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 135 #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 136 #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 137 struct uac1_output_terminal_descriptor { 138 __u8 bLength; 139 __u8 bDescriptorType; 140 __u8 bDescriptorSubtype; 141 __u8 bTerminalID; 142 __le16 wTerminalType; 143 __u8 bAssocTerminal; 144 __u8 bSourceID; 145 __u8 iTerminal; 146 } __attribute__((packed)); 147 #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 148 #define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 149 #define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 150 #define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 151 #define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 152 #define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 153 #define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 154 #define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 155 #define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 156 #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) 157 #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; \ 158 } __attribute__((packed)) 159 struct uac_mixer_unit_descriptor { 160 __u8 bLength; 161 __u8 bDescriptorType; 162 __u8 bDescriptorSubtype; 163 __u8 bUnitID; 164 __u8 bNrInPins; 165 __u8 baSourceID[]; 166 } __attribute__((packed)); 167 struct uac_selector_unit_descriptor { 168 __u8 bLength; 169 __u8 bDescriptorType; 170 __u8 bDescriptorSubtype; 171 __u8 bUintID; 172 __u8 bNrInPins; 173 __u8 baSourceID[]; 174 } __attribute__((packed)); 175 struct uac_feature_unit_descriptor { 176 __u8 bLength; 177 __u8 bDescriptorType; 178 __u8 bDescriptorSubtype; 179 __u8 bUnitID; 180 __u8 bSourceID; 181 __u8 bControlSize; 182 __u8 bmaControls[0]; 183 } __attribute__((packed)); 184 struct uac_processing_unit_descriptor { 185 __u8 bLength; 186 __u8 bDescriptorType; 187 __u8 bDescriptorSubtype; 188 __u8 bUnitID; 189 __u16 wProcessType; 190 __u8 bNrInPins; 191 __u8 baSourceID[]; 192 } __attribute__((packed)); 193 struct uac1_as_header_descriptor { 194 __u8 bLength; 195 __u8 bDescriptorType; 196 __u8 bDescriptorSubtype; 197 __u8 bTerminalLink; 198 __u8 bDelay; 199 __le16 wFormatTag; 200 } __attribute__((packed)); 201 #define UAC_DT_AS_HEADER_SIZE 7 202 #define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 203 #define UAC_FORMAT_TYPE_I_PCM 0x1 204 #define UAC_FORMAT_TYPE_I_PCM8 0x2 205 #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 206 #define UAC_FORMAT_TYPE_I_ALAW 0x4 207 #define UAC_FORMAT_TYPE_I_MULAW 0x5 208 struct uac_format_type_i_continuous_descriptor { 209 __u8 bLength; 210 __u8 bDescriptorType; 211 __u8 bDescriptorSubtype; 212 __u8 bFormatType; 213 __u8 bNrChannels; 214 __u8 bSubframeSize; 215 __u8 bBitResolution; 216 __u8 bSamFreqType; 217 __u8 tLowerSamFreq[3]; 218 __u8 tUpperSamFreq[3]; 219 } __attribute__((packed)); 220 #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 221 struct uac_format_type_i_discrete_descriptor { 222 __u8 bLength; 223 __u8 bDescriptorType; 224 __u8 bDescriptorSubtype; 225 __u8 bFormatType; 226 __u8 bNrChannels; 227 __u8 bSubframeSize; 228 __u8 bBitResolution; 229 __u8 bSamFreqType; 230 __u8 tSamFreq[][3]; 231 } __attribute__((packed)); 232 #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]; \ 233 } __attribute__((packed)) 234 #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) 235 struct uac_format_type_i_ext_descriptor { 236 __u8 bLength; 237 __u8 bDescriptorType; 238 __u8 bDescriptorSubtype; 239 __u8 bFormatType; 240 __u8 bSubslotSize; 241 __u8 bBitResolution; 242 __u8 bHeaderLength; 243 __u8 bControlSize; 244 __u8 bSideBandProtocol; 245 } __attribute__((packed)); 246 #define UAC_FORMAT_TYPE_II_MPEG 0x1001 247 #define UAC_FORMAT_TYPE_II_AC3 0x1002 248 struct uac_format_type_ii_discrete_descriptor { 249 __u8 bLength; 250 __u8 bDescriptorType; 251 __u8 bDescriptorSubtype; 252 __u8 bFormatType; 253 __le16 wMaxBitRate; 254 __le16 wSamplesPerFrame; 255 __u8 bSamFreqType; 256 __u8 tSamFreq[][3]; 257 } __attribute__((packed)); 258 struct uac_format_type_ii_ext_descriptor { 259 __u8 bLength; 260 __u8 bDescriptorType; 261 __u8 bDescriptorSubtype; 262 __u8 bFormatType; 263 __u16 wMaxBitRate; 264 __u16 wSamplesPerFrame; 265 __u8 bHeaderLength; 266 __u8 bSideBandProtocol; 267 } __attribute__((packed)); 268 #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 269 #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 270 #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 271 #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 272 #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 273 #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 274 #define UAC_FORMAT_TYPE_UNDEFINED 0x0 275 #define UAC_FORMAT_TYPE_I 0x1 276 #define UAC_FORMAT_TYPE_II 0x2 277 #define UAC_FORMAT_TYPE_III 0x3 278 #define UAC_EXT_FORMAT_TYPE_I 0x81 279 #define UAC_EXT_FORMAT_TYPE_II 0x82 280 #define UAC_EXT_FORMAT_TYPE_III 0x83 281 struct uac_iso_endpoint_descriptor { 282 __u8 bLength; 283 __u8 bDescriptorType; 284 __u8 bDescriptorSubtype; 285 __u8 bmAttributes; 286 __u8 bLockDelayUnits; 287 __le16 wLockDelay; 288 } __attribute__((packed)); 289 #define UAC_ISO_ENDPOINT_DESC_SIZE 7 290 #define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 291 #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 292 #define UAC_EP_CS_ATTR_FILL_MAX 0x80 293 #define UAC1_STATUS_TYPE_ORIG_MASK 0x0f 294 #define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0 295 #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1 296 #define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2 297 #define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7) 298 #define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) 299 struct uac1_status_word { 300 __u8 bStatusType; 301 __u8 bOriginator; 302 } __attribute__((packed)); 303 #endif 304