Skip to content

Commit

Permalink
ALSA: usbaudio: consolidate header files
Browse files Browse the repository at this point in the history
Use the definitions from linux/usb/audio.h all over the ALSA USB audio
driver and add some missing definitions there as well.

Use the endpoint attribute macros from linux/usb/ch9 and remove the own
things from sound/usb/usbaudio.h.

Now things are also nicely prefixed which makes understanding the code
easier.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Daniel Mack authored and Takashi Iwai committed Feb 23, 2010
1 parent 7b8a043 commit de48c7b
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 218 deletions.
31 changes: 29 additions & 2 deletions include/linux/usb/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,17 @@
#define UAC_MIXER_UNIT 0x04
#define UAC_SELECTOR_UNIT 0x05
#define UAC_FEATURE_UNIT 0x06
#define UAC_PROCESSING_UNIT 0x07
#define UAC_EXTENSION_UNIT 0x08
#define UAC_PROCESSING_UNIT_V1 0x07
#define UAC_EXTENSION_UNIT_V1 0x08

/* UAC v2.0 types */
#define UAC_EFFECT_UNIT 0x07
#define UAC_PROCESSING_UNIT_V2 0x08
#define UAC_EXTENSION_UNIT_V2 0x09
#define UAC_CLOCK_SOURCE 0x0a
#define UAC_CLOCK_SELECTOR 0x0b
#define UAC_CLOCK_MULTIPLIER 0x0c
#define UAC_SAMPLE_RATE_CONVERTER 0x0d

/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
#define UAC_AS_GENERAL 0x01
Expand Down Expand Up @@ -69,6 +78,10 @@

#define UAC_GET_STAT 0xff

/* Audio class v2.0 handles all the parameter calls differently */
#define UAC2_CS_CUR 0x01
#define UAC2_CS_RANGE 0x02

/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
#define UAC_MS_HEADER 0x01
#define UAC_MIDI_IN_JACK 0x02
Expand Down Expand Up @@ -133,6 +146,10 @@ struct uac_input_terminal_descriptor {
#define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205
#define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206

/* Terminals - control selectors */

#define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01

/* 4.3.2.2 Output Terminal Descriptor */
struct uac_output_terminal_descriptor_v1 {
__u8 bLength; /* in bytes: 9 */
Expand Down Expand Up @@ -263,6 +280,9 @@ struct uac_format_type_i_ext_descriptor {

/* Formats - Audio Data Format Type I Codes */

#define UAC_FORMAT_TYPE_II_MPEG 0x1001
#define UAC_FORMAT_TYPE_II_AC3 0x1002

struct uac_format_type_ii_discrete_descriptor {
__u8 bLength;
__u8 bDescriptorType;
Expand All @@ -285,6 +305,13 @@ struct uac_format_type_ii_ext_descriptor {
__u8 bSideBandProtocol;
} __attribute__((packed));

/* type III */
#define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001
#define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002
#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003
#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004
#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005
#define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006

/* Formats - A.2 Format Type Codes */
#define UAC_FORMAT_TYPE_UNDEFINED 0x0
Expand Down
Loading

0 comments on commit de48c7b

Please sign in to comment.