Home | History | Annotate | Line # | Download | only in usb
uaudioreg.h revision 1.18
      1  1.18   mlelstv /*	$NetBSD: uaudioreg.h,v 1.18 2023/04/10 15:14:50 mlelstv Exp $	*/
      2   1.1  augustss 
      3   1.1  augustss /*
      4   1.1  augustss  * Copyright (c) 1999 The NetBSD Foundation, Inc.
      5   1.1  augustss  * All rights reserved.
      6   1.1  augustss  *
      7   1.5  augustss  * This code is derived from software contributed to The NetBSD Foundation
      8   1.5  augustss  * by Lennart Augustsson (lennart (at) augustsson.net) at
      9   1.5  augustss  * Carlstedt Research & Technology.
     10   1.1  augustss  *
     11   1.1  augustss  * Redistribution and use in source and binary forms, with or without
     12   1.1  augustss  * modification, are permitted provided that the following conditions
     13   1.1  augustss  * are met:
     14   1.1  augustss  * 1. Redistributions of source code must retain the above copyright
     15   1.1  augustss  *    notice, this list of conditions and the following disclaimer.
     16   1.1  augustss  * 2. Redistributions in binary form must reproduce the above copyright
     17   1.1  augustss  *    notice, this list of conditions and the following disclaimer in the
     18   1.1  augustss  *    documentation and/or other materials provided with the distribution.
     19   1.1  augustss  *
     20   1.1  augustss  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     21   1.1  augustss  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     22   1.1  augustss  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     23   1.1  augustss  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     24   1.1  augustss  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     25   1.1  augustss  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     26   1.1  augustss  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     27   1.1  augustss  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     28   1.1  augustss  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     29   1.1  augustss  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     30   1.1  augustss  * POSSIBILITY OF SUCH DAMAGE.
     31   1.1  augustss  */
     32   1.1  augustss 
     33  1.17   mlelstv #define UAUDIO_VERSION1		0x100
     34  1.17   mlelstv #define UAUDIO_VERSION2		0x200
     35   1.1  augustss 
     36   1.1  augustss #define UDESC_CS_CONFIG		0x22
     37   1.1  augustss #define UDESC_CS_STRING		0x23
     38   1.1  augustss #define UDESC_CS_INTERFACE	0x24
     39   1.1  augustss #define UDESC_CS_ENDPOINT	0x25
     40   1.1  augustss 
     41   1.1  augustss #define UDESCSUB_AC_HEADER	1
     42   1.1  augustss #define UDESCSUB_AC_INPUT	2
     43   1.1  augustss #define UDESCSUB_AC_OUTPUT	3
     44   1.1  augustss #define UDESCSUB_AC_MIXER	4
     45   1.1  augustss #define UDESCSUB_AC_SELECTOR	5
     46   1.1  augustss #define UDESCSUB_AC_FEATURE	6
     47  1.17   mlelstv #define UDESCSUB_AC_EFFECT      7
     48  1.17   mlelstv #define UDESCSUB_AC_PROCESSING	8
     49  1.17   mlelstv #define UDESCSUB_AC_EXTENSION	9
     50  1.17   mlelstv #define UDESCSUB_AC_CLKSRC	10
     51  1.17   mlelstv #define UDESCSUB_AC_CLKSEL	11
     52  1.17   mlelstv #define UDESCSUB_AC_CLKMULT	12
     53  1.17   mlelstv #define UDESCSUB_AC_RATECONV    13
     54   1.1  augustss 
     55   1.1  augustss /* The first fields are identical to usb_endpoint_descriptor_t */
     56   1.1  augustss typedef struct {
     57   1.1  augustss 	uByte		bLength;
     58   1.1  augustss 	uByte		bDescriptorType;
     59   1.1  augustss 	uByte		bEndpointAddress;
     60   1.1  augustss 	uByte		bmAttributes;
     61   1.1  augustss 	uWord		wMaxPacketSize;
     62   1.1  augustss 	uByte		bInterval;
     63   1.9  augustss 	/*
     64   1.1  augustss 	 * The following two entries are only used by the Audio Class.
     65   1.1  augustss 	 * And according to the specs the Audio Class is the only one
     66   1.1  augustss 	 * allowed to extend the endpoint descriptor.
     67   1.1  augustss 	 * Who knows what goes on in the minds of the people in the USB
     68   1.1  augustss 	 * standardization?  :-(
     69   1.1  augustss 	 */
     70   1.1  augustss 	uByte		bRefresh;
     71   1.1  augustss 	uByte		bSynchAddress;
     72   1.6  augustss } UPACKED usb_endpoint_descriptor_audio_t;
     73   1.1  augustss 
     74  1.14  drochner /* generic, for iteration */
     75  1.14  drochner typedef struct {
     76  1.14  drochner 	uByte		bLength;
     77  1.14  drochner 	uByte		bDescriptorType;
     78  1.14  drochner 	uByte		bDescriptorSubtype;
     79  1.14  drochner } UPACKED uaudio_cs_descriptor_t;
     80  1.14  drochner 
     81   1.1  augustss struct usb_audio_control_descriptor {
     82   1.1  augustss 	uByte		bLength;
     83   1.1  augustss 	uByte		bDescriptorType;
     84   1.1  augustss 	uByte		bDescriptorSubtype;
     85   1.1  augustss 	uWord		bcdADC;
     86   1.1  augustss 	uWord		wTotalLength;
     87   1.1  augustss 	uByte		bInCollection;
     88   1.1  augustss 	uByte		baInterfaceNr[1];
     89   1.6  augustss } UPACKED;
     90   1.1  augustss 
     91  1.17   mlelstv struct usb_audio_streaming_interface_v1_descriptor {
     92   1.1  augustss 	uByte		bLength;
     93   1.1  augustss 	uByte		bDescriptorType;
     94   1.1  augustss 	uByte		bDescriptorSubtype;
     95   1.1  augustss 	uByte		bTerminalLink;
     96   1.1  augustss 	uByte		bDelay;
     97   1.1  augustss 	uWord		wFormatTag;
     98   1.6  augustss } UPACKED;
     99   1.1  augustss 
    100  1.17   mlelstv struct usb_audio_streaming_interface_v2_descriptor {
    101  1.17   mlelstv 	uByte		bLength;
    102  1.17   mlelstv 	uByte		bDescriptorType;
    103  1.17   mlelstv 	uByte		bDescriptorSubtype;
    104  1.17   mlelstv 	uByte		bTerminalLink;
    105  1.17   mlelstv 	uByte		bmControls;
    106  1.17   mlelstv 	uByte		bFormatType;
    107  1.17   mlelstv 	uDWord		bmFormats;
    108  1.17   mlelstv 	uByte		bNrChannels;
    109  1.17   mlelstv 	uDWord		bmChannelConfig;
    110  1.17   mlelstv 	uByte		iChannelNames;
    111  1.17   mlelstv } UPACKED;
    112  1.17   mlelstv 
    113  1.17   mlelstv union usb_audio_streaming_interface_descriptor {
    114  1.17   mlelstv 	struct usb_audio_streaming_interface_v1_descriptor v1;
    115  1.17   mlelstv 	struct usb_audio_streaming_interface_v2_descriptor v2;
    116  1.17   mlelstv };
    117  1.17   mlelstv 
    118   1.1  augustss struct usb_audio_streaming_endpoint_descriptor {
    119   1.1  augustss 	uByte		bLength;
    120   1.1  augustss 	uByte		bDescriptorType;
    121   1.1  augustss 	uByte		bDescriptorSubtype;
    122   1.1  augustss 	uByte		bmAttributes;
    123   1.8      kent #define UA_SED_FREQ_CONTROL	0x01
    124   1.8      kent #define UA_SED_PITCH_CONTROL	0x02
    125   1.8      kent #define UA_SED_MAXPACKETSONLY	0x80
    126   1.1  augustss 	uByte		bLockDelayUnits;
    127   1.1  augustss 	uWord		wLockDelay;
    128   1.6  augustss } UPACKED;
    129   1.1  augustss 
    130  1.17   mlelstv struct usb_audio_streaming_type1_v1_descriptor {
    131   1.1  augustss 	uByte		bLength;
    132   1.1  augustss 	uByte		bDescriptorType;
    133   1.1  augustss 	uByte		bDescriptorSubtype;
    134   1.1  augustss 	uByte		bFormatType;
    135   1.1  augustss 	uByte		bNrChannels;
    136   1.1  augustss 	uByte		bSubFrameSize;
    137   1.1  augustss 	uByte		bBitResolution;
    138   1.1  augustss 	uByte		bSamFreqType;
    139  1.17   mlelstv #define UA_SAMP_CONTINUOUS 0
    140  1.16       jdc 	uByte		tSamFreq[3*AUFMT_MAX_FREQUENCIES];
    141   1.1  augustss #define UA_GETSAMP(p, n) ((p)->tSamFreq[(n)*3+0] | ((p)->tSamFreq[(n)*3+1] << 8) | ((p)->tSamFreq[(n)*3+2] << 16))
    142   1.1  augustss #define UA_SAMP_LO(p) UA_GETSAMP(p, 0)
    143   1.1  augustss #define UA_SAMP_HI(p) UA_GETSAMP(p, 1)
    144   1.6  augustss } UPACKED;
    145   1.1  augustss 
    146  1.17   mlelstv struct usb_audio_streaming_type1_v2_descriptor {
    147  1.17   mlelstv 	uByte		bLength;
    148  1.17   mlelstv 	uByte		bDescriptorType;
    149  1.17   mlelstv 	uByte		bDescriptorSubtype;
    150  1.17   mlelstv 	uByte		bFormatType;
    151  1.17   mlelstv 	uByte		bSubslotSize;
    152  1.17   mlelstv 	uByte		bBitResolution;
    153  1.17   mlelstv } UPACKED;
    154  1.17   mlelstv 
    155  1.17   mlelstv union usb_audio_streaming_type1_descriptor {
    156  1.17   mlelstv 	struct usb_audio_streaming_type1_v1_descriptor v1;
    157  1.17   mlelstv 	struct usb_audio_streaming_type1_v2_descriptor v2;
    158  1.17   mlelstv };
    159  1.17   mlelstv 
    160  1.18   mlelstv struct usb_audio_v1_cluster {
    161   1.1  augustss 	uByte		bNrChannels;
    162   1.1  augustss 	uWord		wChannelConfig;
    163  1.12      kent #define	UA_CHANNEL_LEFT		0x0001
    164  1.12      kent #define	UA_CHANNEL_RIGHT	0x0002
    165  1.12      kent #define	UA_CHANNEL_CENTER	0x0004
    166  1.12      kent #define	UA_CHANNEL_LFE		0x0008
    167  1.12      kent #define	UA_CHANNEL_L_SURROUND	0x0010
    168  1.12      kent #define	UA_CHANNEL_R_SURROUND	0x0020
    169  1.12      kent #define	UA_CHANNEL_L_CENTER	0x0040
    170  1.12      kent #define	UA_CHANNEL_R_CENTER	0x0080
    171  1.12      kent #define	UA_CHANNEL_SURROUND	0x0100
    172  1.12      kent #define	UA_CHANNEL_L_SIDE	0x0200
    173  1.12      kent #define	UA_CHANNEL_R_SIDE	0x0400
    174  1.12      kent #define	UA_CHANNEL_TOP		0x0800
    175   1.1  augustss 	uByte		iChannelNames;
    176   1.6  augustss } UPACKED;
    177  1.10  augustss 
    178  1.18   mlelstv struct usb_audio_v2_cluster {
    179  1.18   mlelstv 	uByte		bNrChannels;
    180  1.18   mlelstv 	uDWord		bmChannelConfig;
    181  1.18   mlelstv /*#define	UA_CHANNEL_LEFT		0x00000001 */
    182  1.18   mlelstv /*#define	UA_CHANNEL_RIGHT	0x00000002 */
    183  1.18   mlelstv /*#define	UA_CHANNEL_CENTER	0x00000004 */
    184  1.18   mlelstv /*#define	UA_CHANNEL_LFE		0x00000008 */
    185  1.18   mlelstv #define	UA_CHANNEL_BL		0x00000010
    186  1.18   mlelstv #define	UA_CHANNEL_BR		0x00000020
    187  1.18   mlelstv #define	UA_CHANNEL_FLC		0x00000040
    188  1.18   mlelstv #define	UA_CHANNEL_FRC		0x00000080
    189  1.18   mlelstv #define	UA_CHANNEL_BC		0x00000100
    190  1.18   mlelstv #define	UA_CHANNEL_SL		0x00000200
    191  1.18   mlelstv #define	UA_CHANNEL_SR		0x00000400
    192  1.18   mlelstv #define	UA_CHANNEL_TC		0x00000800
    193  1.18   mlelstv #define	UA_CHANNEL_TFL		0x00001000
    194  1.18   mlelstv #define	UA_CHANNEL_TFC		0x00002000
    195  1.18   mlelstv #define	UA_CHANNEL_TFR		0x00004000
    196  1.18   mlelstv #define	UA_CHANNEL_TBL		0x00008000
    197  1.18   mlelstv #define	UA_CHANNEL_TBC		0x00010000
    198  1.18   mlelstv #define	UA_CHANNEL_TBR		0x00020000
    199  1.18   mlelstv #define	UA_CHANNEL_TFLC		0x00040000
    200  1.18   mlelstv #define	UA_CHANNEL_TFRC		0x00080000
    201  1.18   mlelstv #define	UA_CHANNEL_LLFE		0x00100000
    202  1.18   mlelstv #define	UA_CHANNEL_RLFE		0x00200000
    203  1.18   mlelstv #define	UA_CHANNEL_TSL		0x00400000
    204  1.18   mlelstv #define	UA_CHANNEL_TSR		0x00800000
    205  1.18   mlelstv #define	UA_CHANNEL_BOTTOM	0x01000000
    206  1.18   mlelstv #define	UA_CHANNEL_BOTTOMLC	0x02000000
    207  1.18   mlelstv #define	UA_CHANNEL_BOTTOMRC	0x04000000
    208  1.18   mlelstv #define	UA_CHANNEL_RD		0x80000000
    209  1.18   mlelstv 	uByte		iChannelNames;
    210  1.18   mlelstv } UPACKED;
    211  1.18   mlelstv 
    212  1.18   mlelstv union usb_audio_cluster {
    213  1.18   mlelstv 	struct usb_audio_v1_cluster v1;
    214  1.18   mlelstv 	struct usb_audio_v2_cluster v2;
    215  1.18   mlelstv };
    216  1.18   mlelstv 
    217  1.10  augustss /* Shared by all units and terminals */
    218  1.10  augustss struct usb_audio_unit {
    219  1.10  augustss 	uByte		bLength;
    220  1.10  augustss 	uByte		bDescriptorType;
    221  1.10  augustss 	uByte		bDescriptorSubtype;
    222  1.10  augustss 	uByte		bUnitId;
    223  1.10  augustss };
    224   1.1  augustss 
    225   1.1  augustss /* UDESCSUB_AC_INPUT */
    226  1.18   mlelstv struct usb_audio_input_v1_terminal {
    227   1.1  augustss 	uByte		bLength;
    228   1.1  augustss 	uByte		bDescriptorType;
    229   1.1  augustss 	uByte		bDescriptorSubtype;
    230   1.1  augustss 	uByte		bTerminalId;
    231   1.1  augustss 	uWord		wTerminalType;
    232   1.1  augustss 	uByte		bAssocTerminal;
    233   1.1  augustss 	uByte		bNrChannels;
    234   1.1  augustss 	uWord		wChannelConfig;
    235   1.1  augustss 	uByte		iChannelNames;
    236   1.1  augustss 	uByte		iTerminal;
    237   1.6  augustss } UPACKED;
    238  1.18   mlelstv struct usb_audio_input_v2_terminal {
    239  1.18   mlelstv 	uByte		bLength;
    240  1.18   mlelstv 	uByte		bDescriptorType;
    241  1.18   mlelstv 	uByte		bDescriptorSubtype;
    242  1.18   mlelstv 	uByte		bTerminalId;
    243  1.18   mlelstv 	uWord		wTerminalType;
    244  1.18   mlelstv 	uByte		bAssocTerminal;
    245  1.18   mlelstv 	uByte		bCSourceId;
    246  1.18   mlelstv 	uByte		bNrChannels;
    247  1.18   mlelstv 	uDWord		bmChannelConfig;
    248  1.18   mlelstv 	uByte		iChannelNames;
    249  1.18   mlelstv 	uWord		bmControls;
    250  1.18   mlelstv 	uByte		iTerminal;
    251  1.18   mlelstv } UPACKED;
    252  1.18   mlelstv 
    253  1.18   mlelstv union usb_audio_input_terminal {
    254  1.18   mlelstv 	struct usb_audio_input_v1_terminal v1;
    255  1.18   mlelstv 	struct usb_audio_input_v2_terminal v2;
    256  1.18   mlelstv };
    257   1.1  augustss 
    258   1.1  augustss /* UDESCSUB_AC_OUTPUT */
    259  1.18   mlelstv struct usb_audio_output_v1_terminal {
    260   1.1  augustss 	uByte		bLength;
    261   1.1  augustss 	uByte		bDescriptorType;
    262   1.1  augustss 	uByte		bDescriptorSubtype;
    263   1.1  augustss 	uByte		bTerminalId;
    264   1.1  augustss 	uWord		wTerminalType;
    265   1.1  augustss 	uByte		bAssocTerminal;
    266   1.1  augustss 	uByte		bSourceId;
    267   1.1  augustss 	uByte		iTerminal;
    268   1.6  augustss } UPACKED;
    269  1.18   mlelstv struct usb_audio_output_v2_terminal {
    270  1.18   mlelstv 	uByte		bLength;
    271  1.18   mlelstv 	uByte		bDescriptorType;
    272  1.18   mlelstv 	uByte		bDescriptorSubtype;
    273  1.18   mlelstv 	uByte		bTerminalId;
    274  1.18   mlelstv 	uWord		wTerminalType;
    275  1.18   mlelstv 	uByte		bAssocTerminal;
    276  1.18   mlelstv 	uByte		bSourceId;
    277  1.18   mlelstv 	uByte		bCSourceId;
    278  1.18   mlelstv 	uWord		bmControls;
    279  1.18   mlelstv 	uByte		iTerminal;
    280  1.18   mlelstv } UPACKED;
    281  1.18   mlelstv 
    282  1.18   mlelstv union usb_audio_output_terminal {
    283  1.18   mlelstv 	struct usb_audio_output_v1_terminal v1;
    284  1.18   mlelstv 	struct usb_audio_output_v2_terminal v2;
    285  1.18   mlelstv };
    286   1.1  augustss 
    287   1.1  augustss /* UDESCSUB_AC_MIXER */
    288   1.1  augustss struct usb_audio_mixer_unit {
    289   1.1  augustss 	uByte		bLength;
    290   1.1  augustss 	uByte		bDescriptorType;
    291   1.1  augustss 	uByte		bDescriptorSubtype;
    292   1.1  augustss 	uByte		bUnitId;
    293   1.1  augustss 	uByte		bNrInPins;
    294   1.4  augustss 	uByte		baSourceId[255]; /* [bNrInPins] */
    295  1.18   mlelstv 	/* union usb_audio_mixer_unit_1 */
    296   1.6  augustss } UPACKED;
    297  1.18   mlelstv struct usb_audio_mixer_v1_unit_1 {
    298   1.1  augustss 	uByte		bNrChannels;
    299   1.1  augustss 	uWord		wChannelConfig;
    300   1.1  augustss 	uByte		iChannelNames;
    301   1.4  augustss 	uByte		bmControls[255]; /* [bNrChannels] */
    302   1.1  augustss 	/*uByte		iMixer;*/
    303   1.6  augustss } UPACKED;
    304  1.18   mlelstv struct usb_audio_mixer_v2_unit_1 {
    305  1.18   mlelstv 	uByte		bNrChannels;
    306  1.18   mlelstv 	uDWord		bmChannelConfig;
    307  1.18   mlelstv 	uByte		iChannelNames;
    308  1.18   mlelstv 	uByte		bmControls[255]; /* [bNrChannels] */
    309  1.18   mlelstv 	/*uByte		iMixer;*/
    310  1.18   mlelstv } UPACKED;
    311  1.18   mlelstv 
    312  1.18   mlelstv union usb_audio_mixer_unit_1 {
    313  1.18   mlelstv 	struct usb_audio_mixer_v1_unit_1 v1;
    314  1.18   mlelstv 	struct usb_audio_mixer_v2_unit_1 v2;
    315  1.18   mlelstv };
    316   1.1  augustss 
    317   1.1  augustss /* UDESCSUB_AC_SELECTOR */
    318   1.1  augustss struct usb_audio_selector_unit {
    319   1.1  augustss 	uByte		bLength;
    320   1.1  augustss 	uByte		bDescriptorType;
    321   1.1  augustss 	uByte		bDescriptorSubtype;
    322   1.1  augustss 	uByte		bUnitId;
    323   1.1  augustss 	uByte		bNrInPins;
    324   1.4  augustss 	uByte		baSourceId[255]; /* [bNrInPins] */
    325   1.1  augustss 	/* uByte	iSelector; */
    326   1.6  augustss } UPACKED;
    327   1.1  augustss 
    328   1.1  augustss /* UDESCSUB_AC_FEATURE */
    329   1.1  augustss struct usb_audio_feature_unit {
    330   1.1  augustss 	uByte		bLength;
    331   1.1  augustss 	uByte		bDescriptorType;
    332   1.1  augustss 	uByte		bDescriptorSubtype;
    333   1.1  augustss 	uByte		bUnitId;
    334   1.1  augustss 	uByte		bSourceId;
    335   1.1  augustss 	uByte		bControlSize;
    336   1.1  augustss 	uByte		bmaControls[255]; /* size for more than enough */
    337   1.1  augustss 	/* uByte	iFeature; */
    338   1.6  augustss } UPACKED;
    339   1.1  augustss 
    340   1.1  augustss /* UDESCSUB_AC_PROCESSING */
    341   1.1  augustss struct usb_audio_processing_unit {
    342   1.1  augustss 	uByte		bLength;
    343   1.1  augustss 	uByte		bDescriptorType;
    344   1.1  augustss 	uByte		bDescriptorSubtype;
    345   1.1  augustss 	uByte		bUnitId;
    346   1.1  augustss 	uWord		wProcessType;
    347   1.1  augustss 	uByte		bNrInPins;
    348   1.4  augustss 	uByte		baSourceId[255]; /* [bNrInPins] */
    349   1.1  augustss 	/* struct usb_audio_processing_unit_1 */
    350   1.6  augustss } UPACKED;
    351   1.1  augustss struct usb_audio_processing_unit_1{
    352   1.1  augustss 	uByte		bNrChannels;
    353   1.1  augustss 	uWord		wChannelConfig;
    354   1.1  augustss 	uByte		iChannelNames;
    355   1.1  augustss 	uByte		bControlSize;
    356   1.4  augustss 	uByte		bmControls[255]; /* [bControlSize] */
    357   1.3  augustss #define UA_PROC_ENABLE_MASK 1
    358   1.6  augustss } UPACKED;
    359   1.4  augustss 
    360   1.4  augustss struct usb_audio_processing_unit_updown {
    361   1.4  augustss 	uByte		iProcessing;
    362   1.4  augustss 	uByte		bNrModes;
    363   1.4  augustss 	uWord		waModes[255]; /* [bNrModes] */
    364   1.6  augustss } UPACKED;
    365   1.1  augustss 
    366   1.1  augustss /* UDESCSUB_AC_EXTENSION */
    367   1.1  augustss struct usb_audio_extension_unit {
    368   1.1  augustss 	uByte		bLength;
    369   1.1  augustss 	uByte		bDescriptorType;
    370   1.1  augustss 	uByte		bDescriptorSubtype;
    371   1.1  augustss 	uByte		bUnitId;
    372   1.1  augustss 	uWord		wExtensionCode;
    373   1.1  augustss 	uByte		bNrInPins;
    374   1.4  augustss 	uByte		baSourceId[255]; /* [bNrInPins] */
    375   1.1  augustss 	/* struct usb_audio_extension_unit_1 */
    376   1.6  augustss } UPACKED;
    377   1.1  augustss struct usb_audio_extension_unit_1 {
    378   1.1  augustss 	uByte		bNrChannels;
    379   1.1  augustss 	uWord		wChannelConfig;
    380   1.1  augustss 	uByte		iChannelNames;
    381   1.1  augustss 	uByte		bControlSize;
    382   1.4  augustss 	uByte		bmControls[255]; /* [bControlSize] */
    383   1.3  augustss #define UA_EXT_ENABLE_MASK 1
    384   1.3  augustss #define UA_EXT_ENABLE 1
    385   1.1  augustss 	/*uByte		iExtension;*/
    386   1.6  augustss } UPACKED;
    387   1.1  augustss 
    388  1.17   mlelstv /* UDESCSUB_AC_CLKSRC */
    389  1.17   mlelstv struct usb_audio_clksrc_unit {
    390  1.17   mlelstv 	uByte		bLength;
    391  1.17   mlelstv 	uByte		bDescriptorType;
    392  1.17   mlelstv 	uByte		bDescriptorSubtype;
    393  1.17   mlelstv 	uByte		bClockId;
    394  1.17   mlelstv 	uByte		bmAttributes;
    395  1.17   mlelstv 	uByte		bmControls;
    396  1.17   mlelstv 	uByte		bAssocTerminal;
    397  1.17   mlelstv 	uByte		iClockSource;
    398  1.17   mlelstv } UPACKED;
    399  1.17   mlelstv 
    400  1.17   mlelstv /* UDESCSUB_AC_CLKSEL */
    401  1.17   mlelstv struct usb_audio_clksel_unit {
    402  1.17   mlelstv 	uByte		bLength;
    403  1.17   mlelstv 	uByte		bDescriptorType;
    404  1.17   mlelstv 	uByte		bDescriptorSubtype;
    405  1.17   mlelstv 	uByte		bClockId;
    406  1.17   mlelstv 	uByte		bNrInPins;
    407  1.17   mlelstv 	uByte		baCSourceId[255];
    408  1.17   mlelstv 	/*uByte		bmControls;*/
    409  1.17   mlelstv 	/*uByte		iClockSelector;*/
    410  1.17   mlelstv } UPACKED;
    411  1.17   mlelstv 
    412  1.17   mlelstv /* UDESCSUB_AC_CLKMULT */
    413  1.17   mlelstv struct usb_audio_clkmult_unit {
    414  1.17   mlelstv 	uByte		bLength;
    415  1.17   mlelstv 	uByte		bDescriptorType;
    416  1.17   mlelstv 	uByte		bDescriptorSubtype;
    417  1.17   mlelstv 	uByte		bClockId;
    418  1.17   mlelstv 	uByte		bCSourceId;
    419  1.17   mlelstv 	uByte		bmControls;
    420  1.17   mlelstv 	uByte		iClockMultiplier;
    421  1.17   mlelstv } UPACKED;
    422  1.17   mlelstv 
    423   1.7  augustss /* USB terminal types */
    424   1.7  augustss #define UAT_UNDEFINED		0x0100
    425   1.7  augustss #define UAT_STREAM		0x0101
    426   1.7  augustss #define UAT_VENDOR		0x01ff
    427   1.7  augustss /* input terminal types */
    428   1.7  augustss #define UATI_UNDEFINED		0x0200
    429   1.7  augustss #define UATI_MICROPHONE		0x0201
    430   1.7  augustss #define UATI_DESKMICROPHONE	0x0202
    431   1.7  augustss #define UATI_PERSONALMICROPHONE	0x0203
    432   1.7  augustss #define UATI_OMNIMICROPHONE	0x0204
    433   1.7  augustss #define UATI_MICROPHONEARRAY	0x0205
    434   1.7  augustss #define UATI_PROCMICROPHONEARR	0x0206
    435   1.7  augustss /* output terminal types */
    436   1.7  augustss #define UATO_UNDEFINED		0x0300
    437   1.7  augustss #define UATO_SPEAKER		0x0301
    438   1.7  augustss #define UATO_HEADPHONES		0x0302
    439   1.7  augustss #define UATO_DISPLAYAUDIO	0x0303
    440   1.7  augustss #define UATO_DESKTOPSPEAKER	0x0304
    441   1.7  augustss #define UATO_ROOMSPEAKER	0x0305
    442   1.7  augustss #define UATO_COMMSPEAKER	0x0306
    443   1.7  augustss #define UATO_SUBWOOFER		0x0307
    444   1.7  augustss /* bidir terminal types */
    445   1.7  augustss #define UATB_UNDEFINED		0x0400
    446   1.7  augustss #define UATB_HANDSET		0x0401
    447   1.7  augustss #define UATB_HEADSET		0x0402
    448   1.7  augustss #define UATB_SPEAKERPHONE	0x0403
    449   1.7  augustss #define UATB_SPEAKERPHONEESUP	0x0404
    450   1.7  augustss #define UATB_SPEAKERPHONEECANC	0x0405
    451   1.7  augustss /* telephony terminal types */
    452   1.7  augustss #define UATT_UNDEFINED		0x0500
    453   1.7  augustss #define UATT_PHONELINE		0x0501
    454   1.7  augustss #define UATT_TELEPHONE		0x0502
    455   1.7  augustss #define UATT_DOWNLINEPHONE	0x0503
    456   1.7  augustss /* external terminal types */
    457   1.7  augustss #define UATE_UNDEFINED		0x0600
    458   1.7  augustss #define UATE_ANALOGCONN		0x0601
    459   1.7  augustss #define UATE_DIGITALAUIFC	0x0602
    460   1.7  augustss #define UATE_LINECONN		0x0603
    461   1.7  augustss #define UATE_LEGACYCONN		0x0604
    462   1.7  augustss #define UATE_SPDIF		0x0605
    463   1.7  augustss #define UATE_1394DA		0x0606
    464   1.7  augustss #define UATE_1394DV		0x0607
    465   1.7  augustss /* embedded function terminal types */
    466   1.7  augustss #define UATF_UNDEFINED		0x0700
    467   1.7  augustss #define UATF_CALIBNOISE		0x0701
    468   1.7  augustss #define UATF_EQUNOISE		0x0702
    469   1.7  augustss #define UATF_CDPLAYER		0x0703
    470   1.7  augustss #define UATF_DAT		0x0704
    471   1.7  augustss #define UATF_DCC		0x0705
    472   1.7  augustss #define UATF_MINIDISK		0x0706
    473   1.7  augustss #define UATF_ANALOGTAPE		0x0707
    474   1.7  augustss #define UATF_PHONOGRAPH		0x0708
    475   1.7  augustss #define UATF_VCRAUDIO		0x0709
    476   1.7  augustss #define UATF_VIDEODISCAUDIO	0x070a
    477   1.7  augustss #define UATF_DVDAUDIO		0x070b
    478   1.7  augustss #define UATF_TVTUNERAUDIO	0x070c
    479   1.7  augustss #define UATF_SATELLITE		0x070d
    480   1.7  augustss #define UATF_CABLETUNER		0x070e
    481   1.7  augustss #define UATF_DSS		0x070f
    482   1.7  augustss #define UATF_RADIORECV		0x0710
    483   1.7  augustss #define UATF_RADIOXMIT		0x0711
    484   1.7  augustss #define UATF_MULTITRACK		0x0712
    485   1.7  augustss #define UATF_SYNTHESIZER	0x0713
    486   1.7  augustss 
    487   1.1  augustss 
    488   1.1  augustss #define SET_CUR 0x01
    489   1.1  augustss #define GET_CUR 0x81
    490   1.1  augustss #define SET_MIN 0x02
    491   1.1  augustss #define GET_MIN 0x82
    492   1.1  augustss #define SET_MAX 0x03
    493   1.1  augustss #define GET_MAX 0x83
    494   1.1  augustss #define SET_RES 0x04
    495   1.1  augustss #define GET_RES 0x84
    496   1.1  augustss #define SET_MEM 0x05
    497   1.1  augustss #define GET_MEM 0x85
    498   1.1  augustss #define GET_STAT 0xff
    499  1.17   mlelstv #define V2_CUR        0x01
    500  1.17   mlelstv #define V2_RANGES     0x02
    501  1.17   mlelstv 
    502  1.17   mlelstv #define V2_CUR_CLKFREQ	0x01
    503  1.17   mlelstv #define V2_CUR_CLKSEL	0x01
    504  1.17   mlelstv 
    505   1.1  augustss 
    506   1.1  augustss #define MUTE_CONTROL	0x01
    507   1.1  augustss #define VOLUME_CONTROL	0x02
    508   1.1  augustss #define BASS_CONTROL	0x03
    509   1.1  augustss #define MID_CONTROL	0x04
    510   1.1  augustss #define TREBLE_CONTROL	0x05
    511   1.1  augustss #define GRAPHIC_EQUALIZER_CONTROL	0x06
    512   1.1  augustss #define AGC_CONTROL	0x07
    513   1.1  augustss #define DELAY_CONTROL	0x08
    514   1.1  augustss #define BASS_BOOST_CONTROL 0x09
    515   1.1  augustss #define LOUDNESS_CONTROL 0x0a
    516  1.17   mlelstv #define GAIN_CONTROL	0x0b
    517  1.17   mlelstv #define GAINPAD_CONTROL	0x0c
    518  1.17   mlelstv #define PHASEINV_CONTROL 0x0d
    519   1.1  augustss 
    520   1.1  augustss #define FU_MASK(u) (1 << ((u)-1))
    521   1.1  augustss 
    522   1.2  augustss #define MASTER_CHAN	0
    523   1.1  augustss 
    524   1.2  augustss #define AS_GENERAL	1
    525   1.2  augustss #define FORMAT_TYPE	2
    526   1.1  augustss #define FORMAT_SPECIFIC 3
    527   1.1  augustss 
    528   1.2  augustss #define UA_FMT_PCM	1
    529   1.2  augustss #define UA_FMT_PCM8	2
    530   1.2  augustss #define UA_FMT_IEEE_FLOAT 3
    531   1.2  augustss #define UA_FMT_ALAW	4
    532   1.2  augustss #define UA_FMT_MULAW	5
    533   1.8      kent #define UA_FMT_MPEG	0x1001
    534   1.8      kent #define UA_FMT_AC3	0x1002
    535   1.1  augustss 
    536  1.17   mlelstv #define UA_V2_FMT_PCM		0x01
    537  1.17   mlelstv #define UA_V2_FMT_PCM8		0x02
    538  1.17   mlelstv #define UA_V2_FMT_IEEE_FLOAT	0x04
    539  1.17   mlelstv #define UA_V2_FMT_ALAW		0x08
    540  1.17   mlelstv #define UA_V2_FMT_MULAW		0x10
    541  1.17   mlelstv 
    542   1.8      kent #define SAMPLING_FREQ_CONTROL	0x01
    543   1.8      kent #define PITCH_CONTROL		0x02
    544   1.2  augustss 
    545   1.2  augustss #define FORMAT_TYPE_UNDEFINED 0
    546   1.2  augustss #define FORMAT_TYPE_I 1
    547   1.2  augustss #define FORMAT_TYPE_II 2
    548   1.2  augustss #define FORMAT_TYPE_III 3
    549   1.3  augustss 
    550   1.4  augustss #define UA_PROC_MASK(n) (1<< ((n)-1))
    551   1.3  augustss #define PROCESS_UNDEFINED		0
    552   1.3  augustss #define  XX_ENABLE_CONTROL			1
    553   1.3  augustss #define UPDOWNMIX_PROCESS		1
    554   1.3  augustss #define  UD_ENABLE_CONTROL			1
    555   1.3  augustss #define  UD_MODE_SELECT_CONTROL			2
    556   1.3  augustss #define DOLBY_PROLOGIC_PROCESS		2
    557   1.3  augustss #define  DP_ENABLE_CONTROL			1
    558   1.3  augustss #define  DP_MODE_SELECT_CONTROL			2
    559   1.3  augustss #define P3D_STEREO_EXTENDER_PROCESS	3
    560   1.3  augustss #define  P3D_ENABLE_CONTROL			1
    561   1.3  augustss #define  P3D_SPACIOUSNESS_CONTROL		2
    562   1.3  augustss #define REVERBATION_PROCESS		4
    563   1.3  augustss #define  RV_ENABLE_CONTROL			1
    564   1.3  augustss #define  RV_LEVEL_CONTROL			2
    565   1.3  augustss #define  RV_TIME_CONTROL			3
    566   1.3  augustss #define  RV_FEEDBACK_CONTROL			4
    567   1.3  augustss #define CHORUS_PROCESS			5
    568   1.3  augustss #define  CH_ENABLE_CONTROL			1
    569   1.3  augustss #define  CH_LEVEL_CONTROL			2
    570   1.3  augustss #define  CH_RATE_CONTROL			3
    571   1.3  augustss #define  CH_DEPTH_CONTROL			4
    572   1.3  augustss #define DYN_RANGE_COMP_PROCESS		6
    573   1.3  augustss #define  DR_ENABLE_CONTROL			1
    574   1.3  augustss #define  DR_COMPRESSION_RATE_CONTROL		2
    575   1.3  augustss #define  DR_MAXAMPL_CONTROL			3
    576   1.3  augustss #define  DR_THRESHOLD_CONTROL			4
    577   1.3  augustss #define  DR_ATTACK_TIME_CONTROL			5
    578   1.3  augustss #define  DR_RELEASE_TIME_CONTROL		6
    579