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