X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fusb%2Fusx2y%2Fusbusx2y.c;h=b06a267e5dac22d5350942cdfa2cfcfdb74c62b2;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=44a73816ff190e36f00626e6156e675f6acaa4cc;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index 44a73816f..b06a267e5 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c @@ -1,6 +1,34 @@ /* - * usbus428.c - ALSA USB US-428 Driver + * usbusy2y.c - ALSA USB US-428 Driver * +2004-12-14 Karsten Wiese + Version 0.8.7.1: + snd_pcm_open for rawusb pcm-devices now returns -EBUSY if called without rawusb's hwdep device being open. + +2004-12-02 Karsten Wiese + Version 0.8.7: + Use macro usb_maxpacket() for portability. + +2004-10-26 Karsten Wiese + Version 0.8.6: + wake_up() process waiting in usX2Y_urbs_start() on error. + +2004-10-21 Karsten Wiese + Version 0.8.5: + nrpacks is runtime or compiletime configurable now with tested values from 1 to 4. + +2004-10-03 Karsten Wiese + Version 0.8.2: + Avoid any possible racing while in prepare callback. + +2004-09-30 Karsten Wiese + Version 0.8.0: + Simplified things and made ohci work again. + +2004-09-20 Karsten Wiese + Version 0.7.3: + Use usb_kill_urb() instead of deprecated (kernel 2.6.9) usb_unlink_urb(). + 2004-07-13 Karsten Wiese Version 0.7.1: Don't sleep in START/STOP callbacks anymore. @@ -80,7 +108,7 @@ Version 0.0.2: midi works with snd-usb-midi, audio (only fullduplex now) with i.e. bristol. The firmware has been sniffed from win2k us-428 driver 3.09. - * Copyright (c) 2002 Karsten Wiese + * Copyright (c) 2002 - 2004 Karsten Wiese * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -115,20 +143,19 @@ MODULE_AUTHOR("Karsten Wiese "); -MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.7.2"); +MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.8.7.1"); MODULE_LICENSE("GPL"); MODULE_SUPPORTED_DEVICE("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001)(0x8005)(0x8007) }}"); static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-max */ static char* id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* Id for this card */ static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ -static int boot_devs; -module_param_array(index, int, boot_devs, 0444); +module_param_array(index, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for "NAME_ALLCAPS"."); -module_param_array(id, charp, boot_devs, 0444); +module_param_array(id, charp, NULL, 0444); MODULE_PARM_DESC(id, "ID string for "NAME_ALLCAPS"."); -module_param_array(enable, bool, boot_devs, 0444); +module_param_array(enable, bool, NULL, 0444); MODULE_PARM_DESC(enable, "Enable "NAME_ALLCAPS"."); @@ -277,13 +304,12 @@ static void usX2Y_unlinkSeq(snd_usX2Y_AsyncSeq_t* S) int i; for (i = 0; i < URBS_AsyncSeq; ++i) { if (S[i].urb) { - usb_unlink_urb(S->urb[i]); + usb_kill_urb(S->urb[i]); usb_free_urb(S->urb[i]); S->urb[i] = NULL; } } - if (S->buffer) - kfree(S->buffer); + kfree(S->buffer); } @@ -322,13 +348,15 @@ static snd_card_t* usX2Y_create_card(struct usb_device* device) card->private_free = snd_usX2Y_card_private_free; usX2Y(card)->chip.dev = device; usX2Y(card)->chip.card = card; - init_MUTEX (&usX2Y(card)->open_mutex); + init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); + init_MUTEX (&usX2Y(card)->prepare_mutex); INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list); strcpy(card->driver, "USB "NAME_ALLCAPS""); sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", card->shortname, - device->descriptor.idVendor, device->descriptor.idProduct, + le16_to_cpu(device->descriptor.idVendor), + le16_to_cpu(device->descriptor.idProduct), 0,//us428(card)->usbmidi.ifnum, usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum ); @@ -341,10 +369,10 @@ static void* usX2Y_usb_probe(struct usb_device* device, struct usb_interface *in { int err; snd_card_t* card; - if (device->descriptor.idVendor != 0x1604 || - (device->descriptor.idProduct != USB_ID_US122 && - device->descriptor.idProduct != USB_ID_US224 && - device->descriptor.idProduct != USB_ID_US428) || + if (le16_to_cpu(device->descriptor.idVendor) != 0x1604 || + (le16_to_cpu(device->descriptor.idProduct) != USB_ID_US122 && + le16_to_cpu(device->descriptor.idProduct) != USB_ID_US224 && + le16_to_cpu(device->descriptor.idProduct) != USB_ID_US428) || !(card = usX2Y_create_card(device))) return NULL; if ((err = usX2Y_hwdep_new(card, device)) < 0 || @@ -386,8 +414,7 @@ static struct usb_driver snd_usX2Y_usb_driver = { static void snd_usX2Y_card_private_free(snd_card_t *card) { - if (usX2Y(card)->In04Buf) - kfree(usX2Y(card)->In04Buf); + kfree(usX2Y(card)->In04Buf); usb_free_urb(usX2Y(card)->In04urb); if (usX2Y(card)->us428ctls_sharedmem) snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); @@ -408,7 +435,7 @@ static void usX2Y_usb_disconnect(struct usb_device* device, void* ptr) usX2Y->chip.shutdown = 1; usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; usX2Y_unlinkSeq(&usX2Y->AS04); - usb_unlink_urb(usX2Y->In04urb); + usb_kill_urb(usX2Y->In04urb); snd_card_disconnect((snd_card_t*)ptr); /* release the midi resources */ list_for_each(p, &usX2Y->chip.midi_list) {