diff options
Diffstat (limited to 'sound/usb/usbaudio.h')
-rw-r--r-- | sound/usb/usbaudio.h | 109 |
1 files changed, 19 insertions, 90 deletions
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index 40ba8115fb81..42c299cbf63a 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -21,93 +21,6 @@ | |||
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 | */ | 22 | */ |
23 | 23 | ||
24 | |||
25 | /* | ||
26 | */ | ||
27 | |||
28 | #define USB_SUBCLASS_AUDIO_CONTROL 0x01 | ||
29 | #define USB_SUBCLASS_AUDIO_STREAMING 0x02 | ||
30 | #define USB_SUBCLASS_MIDI_STREAMING 0x03 | ||
31 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
32 | |||
33 | #define HEADER 0x01 | ||
34 | #define INPUT_TERMINAL 0x02 | ||
35 | #define OUTPUT_TERMINAL 0x03 | ||
36 | #define MIXER_UNIT 0x04 | ||
37 | #define SELECTOR_UNIT 0x05 | ||
38 | #define FEATURE_UNIT 0x06 | ||
39 | #define PROCESSING_UNIT 0x07 | ||
40 | #define EXTENSION_UNIT 0x08 | ||
41 | |||
42 | #define AS_GENERAL 0x01 | ||
43 | #define FORMAT_TYPE 0x02 | ||
44 | #define FORMAT_SPECIFIC 0x03 | ||
45 | |||
46 | #define EP_GENERAL 0x01 | ||
47 | |||
48 | #define MS_GENERAL 0x01 | ||
49 | #define MIDI_IN_JACK 0x02 | ||
50 | #define MIDI_OUT_JACK 0x03 | ||
51 | |||
52 | /* endpoint attributes */ | ||
53 | #define EP_ATTR_MASK 0x0c | ||
54 | #define EP_ATTR_ASYNC 0x04 | ||
55 | #define EP_ATTR_ADAPTIVE 0x08 | ||
56 | #define EP_ATTR_SYNC 0x0c | ||
57 | |||
58 | /* cs endpoint attributes */ | ||
59 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
60 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
61 | #define EP_CS_ATTR_FILL_MAX 0x80 | ||
62 | |||
63 | /* Audio Class specific Request Codes */ | ||
64 | |||
65 | #define SET_CUR 0x01 | ||
66 | #define GET_CUR 0x81 | ||
67 | #define SET_MIN 0x02 | ||
68 | #define GET_MIN 0x82 | ||
69 | #define SET_MAX 0x03 | ||
70 | #define GET_MAX 0x83 | ||
71 | #define SET_RES 0x04 | ||
72 | #define GET_RES 0x84 | ||
73 | #define SET_MEM 0x05 | ||
74 | #define GET_MEM 0x85 | ||
75 | #define GET_STAT 0xff | ||
76 | |||
77 | /* Terminal Control Selectors */ | ||
78 | |||
79 | #define COPY_PROTECT_CONTROL 0x01 | ||
80 | |||
81 | /* Endpoint Control Selectors */ | ||
82 | |||
83 | #define SAMPLING_FREQ_CONTROL 0x01 | ||
84 | #define PITCH_CONTROL 0x02 | ||
85 | |||
86 | /* Format Types */ | ||
87 | #define USB_FORMAT_TYPE_I 0x01 | ||
88 | #define USB_FORMAT_TYPE_II 0x02 | ||
89 | #define USB_FORMAT_TYPE_III 0x03 | ||
90 | |||
91 | /* type I */ | ||
92 | #define USB_AUDIO_FORMAT_PCM 0x01 | ||
93 | #define USB_AUDIO_FORMAT_PCM8 0x02 | ||
94 | #define USB_AUDIO_FORMAT_IEEE_FLOAT 0x03 | ||
95 | #define USB_AUDIO_FORMAT_ALAW 0x04 | ||
96 | #define USB_AUDIO_FORMAT_MU_LAW 0x05 | ||
97 | |||
98 | /* type II */ | ||
99 | #define USB_AUDIO_FORMAT_MPEG 0x1001 | ||
100 | #define USB_AUDIO_FORMAT_AC3 0x1002 | ||
101 | |||
102 | /* type III */ | ||
103 | #define USB_AUDIO_FORMAT_IEC1937_AC3 0x2001 | ||
104 | #define USB_AUDIO_FORMAT_IEC1937_MPEG1_LAYER1 0x2002 | ||
105 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_NOEXT 0x2003 | ||
106 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_EXT 0x2004 | ||
107 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
108 | #define USB_AUDIO_FORMAT_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
109 | |||
110 | |||
111 | /* maximum number of endpoints per interface */ | 24 | /* maximum number of endpoints per interface */ |
112 | #define MIDI_MAX_ENDPOINTS 2 | 25 | #define MIDI_MAX_ENDPOINTS 2 |
113 | 26 | ||
@@ -125,9 +38,13 @@ struct snd_usb_audio { | |||
125 | struct snd_card *card; | 38 | struct snd_card *card; |
126 | u32 usb_id; | 39 | u32 usb_id; |
127 | int shutdown; | 40 | int shutdown; |
41 | unsigned int txfr_quirk:1; /* Subframe boundaries on transfers */ | ||
128 | int num_interfaces; | 42 | int num_interfaces; |
129 | int num_suspended_intf; | 43 | int num_suspended_intf; |
130 | 44 | ||
45 | /* for audio class v2 */ | ||
46 | int clock_id; | ||
47 | |||
131 | struct list_head pcm_list; /* list of pcm streams */ | 48 | struct list_head pcm_list; /* list of pcm streams */ |
132 | int pcm_devs; | 49 | int pcm_devs; |
133 | 50 | ||
@@ -158,9 +75,8 @@ enum quirk_type { | |||
158 | QUIRK_MIDI_US122L, | 75 | QUIRK_MIDI_US122L, |
159 | QUIRK_AUDIO_STANDARD_INTERFACE, | 76 | QUIRK_AUDIO_STANDARD_INTERFACE, |
160 | QUIRK_AUDIO_FIXED_ENDPOINT, | 77 | QUIRK_AUDIO_FIXED_ENDPOINT, |
161 | QUIRK_AUDIO_EDIROL_UA1000, | ||
162 | QUIRK_AUDIO_EDIROL_UA101, | ||
163 | QUIRK_AUDIO_EDIROL_UAXX, | 78 | QUIRK_AUDIO_EDIROL_UAXX, |
79 | QUIRK_AUDIO_ALIGN_TRANSFER, | ||
164 | 80 | ||
165 | QUIRK_TYPE_COUNT | 81 | QUIRK_TYPE_COUNT |
166 | }; | 82 | }; |
@@ -195,7 +111,7 @@ struct snd_usb_midi_endpoint_info { | |||
195 | 111 | ||
196 | /* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */ | 112 | /* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */ |
197 | 113 | ||
198 | /* for QUIRK_AUDIO_EDIROL_UA700_UA25/UA1000, data is NULL */ | 114 | /* for QUIRK_AUDIO_EDIROL_UAXX, data is NULL */ |
199 | 115 | ||
200 | /* for QUIRK_IGNORE_INTERFACE, data is NULL */ | 116 | /* for QUIRK_IGNORE_INTERFACE, data is NULL */ |
201 | 117 | ||
@@ -209,6 +125,16 @@ struct snd_usb_midi_endpoint_info { | |||
209 | /* | 125 | /* |
210 | */ | 126 | */ |
211 | 127 | ||
128 | /*E-mu USB samplerate control quirk*/ | ||
129 | enum { | ||
130 | EMU_QUIRK_SR_44100HZ = 0, | ||
131 | EMU_QUIRK_SR_48000HZ, | ||
132 | EMU_QUIRK_SR_88200HZ, | ||
133 | EMU_QUIRK_SR_96000HZ, | ||
134 | EMU_QUIRK_SR_176400HZ, | ||
135 | EMU_QUIRK_SR_192000HZ | ||
136 | }; | ||
137 | |||
212 | #define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8)) | 138 | #define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8)) |
213 | #define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) | 139 | #define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) |
214 | #define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) | 140 | #define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) |
@@ -234,6 +160,9 @@ void snd_usbmidi_input_stop(struct list_head* p); | |||
234 | void snd_usbmidi_input_start(struct list_head* p); | 160 | void snd_usbmidi_input_start(struct list_head* p); |
235 | void snd_usbmidi_disconnect(struct list_head *p); | 161 | void snd_usbmidi_disconnect(struct list_head *p); |
236 | 162 | ||
163 | void snd_emuusb_set_samplerate(struct snd_usb_audio *chip, | ||
164 | unsigned char samplerate_id); | ||
165 | |||
237 | /* | 166 | /* |
238 | * retrieve usb_interface descriptor from the host interface | 167 | * retrieve usb_interface descriptor from the host interface |
239 | * (conditional for compatibility with the older API) | 168 | * (conditional for compatibility with the older API) |