diff options
Diffstat (limited to 'sound/usb/usbaudio.h')
-rw-r--r-- | sound/usb/usbaudio.h | 49 |
1 files changed, 31 insertions, 18 deletions
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h index eecbf19fcb6f..ad9eab211d8f 100644 --- a/sound/usb/usbaudio.h +++ b/sound/usb/usbaudio.h | |||
@@ -118,6 +118,11 @@ | |||
118 | /* maximum number of endpoints per interface */ | 118 | /* maximum number of endpoints per interface */ |
119 | #define MIDI_MAX_ENDPOINTS 2 | 119 | #define MIDI_MAX_ENDPOINTS 2 |
120 | 120 | ||
121 | /* handling of USB vendor/product ID pairs as 32-bit numbers */ | ||
122 | #define USB_ID(vendor, product) (((vendor) << 16) | (product)) | ||
123 | #define USB_ID_VENDOR(id) ((id) >> 16) | ||
124 | #define USB_ID_PRODUCT(id) ((u16)(id)) | ||
125 | |||
121 | /* | 126 | /* |
122 | */ | 127 | */ |
123 | 128 | ||
@@ -127,6 +132,7 @@ struct snd_usb_audio { | |||
127 | int index; | 132 | int index; |
128 | struct usb_device *dev; | 133 | struct usb_device *dev; |
129 | snd_card_t *card; | 134 | snd_card_t *card; |
135 | u32 usb_id; | ||
130 | int shutdown; | 136 | int shutdown; |
131 | int num_interfaces; | 137 | int num_interfaces; |
132 | 138 | ||
@@ -136,7 +142,7 @@ struct snd_usb_audio { | |||
136 | struct list_head midi_list; /* list of midi interfaces */ | 142 | struct list_head midi_list; /* list of midi interfaces */ |
137 | int next_midi_device; | 143 | int next_midi_device; |
138 | 144 | ||
139 | unsigned int ignore_ctl_error; /* for mixer */ | 145 | struct list_head mixer_list; /* list of mixer interfaces */ |
140 | }; | 146 | }; |
141 | 147 | ||
142 | /* | 148 | /* |
@@ -147,20 +153,24 @@ struct snd_usb_audio { | |||
147 | #define QUIRK_NO_INTERFACE -2 | 153 | #define QUIRK_NO_INTERFACE -2 |
148 | #define QUIRK_ANY_INTERFACE -1 | 154 | #define QUIRK_ANY_INTERFACE -1 |
149 | 155 | ||
150 | /* quirk type */ | 156 | enum quirk_type { |
151 | #define QUIRK_MIDI_FIXED_ENDPOINT 0 | 157 | QUIRK_IGNORE_INTERFACE, |
152 | #define QUIRK_MIDI_YAMAHA 1 | 158 | QUIRK_COMPOSITE, |
153 | #define QUIRK_MIDI_MIDIMAN 2 | 159 | QUIRK_MIDI_STANDARD_INTERFACE, |
154 | #define QUIRK_COMPOSITE 3 | 160 | QUIRK_MIDI_FIXED_ENDPOINT, |
155 | #define QUIRK_AUDIO_FIXED_ENDPOINT 4 | 161 | QUIRK_MIDI_YAMAHA, |
156 | #define QUIRK_AUDIO_STANDARD_INTERFACE 5 | 162 | QUIRK_MIDI_MIDIMAN, |
157 | #define QUIRK_MIDI_STANDARD_INTERFACE 6 | 163 | QUIRK_MIDI_NOVATION, |
158 | #define QUIRK_AUDIO_EDIROL_UA700_UA25 7 | 164 | QUIRK_MIDI_RAW, |
159 | #define QUIRK_AUDIO_EDIROL_UA1000 8 | 165 | QUIRK_MIDI_EMAGIC, |
160 | #define QUIRK_IGNORE_INTERFACE 9 | 166 | QUIRK_MIDI_MIDITECH, |
161 | #define QUIRK_MIDI_NOVATION 10 | 167 | QUIRK_AUDIO_STANDARD_INTERFACE, |
162 | #define QUIRK_MIDI_MOTU 11 | 168 | QUIRK_AUDIO_FIXED_ENDPOINT, |
163 | #define QUIRK_MIDI_EMAGIC 12 | 169 | QUIRK_AUDIO_EDIROL_UA700_UA25, |
170 | QUIRK_AUDIO_EDIROL_UA1000, | ||
171 | |||
172 | QUIRK_TYPE_COUNT | ||
173 | }; | ||
164 | 174 | ||
165 | typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t; | 175 | typedef struct snd_usb_audio_quirk snd_usb_audio_quirk_t; |
166 | typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t; | 176 | typedef struct snd_usb_midi_endpoint_info snd_usb_midi_endpoint_info_t; |
@@ -169,7 +179,7 @@ struct snd_usb_audio_quirk { | |||
169 | const char *vendor_name; | 179 | const char *vendor_name; |
170 | const char *product_name; | 180 | const char *product_name; |
171 | int16_t ifnum; | 181 | int16_t ifnum; |
172 | int16_t type; | 182 | uint16_t type; |
173 | const void *data; | 183 | const void *data; |
174 | }; | 184 | }; |
175 | 185 | ||
@@ -199,11 +209,13 @@ struct snd_usb_midi_endpoint_info { | |||
199 | 209 | ||
200 | /* for QUIRK_IGNORE_INTERFACE, data is NULL */ | 210 | /* for QUIRK_IGNORE_INTERFACE, data is NULL */ |
201 | 211 | ||
202 | /* for QUIRK_MIDI_NOVATION and _MOTU, data is NULL */ | 212 | /* for QUIRK_MIDI_NOVATION and _RAW, data is NULL */ |
203 | 213 | ||
204 | /* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info | 214 | /* for QUIRK_MIDI_EMAGIC, data points to a snd_usb_midi_endpoint_info |
205 | * structure (out_cables and in_cables only) */ | 215 | * structure (out_cables and in_cables only) */ |
206 | 216 | ||
217 | /* for QUIRK_MIDI_MIDITECH, data is NULL */ | ||
218 | |||
207 | /* | 219 | /* |
208 | */ | 220 | */ |
209 | 221 | ||
@@ -219,11 +231,12 @@ void *snd_usb_find_csint_desc(void *descstart, int desclen, void *after, u8 dsub | |||
219 | int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout); | 231 | int snd_usb_ctl_msg(struct usb_device *dev, unsigned int pipe, __u8 request, __u8 requesttype, __u16 value, __u16 index, void *data, __u16 size, int timeout); |
220 | 232 | ||
221 | int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif); | 233 | int snd_usb_create_mixer(snd_usb_audio_t *chip, int ctrlif); |
234 | void snd_usb_mixer_disconnect(struct list_head *p); | ||
222 | 235 | ||
223 | int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk); | 236 | int snd_usb_create_midi_interface(snd_usb_audio_t *chip, struct usb_interface *iface, const snd_usb_audio_quirk_t *quirk); |
224 | void snd_usbmidi_input_stop(struct list_head* p); | 237 | void snd_usbmidi_input_stop(struct list_head* p); |
225 | void snd_usbmidi_input_start(struct list_head* p); | 238 | void snd_usbmidi_input_start(struct list_head* p); |
226 | void snd_usbmidi_disconnect(struct list_head *p, struct usb_driver *driver); | 239 | void snd_usbmidi_disconnect(struct list_head *p); |
227 | 240 | ||
228 | /* | 241 | /* |
229 | * retrieve usb_interface descriptor from the host interface | 242 | * retrieve usb_interface descriptor from the host interface |