134 #include <linux/module.h>
136 #include <linux/slab.h>
169 static void usX2Y_usb_disconnect(
struct usb_device* usb_device,
void*
ptr);
170 static void snd_usX2Y_card_private_free(
struct snd_card *
card);
175 static void i_usX2Y_Out04Int(
struct urb *
urb)
177 #ifdef CONFIG_SND_DEBUG
181 for (i = 0; i < 10 && usX2Y->
AS04.urb[
i] !=
urb; i++);
182 snd_printdd(
"i_usX2Y_Out04Int() urb %i status=%i\n", i, urb->status);
187 static void i_usX2Y_In04Int(
struct urb *urb)
196 snd_printdd(
"Interrupt Pipe 4 came back with status=%i\n", urb->status);
209 for (i = 0; i < 21; i++) {
230 if (0 == usX2Y->
US04->submitted)
233 }
while (!err && usX2Y->
US04->submitted < usX2Y->
US04->len);
241 if (0 == usX2Y->
AS04.urb[j]->status) {
243 usb_fill_bulk_urb(usX2Y->
AS04.urb[j], usX2Y->
dev,
244 usb_sndbulkpipe(usX2Y->
dev, 0x04), &p4out->
val.
vol,
246 i_usX2Y_Out04Int, usX2Y);
257 urb->dev = usX2Y->
dev;
277 usb_fill_bulk_urb( usX2Y->
AS04.urb[i], usX2Y->
dev,
278 usb_sndbulkpipe(usX2Y->
dev, 0x04),
280 i_usX2Y_Out04Int, usX2Y
297 usb_fill_int_urb(usX2Y->
In04urb, usX2Y->
dev, usb_rcvintpipe(usX2Y->
dev, 0x4),
299 i_usX2Y_In04Int, usX2Y,
320 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
325 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
330 .match_flags = USB_DEVICE_ID_MATCH_DEVICE,
337 static int usX2Y_create_card(
struct usb_device *
device,
struct snd_card **cardp)
344 if (
enable[dev] && !snd_usX2Y_card_used[dev])
346 if (dev >= SNDRV_CARDS)
352 snd_usX2Y_card_used[
usX2Y(card)->card_index =
dev] = 1;
354 usX2Y(card)->dev = device;
357 INIT_LIST_HEAD(&
usX2Y(card)->midi_list);
365 usX2Y(card)->dev->bus->busnum, usX2Y(card)->dev->devnum
372 static int usX2Y_usb_probe(
struct usb_device *device,
381 if (
le16_to_cpu(device->descriptor.idVendor) != 0x1604 ||
387 err = usX2Y_create_card(device, &card);
408 err = usX2Y_usb_probe(interface_to_usbdev(intf), intf,
id, &card);
417 usX2Y_usb_disconnect(interface_to_usbdev(intf),
418 usb_get_intfdata(intf));
422 static struct usb_driver snd_usX2Y_usb_driver = {
423 .name =
"snd-usb-usx2y",
424 .probe = snd_usX2Y_probe,
425 .disconnect = snd_usX2Y_disconnect,
426 .id_table = snd_usX2Y_usb_id_table,
429 static void snd_usX2Y_card_private_free(
struct snd_card *card)
435 if (
usX2Y(card)->card_index >= 0 &&
usX2Y(card)->card_index < SNDRV_CARDS)
436 snd_usX2Y_card_used[
usX2Y(card)->card_index] = 0;
442 static void usX2Y_usb_disconnect(
struct usb_device *device,
void*
ptr)
449 usX2Y_unlinkSeq(&usX2Y->
AS04);