aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/usbaudio.h')
-rw-r--r--sound/usb/usbaudio.h94
1 files changed, 5 insertions, 89 deletions
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 6b016d4aac6b..d679e72a3e5c 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -21,15 +21,13 @@
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/* maximum number of endpoints per interface */
25#define MIDI_MAX_ENDPOINTS 2
26
27/* handling of USB vendor/product ID pairs as 32-bit numbers */ 24/* handling of USB vendor/product ID pairs as 32-bit numbers */
28#define USB_ID(vendor, product) (((vendor) << 16) | (product)) 25#define USB_ID(vendor, product) (((vendor) << 16) | (product))
29#define USB_ID_VENDOR(id) ((id) >> 16) 26#define USB_ID_VENDOR(id) ((id) >> 16)
30#define USB_ID_PRODUCT(id) ((u16)(id)) 27#define USB_ID_PRODUCT(id) ((u16)(id))
31 28
32/* 29/*
30 *
33 */ 31 */
34 32
35struct snd_usb_audio { 33struct snd_usb_audio {
@@ -51,6 +49,10 @@ struct snd_usb_audio {
51 struct list_head midi_list; /* list of midi interfaces */ 49 struct list_head midi_list; /* list of midi interfaces */
52 50
53 struct list_head mixer_list; /* list of mixer interfaces */ 51 struct list_head mixer_list; /* list of mixer interfaces */
52
53 int setup; /* from the 'device_setup' module param */
54 int nrpacks; /* from the 'nrpacks' module param */
55 int async_unlink; /* from the 'async_unlink' module param */
54}; 56};
55 57
56/* 58/*
@@ -75,7 +77,6 @@ enum quirk_type {
75 QUIRK_MIDI_US122L, 77 QUIRK_MIDI_US122L,
76 QUIRK_AUDIO_STANDARD_INTERFACE, 78 QUIRK_AUDIO_STANDARD_INTERFACE,
77 QUIRK_AUDIO_FIXED_ENDPOINT, 79 QUIRK_AUDIO_FIXED_ENDPOINT,
78 QUIRK_AUDIO_EDIROL_UA1000,
79 QUIRK_AUDIO_EDIROL_UAXX, 80 QUIRK_AUDIO_EDIROL_UAXX,
80 QUIRK_AUDIO_ALIGN_TRANSFER, 81 QUIRK_AUDIO_ALIGN_TRANSFER,
81 82
@@ -90,93 +91,8 @@ struct snd_usb_audio_quirk {
90 const void *data; 91 const void *data;
91}; 92};
92 93
93/* data for QUIRK_MIDI_FIXED_ENDPOINT */
94struct snd_usb_midi_endpoint_info {
95 int8_t out_ep; /* ep number, 0 autodetect */
96 uint8_t out_interval; /* interval for interrupt endpoints */
97 int8_t in_ep;
98 uint8_t in_interval;
99 uint16_t out_cables; /* bitmask */
100 uint16_t in_cables; /* bitmask */
101};
102
103/* for QUIRK_MIDI_YAMAHA, data is NULL */
104
105/* for QUIRK_MIDI_MIDIMAN, data points to a snd_usb_midi_endpoint_info
106 * structure (out_cables and in_cables only) */
107
108/* for QUIRK_COMPOSITE, data points to an array of snd_usb_audio_quirk
109 * structures, terminated with .ifnum = -1 */
110
111/* for QUIRK_AUDIO_FIXED_ENDPOINT, data points to an audioformat structure */
112
113/* for QUIRK_AUDIO/MIDI_STANDARD_INTERFACE, data is NULL */
114
115/* for QUIRK_AUDIO_EDIROL_UA700_UA25/UA1000, data is NULL */
116
117/* for QUIRK_IGNORE_INTERFACE, data is NULL */
118
119/* for QUIRK_MIDI_NOVATION and _RAW, data is NULL */
120
121/* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info
122 * structure (out_cables and in_cables only) */
123
124/* for QUIRK_MIDI_CME, data is NULL */
125
126/*
127 */
128
129/*E-mu USB samplerate control quirk*/
130enum {
131 EMU_QUIRK_SR_44100HZ = 0,
132 EMU_QUIRK_SR_48000HZ,
133 EMU_QUIRK_SR_88200HZ,
134 EMU_QUIRK_SR_96000HZ,
135 EMU_QUIRK_SR_176400HZ,
136 EMU_QUIRK_SR_192000HZ
137};
138
139#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8)) 94#define combine_word(s) ((*(s)) | ((unsigned int)(s)[1] << 8))
140#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16)) 95#define combine_triple(s) (combine_word(s) | ((unsigned int)(s)[2] << 16))
141#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24)) 96#define combine_quad(s) (combine_triple(s) | ((unsigned int)(s)[3] << 24))
142 97
143unsigned int snd_usb_combine_bytes(unsigned char *bytes, int size);
144
145void *snd_usb_find_desc(void *descstart, int desclen, void *after, u8 dtype);
146void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsubtype);
147
148int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe,
149 __u8 request, __u8 requesttype, __u16 value, __u16 index,
150 void *data, __u16 size, int timeout);
151
152int snd_usb_create_mixer(struct snd_usb_audio *chip, int ctrlif,
153 int ignore_error);
154void snd_usb_mixer_disconnect(struct list_head *p);
155
156int snd_usbmidi_create(struct snd_card *card,
157 struct usb_interface *iface,
158 struct list_head *midi_list,
159 const struct snd_usb_audio_quirk *quirk);
160void snd_usbmidi_input_stop(struct list_head* p);
161void snd_usbmidi_input_start(struct list_head* p);
162void snd_usbmidi_disconnect(struct list_head *p);
163
164void snd_emuusb_set_samplerate(struct snd_usb_audio *chip,
165 unsigned char samplerate_id);
166
167/*
168 * retrieve usb_interface descriptor from the host interface
169 * (conditional for compatibility with the older API)
170 */
171#ifndef get_iface_desc
172#define get_iface_desc(iface) (&(iface)->desc)
173#define get_endpoint(alt,ep) (&(alt)->endpoint[ep].desc)
174#define get_ep_desc(ep) (&(ep)->desc)
175#define get_cfg_desc(cfg) (&(cfg)->desc)
176#endif
177
178#ifndef snd_usb_get_speed
179#define snd_usb_get_speed(dev) ((dev)->speed)
180#endif
181
182#endif /* __USBAUDIO_H */ 98#endif /* __USBAUDIO_H */