1655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng/**************************************************************************** 2655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 3655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 4655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** This header was automatically generated from a Linux kernel header 5655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** of the same name, to make information necessary for userspace to 6655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** call into the kernel available to libc. It contains only constants, 7655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** structures, and macros generated from the original header, and thus, 8655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** contains no copyrightable information. 9655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 10655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** To edit the content of this header, modify the corresponding 11655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** source file (e.g. under external/kernel-headers/original/) then 12655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** run bionic/libc/kernel/tools/update_all.py 13655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 14655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** Any manual change here will be lost the next time this script will 15655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** be run. You've been warned! 16655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng *** 17655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng **************************************************************************** 18655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng ****************************************************************************/ 19655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#ifndef _UAPI__LINUX_USB_AUDIO_H 20655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define _UAPI__LINUX_USB_AUDIO_H 21655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#include <linux/types.h> 22655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_VERSION_1 0x00 23655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_VERSION_2 0x20 24655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define USB_SUBCLASS_AUDIOCONTROL 0x01 25655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define USB_SUBCLASS_AUDIOSTREAMING 0x02 26655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define USB_SUBCLASS_MIDISTREAMING 0x03 27655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_HEADER 0x01 28655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL 0x02 29655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL 0x03 30655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_MIXER_UNIT 0x04 31655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SELECTOR_UNIT 0x05 32655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FEATURE_UNIT 0x06 33655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_PROCESSING_UNIT 0x07 34655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_EXTENSION_UNIT 0x08 35655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_AS_GENERAL 0x01 36655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE 0x02 37655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_SPECIFIC 0x03 38655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_UNDEFINED 0x00 39655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_UP_DOWNMIX 0x01 40655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_DOLBY_PROLOGIC 0x02 41655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_STEREO_EXTENDER 0x03 42655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_REVERB 0x04 43655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_CHORUS 0x05 44655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_PROCESS_DYN_RANGE_COMP 0x06 45655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EP_GENERAL 0x01 46655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_ 0x00 47655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_ 0x80 48655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC__CUR 0x1 49655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC__MIN 0x2 50655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC__MAX 0x3 51655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC__RES 0x4 52655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC__MEM 0x5 53655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_CUR (UAC_SET_ | UAC__CUR) 54655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_CUR (UAC_GET_ | UAC__CUR) 55655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_MIN (UAC_SET_ | UAC__MIN) 56655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_MIN (UAC_GET_ | UAC__MIN) 57655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_MAX (UAC_SET_ | UAC__MAX) 58655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_MAX (UAC_GET_ | UAC__MAX) 59655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_RES (UAC_SET_ | UAC__RES) 60655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_RES (UAC_GET_ | UAC__RES) 61655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_SET_MEM (UAC_SET_ | UAC__MEM) 62655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_MEM (UAC_GET_ | UAC__MEM) 63655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_GET_STAT 0xff 64655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_TERM_COPY_PROTECT 0x01 65655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_MUTE 0x01 66655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_VOLUME 0x02 67655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_BASS 0x03 68655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_MID 0x04 69655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_TREBLE 0x05 70655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_GRAPHIC_EQUALIZER 0x06 71655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_AUTOMATIC_GAIN 0x07 72655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_DELAY 0x08 73655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_BASS_BOOST 0x09 74655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FU_LOUDNESS 0x0a 75655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_CONTROL_BIT(CS) (1 << ((CS) - 1)) 76655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_UD_ENABLE 0x01 77655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_UD_MODE_SELECT 0x02 78655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DP_ENABLE 0x01 79655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DP_MODE_SELECT 0x02 80655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_3D_ENABLE 0x01 81655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_3D_SPACE 0x02 82655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_REVERB_ENABLE 0x01 83655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_REVERB_LEVEL 0x02 84655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_REVERB_TIME 0x03 85655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_REVERB_FEEDBACK 0x04 86655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_CHORUS_ENABLE 0x01 87655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_CHORUS_LEVEL 0x02 88655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_CHORUS_RATE 0x03 89655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_CHORUS_DEPTH 0x04 90655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_ENABLE 0x01 91655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_RATE 0x02 92655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_MAXAMPL 0x03 93655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_THRESHOLD 0x04 94655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_ATTACK_TIME 0x05 95655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DCR_RELEASE_TIME 0x06 96655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_XU_ENABLE 0x01 97655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_MS_HEADER 0x01 98655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_MIDI_IN_JACK 0x02 99655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_MIDI_OUT_JACK 0x03 100655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_MS_GENERAL 0x01 101655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_TERMINAL_UNDEFINED 0x100 102655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_TERMINAL_STREAMING 0x101 103655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_TERMINAL_VENDOR_SPEC 0x1FF 104655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac1_ac_header_descriptor { 105d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 106d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 107d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 108d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 bcdADC; 109d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wTotalLength; 110d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bInCollection; 111d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 baInterfaceNr[]; 112d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 113655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) 114d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#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]; \ 115d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)) 116655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_input_terminal_descriptor { 117d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 118d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 119d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 120d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bTerminalID; 121d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wTerminalType; 122d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bAssocTerminal; 123d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrChannels; 124d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wChannelConfig; 125d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 iChannelNames; 126d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 iTerminal; 127d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 128655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DT_INPUT_TERMINAL_SIZE 12 129655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_UNDEFINED 0x200 130655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_MICROPHONE 0x201 131655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 132655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 133655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 134655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 135655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 136655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 137655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac1_output_terminal_descriptor { 138d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 139d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 140d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 141d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bTerminalID; 142d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wTerminalType; 143d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bAssocTerminal; 144d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSourceID; 145d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 iTerminal; 146d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 147655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DT_OUTPUT_TERMINAL_SIZE 9 148655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_UNDEFINED 0x300 149655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_SPEAKER 0x301 150655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_HEADPHONES 0x302 151655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 152655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 153655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 154655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 155655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 156655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) 157d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#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; \ 158d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)) 159655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_mixer_unit_descriptor { 160d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 161d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 162d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 163d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bUnitID; 164d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrInPins; 165d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 baSourceID[]; 166d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 167655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_selector_unit_descriptor { 168d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 169d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 170d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 171d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bUintID; 172d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrInPins; 173d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 baSourceID[]; 174d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 175655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_feature_unit_descriptor { 176d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 177d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 178d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 179d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bUnitID; 180d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSourceID; 181d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bControlSize; 182d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bmaControls[0]; 183655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 184655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_processing_unit_descriptor { 185d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 186d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 187d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 188d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bUnitID; 189d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u16 wProcessType; 190d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrInPins; 191d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 baSourceID[]; 192d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 193655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac1_as_header_descriptor { 194d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 195d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 196d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 197d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bTerminalLink; 198d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDelay; 199d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wFormatTag; 200d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 201655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_DT_AS_HEADER_SIZE 7 202655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_UNDEFINED 0x0 203655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_PCM 0x1 204655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_PCM8 0x2 205655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_IEEE_FLOAT 0x3 206655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_ALAW 0x4 207655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_MULAW 0x5 208655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_format_type_i_continuous_descriptor { 209d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 210d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 211d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 212d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bFormatType; 213d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrChannels; 214d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSubframeSize; 215d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bBitResolution; 216d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSamFreqType; 217d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 tLowerSamFreq[3]; 218d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 tUpperSamFreq[3]; 219d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 220655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 221655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_format_type_i_discrete_descriptor { 222d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 223d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 224d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 225d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bFormatType; 226d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bNrChannels; 227d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSubframeSize; 228d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bBitResolution; 229d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSamFreqType; 230d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 tSamFreq[][3]; 231d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)); 232d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#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]; \ 233d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao} __attribute__((packed)) 234655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) 235655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_format_type_i_ext_descriptor { 236d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 237d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 238d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 239d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bFormatType; 240d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSubslotSize; 241d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bBitResolution; 242d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bHeaderLength; 243d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bControlSize; 244d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSideBandProtocol; 245655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 246655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_II_MPEG 0x1001 247655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_II_AC3 0x1002 248655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_format_type_ii_discrete_descriptor { 249d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 250d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 251d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 252d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bFormatType; 253d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wMaxBitRate; 254d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wSamplesPerFrame; 255d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSamFreqType; 256d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 tSamFreq[][3]; 257655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 258655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_format_type_ii_ext_descriptor { 259d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 260d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 261d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 262d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bFormatType; 263d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u16 wMaxBitRate; 264d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u16 wSamplesPerFrame; 265d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bHeaderLength; 266d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bSideBandProtocol; 267655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 268655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 269655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 270655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 271655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 272655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 273655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 274655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_UNDEFINED 0x0 275655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_I 0x1 276655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_II 0x2 277655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_FORMAT_TYPE_III 0x3 278655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EXT_FORMAT_TYPE_I 0x81 279655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EXT_FORMAT_TYPE_II 0x82 280655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EXT_FORMAT_TYPE_III 0x83 281655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac_iso_endpoint_descriptor { 282d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLength; 283d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorType; 284d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bDescriptorSubtype; 285d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bmAttributes; 286d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bLockDelayUnits; 287d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __le16 wLockDelay; 288655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 289655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_ISO_ENDPOINT_DESC_SIZE 7 290655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 291655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 292655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC_EP_CS_ATTR_FILL_MAX 0x80 293655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f 294655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0 295655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1 296655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2 297655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7) 298655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6) 299655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Chengstruct uac1_status_word { 300d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bStatusType; 301d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao __u8 bOriginator; 302655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng} __attribute__((packed)); 303655a7c081f83b8351ed5f11a6c6accd9458293a8Ben Cheng#endif 304