Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 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 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define UAC_VERSION_2 0x20 |
Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame^] | 24 | #define UAC_VERSION_3 0x30 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 25 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
| 26 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 27 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 28 | #define UAC_HEADER 0x01 |
| 29 | #define UAC_INPUT_TERMINAL 0x02 |
| 30 | #define UAC_OUTPUT_TERMINAL 0x03 |
| 31 | #define UAC_MIXER_UNIT 0x04 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 32 | #define UAC_SELECTOR_UNIT 0x05 |
| 33 | #define UAC_FEATURE_UNIT 0x06 |
| 34 | #define UAC1_PROCESSING_UNIT 0x07 |
| 35 | #define UAC1_EXTENSION_UNIT 0x08 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 36 | #define UAC_AS_GENERAL 0x01 |
| 37 | #define UAC_FORMAT_TYPE 0x02 |
| 38 | #define UAC_FORMAT_SPECIFIC 0x03 |
| 39 | #define UAC_PROCESS_UNDEFINED 0x00 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 40 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | #define UAC_GET_ 0x80 |
| 49 | #define UAC__CUR 0x1 |
| 50 | #define UAC__MIN 0x2 |
| 51 | #define UAC__MAX 0x3 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 52 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 60 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 64 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 68 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 80 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 84 | #define UAC_REVERB_LEVEL 0x02 |
| 85 | #define UAC_REVERB_TIME 0x03 |
| 86 | #define UAC_REVERB_FEEDBACK 0x04 |
| 87 | #define UAC_CHORUS_ENABLE 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 88 | #define UAC_CHORUS_LEVEL 0x02 |
| 89 | #define UAC_CHORUS_RATE 0x03 |
| 90 | #define UAC_CHORUS_DEPTH 0x04 |
| 91 | #define UAC_DCR_ENABLE 0x01 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 92 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 96 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 100 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 104 | #define UAC_TERMINAL_VENDOR_SPEC 0x1FF |
| 105 | struct uac1_ac_header_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 106 | __u8 bLength; |
| 107 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 108 | __u8 bDescriptorSubtype; |
| 109 | __le16 bcdADC; |
| 110 | __le16 wTotalLength; |
| 111 | __u8 bInCollection; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 112 | __u8 baInterfaceNr[]; |
| 113 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 114 | #define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 115 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 117 | struct uac_input_terminal_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 118 | __u8 bLength; |
| 119 | __u8 bDescriptorType; |
| 120 | __u8 bDescriptorSubtype; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 121 | __u8 bTerminalID; |
| 122 | __le16 wTerminalType; |
| 123 | __u8 bAssocTerminal; |
| 124 | __u8 bNrChannels; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 125 | __le16 wChannelConfig; |
| 126 | __u8 iChannelNames; |
| 127 | __u8 iTerminal; |
| 128 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 129 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 133 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 137 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 |
| 138 | struct uac1_output_terminal_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 139 | __u8 bLength; |
| 140 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 141 | __u8 bDescriptorSubtype; |
| 142 | __u8 bTerminalID; |
| 143 | __le16 wTerminalType; |
| 144 | __u8 bAssocTerminal; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 145 | __u8 bSourceID; |
| 146 | __u8 iTerminal; |
| 147 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 148 | #define UAC_DT_OUTPUT_TERMINAL_SIZE 9 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 149 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 153 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 157 | #define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 158 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 160 | struct uac_mixer_unit_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 161 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 162 | __u8 bDescriptorType; |
| 163 | __u8 bDescriptorSubtype; |
| 164 | __u8 bUnitID; |
| 165 | __u8 bNrInPins; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 166 | __u8 baSourceID[]; |
| 167 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 168 | struct uac_selector_unit_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 169 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 170 | __u8 bDescriptorType; |
| 171 | __u8 bDescriptorSubtype; |
| 172 | __u8 bUintID; |
| 173 | __u8 bNrInPins; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 174 | __u8 baSourceID[]; |
| 175 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 176 | struct uac_feature_unit_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 177 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 178 | __u8 bDescriptorType; |
| 179 | __u8 bDescriptorSubtype; |
| 180 | __u8 bUnitID; |
| 181 | __u8 bSourceID; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 182 | __u8 bControlSize; |
| 183 | __u8 bmaControls[0]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 184 | } __attribute__((packed)); |
| 185 | struct uac_processing_unit_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 186 | __u8 bLength; |
| 187 | __u8 bDescriptorType; |
| 188 | __u8 bDescriptorSubtype; |
| 189 | __u8 bUnitID; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 190 | __le16 wProcessType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 191 | __u8 bNrInPins; |
| 192 | __u8 baSourceID[]; |
| 193 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 194 | struct uac1_as_header_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 195 | __u8 bLength; |
| 196 | __u8 bDescriptorType; |
| 197 | __u8 bDescriptorSubtype; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 198 | __u8 bTerminalLink; |
| 199 | __u8 bDelay; |
| 200 | __le16 wFormatTag; |
| 201 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 202 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 206 | #define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 |
| 207 | #define UAC_FORMAT_TYPE_I_ALAW 0x4 |
| 208 | #define UAC_FORMAT_TYPE_I_MULAW 0x5 |
| 209 | struct uac_format_type_i_continuous_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 210 | __u8 bLength; |
| 211 | __u8 bDescriptorType; |
| 212 | __u8 bDescriptorSubtype; |
| 213 | __u8 bFormatType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 214 | __u8 bNrChannels; |
| 215 | __u8 bSubframeSize; |
| 216 | __u8 bBitResolution; |
| 217 | __u8 bSamFreqType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 218 | __u8 tLowerSamFreq[3]; |
| 219 | __u8 tUpperSamFreq[3]; |
| 220 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 221 | #define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 222 | struct uac_format_type_i_discrete_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 223 | __u8 bLength; |
| 224 | __u8 bDescriptorType; |
| 225 | __u8 bDescriptorSubtype; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 226 | __u8 bFormatType; |
| 227 | __u8 bNrChannels; |
| 228 | __u8 bSubframeSize; |
| 229 | __u8 bBitResolution; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 230 | __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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 235 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
| 236 | struct uac_format_type_i_ext_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 237 | __u8 bLength; |
| 238 | __u8 bDescriptorType; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 239 | __u8 bDescriptorSubtype; |
| 240 | __u8 bFormatType; |
| 241 | __u8 bSubslotSize; |
| 242 | __u8 bBitResolution; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 243 | __u8 bHeaderLength; |
| 244 | __u8 bControlSize; |
| 245 | __u8 bSideBandProtocol; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 246 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 247 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 |
| 248 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 |
| 249 | struct uac_format_type_ii_discrete_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 250 | __u8 bLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 251 | __u8 bDescriptorType; |
| 252 | __u8 bDescriptorSubtype; |
| 253 | __u8 bFormatType; |
| 254 | __le16 wMaxBitRate; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 255 | __le16 wSamplesPerFrame; |
| 256 | __u8 bSamFreqType; |
| 257 | __u8 tSamFreq[][3]; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 258 | } __attribute__((packed)); |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 259 | struct uac_format_type_ii_ext_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 260 | __u8 bLength; |
| 261 | __u8 bDescriptorType; |
| 262 | __u8 bDescriptorSubtype; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 263 | __u8 bFormatType; |
Christopher Ferris | 1308ad3 | 2017-11-14 17:32:13 -0800 | [diff] [blame] | 264 | __le16 wMaxBitRate; |
| 265 | __le16 wSamplesPerFrame; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 266 | __u8 bHeaderLength; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 267 | __u8 bSideBandProtocol; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 268 | } __attribute__((packed)); |
| 269 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 |
| 270 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 271 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 275 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 279 | #define UAC_EXT_FORMAT_TYPE_I 0x81 |
| 280 | #define UAC_EXT_FORMAT_TYPE_II 0x82 |
| 281 | #define UAC_EXT_FORMAT_TYPE_III 0x83 |
| 282 | struct uac_iso_endpoint_descriptor { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 283 | __u8 bLength; |
| 284 | __u8 bDescriptorType; |
| 285 | __u8 bDescriptorSubtype; |
| 286 | __u8 bmAttributes; |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 287 | __u8 bLockDelayUnits; |
| 288 | __le16 wLockDelay; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 289 | } __attribute__((packed)); |
| 290 | #define UAC_ISO_ENDPOINT_DESC_SIZE 7 |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 291 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 295 | #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 Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 299 | #define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) |
| 300 | struct uac1_status_word { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 301 | __u8 bStatusType; |
| 302 | __u8 bOriginator; |
Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 303 | } __attribute__((packed)); |
| 304 | #endif |