diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /sound/usb/usx2y/usbusx2y.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'sound/usb/usx2y/usbusx2y.c')
-rw-r--r-- | sound/usb/usx2y/usbusx2y.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sound/usb/usx2y/usbusx2y.c b/sound/usb/usx2y/usbusx2y.c index cb4bb8373ca2..cbd37f2c76d0 100644 --- a/sound/usb/usx2y/usbusx2y.c +++ b/sound/usb/usx2y/usbusx2y.c | |||
@@ -133,6 +133,7 @@ | |||
133 | #include <linux/init.h> | 133 | #include <linux/init.h> |
134 | #include <linux/module.h> | 134 | #include <linux/module.h> |
135 | #include <linux/moduleparam.h> | 135 | #include <linux/moduleparam.h> |
136 | #include <linux/slab.h> | ||
136 | #include <linux/interrupt.h> | 137 | #include <linux/interrupt.h> |
137 | #include <linux/usb.h> | 138 | #include <linux/usb.h> |
138 | #include <sound/core.h> | 139 | #include <sound/core.h> |
@@ -239,8 +240,8 @@ static void i_usX2Y_In04Int(struct urb *urb) | |||
239 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) | 240 | for (j = 0; j < URBS_AsyncSeq && !err; ++j) |
240 | if (0 == usX2Y->AS04.urb[j]->status) { | 241 | if (0 == usX2Y->AS04.urb[j]->status) { |
241 | struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more than 1 p4out is new, 1 gets lost. | 242 | struct us428_p4out *p4out = us428ctls->p4out + send; // FIXME if more than 1 p4out is new, 1 gets lost. |
242 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->chip.dev, | 243 | usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->dev, |
243 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), &p4out->val.vol, | 244 | usb_sndbulkpipe(usX2Y->dev, 0x04), &p4out->val.vol, |
244 | p4out->type == eLT_Light ? sizeof(struct us428_lights) : 5, | 245 | p4out->type == eLT_Light ? sizeof(struct us428_lights) : 5, |
245 | i_usX2Y_Out04Int, usX2Y); | 246 | i_usX2Y_Out04Int, usX2Y); |
246 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); | 247 | err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); |
@@ -253,7 +254,7 @@ static void i_usX2Y_In04Int(struct urb *urb) | |||
253 | if (err) | 254 | if (err) |
254 | snd_printk(KERN_ERR "In04Int() usb_submit_urb err=%i\n", err); | 255 | snd_printk(KERN_ERR "In04Int() usb_submit_urb err=%i\n", err); |
255 | 256 | ||
256 | urb->dev = usX2Y->chip.dev; | 257 | urb->dev = usX2Y->dev; |
257 | usb_submit_urb(urb, GFP_ATOMIC); | 258 | usb_submit_urb(urb, GFP_ATOMIC); |
258 | } | 259 | } |
259 | 260 | ||
@@ -273,8 +274,8 @@ int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y) | |||
273 | err = -ENOMEM; | 274 | err = -ENOMEM; |
274 | break; | 275 | break; |
275 | } | 276 | } |
276 | usb_fill_bulk_urb( usX2Y->AS04.urb[i], usX2Y->chip.dev, | 277 | usb_fill_bulk_urb( usX2Y->AS04.urb[i], usX2Y->dev, |
277 | usb_sndbulkpipe(usX2Y->chip.dev, 0x04), | 278 | usb_sndbulkpipe(usX2Y->dev, 0x04), |
278 | usX2Y->AS04.buffer + URB_DataLen_AsyncSeq*i, 0, | 279 | usX2Y->AS04.buffer + URB_DataLen_AsyncSeq*i, 0, |
279 | i_usX2Y_Out04Int, usX2Y | 280 | i_usX2Y_Out04Int, usX2Y |
280 | ); | 281 | ); |
@@ -293,7 +294,7 @@ int usX2Y_In04_init(struct usX2Ydev *usX2Y) | |||
293 | } | 294 | } |
294 | 295 | ||
295 | init_waitqueue_head(&usX2Y->In04WaitQueue); | 296 | init_waitqueue_head(&usX2Y->In04WaitQueue); |
296 | usb_fill_int_urb(usX2Y->In04urb, usX2Y->chip.dev, usb_rcvintpipe(usX2Y->chip.dev, 0x4), | 297 | usb_fill_int_urb(usX2Y->In04urb, usX2Y->dev, usb_rcvintpipe(usX2Y->dev, 0x4), |
297 | usX2Y->In04Buf, 21, | 298 | usX2Y->In04Buf, 21, |
298 | i_usX2Y_In04Int, usX2Y, | 299 | i_usX2Y_In04Int, usX2Y, |
299 | 10); | 300 | 10); |
@@ -348,13 +349,12 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp) | |||
348 | sizeof(struct usX2Ydev), &card); | 349 | sizeof(struct usX2Ydev), &card); |
349 | if (err < 0) | 350 | if (err < 0) |
350 | return err; | 351 | return err; |
351 | snd_usX2Y_card_used[usX2Y(card)->chip.index = dev] = 1; | 352 | snd_usX2Y_card_used[usX2Y(card)->card_index = dev] = 1; |
352 | card->private_free = snd_usX2Y_card_private_free; | 353 | card->private_free = snd_usX2Y_card_private_free; |
353 | usX2Y(card)->chip.dev = device; | 354 | usX2Y(card)->dev = device; |
354 | usX2Y(card)->chip.card = card; | ||
355 | init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); | 355 | init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); |
356 | mutex_init(&usX2Y(card)->prepare_mutex); | 356 | mutex_init(&usX2Y(card)->prepare_mutex); |
357 | INIT_LIST_HEAD(&usX2Y(card)->chip.midi_list); | 357 | INIT_LIST_HEAD(&usX2Y(card)->midi_list); |
358 | strcpy(card->driver, "USB "NAME_ALLCAPS""); | 358 | strcpy(card->driver, "USB "NAME_ALLCAPS""); |
359 | sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); | 359 | sprintf(card->shortname, "TASCAM "NAME_ALLCAPS""); |
360 | sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", | 360 | sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)", |
@@ -362,7 +362,7 @@ static int usX2Y_create_card(struct usb_device *device, struct snd_card **cardp) | |||
362 | le16_to_cpu(device->descriptor.idVendor), | 362 | le16_to_cpu(device->descriptor.idVendor), |
363 | le16_to_cpu(device->descriptor.idProduct), | 363 | le16_to_cpu(device->descriptor.idProduct), |
364 | 0,//us428(card)->usbmidi.ifnum, | 364 | 0,//us428(card)->usbmidi.ifnum, |
365 | usX2Y(card)->chip.dev->bus->busnum, usX2Y(card)->chip.dev->devnum | 365 | usX2Y(card)->dev->bus->busnum, usX2Y(card)->dev->devnum |
366 | ); | 366 | ); |
367 | *cardp = card; | 367 | *cardp = card; |
368 | return 0; | 368 | return 0; |
@@ -432,8 +432,8 @@ static void snd_usX2Y_card_private_free(struct snd_card *card) | |||
432 | usb_free_urb(usX2Y(card)->In04urb); | 432 | usb_free_urb(usX2Y(card)->In04urb); |
433 | if (usX2Y(card)->us428ctls_sharedmem) | 433 | if (usX2Y(card)->us428ctls_sharedmem) |
434 | snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); | 434 | snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); |
435 | if (usX2Y(card)->chip.index >= 0 && usX2Y(card)->chip.index < SNDRV_CARDS) | 435 | if (usX2Y(card)->card_index >= 0 && usX2Y(card)->card_index < SNDRV_CARDS) |
436 | snd_usX2Y_card_used[usX2Y(card)->chip.index] = 0; | 436 | snd_usX2Y_card_used[usX2Y(card)->card_index] = 0; |
437 | } | 437 | } |
438 | 438 | ||
439 | /* | 439 | /* |
@@ -445,13 +445,12 @@ static void usX2Y_usb_disconnect(struct usb_device *device, void* ptr) | |||
445 | struct snd_card *card = ptr; | 445 | struct snd_card *card = ptr; |
446 | struct usX2Ydev *usX2Y = usX2Y(card); | 446 | struct usX2Ydev *usX2Y = usX2Y(card); |
447 | struct list_head *p; | 447 | struct list_head *p; |
448 | usX2Y->chip.shutdown = 1; | ||
449 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; | 448 | usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; |
450 | usX2Y_unlinkSeq(&usX2Y->AS04); | 449 | usX2Y_unlinkSeq(&usX2Y->AS04); |
451 | usb_kill_urb(usX2Y->In04urb); | 450 | usb_kill_urb(usX2Y->In04urb); |
452 | snd_card_disconnect(card); | 451 | snd_card_disconnect(card); |
453 | /* release the midi resources */ | 452 | /* release the midi resources */ |
454 | list_for_each(p, &usX2Y->chip.midi_list) { | 453 | list_for_each(p, &usX2Y->midi_list) { |
455 | snd_usbmidi_disconnect(p); | 454 | snd_usbmidi_disconnect(p); |
456 | } | 455 | } |
457 | if (usX2Y->us428ctls_sharedmem) | 456 | if (usX2Y->us428ctls_sharedmem) |