/linux-4.4.14/sound/usb/usx2y/ |
H A D | usbusx2y.c | 50 "All pcm substreams of one usX2Y have to operate at the same rate & format." 180 struct usX2Ydev *usX2Y = urb->context; i_usX2Y_Out04Int() local 181 for (i = 0; i < 10 && usX2Y->AS04.urb[i] != urb; i++); i_usX2Y_Out04Int() 190 struct usX2Ydev *usX2Y = urb->context; i_usX2Y_In04Int() local 191 struct us428ctls_sharedmem *us428ctls = usX2Y->us428ctls_sharedmem; i_usX2Y_In04Int() 193 usX2Y->In04IntCalls++; i_usX2Y_In04Int() 200 // printk("%i:0x%02X ", 8, (int)((unsigned char*)usX2Y->In04Buf)[8]); Master volume shows 0 here if fader is at max during boot ?!? i_usX2Y_In04Int() 205 memcpy(usX2Y->In04Last, usX2Y->In04Buf, sizeof(usX2Y->In04Last)); i_usX2Y_In04Int() 210 if (usX2Y->In04Last[i] != ((char*)usX2Y->In04Buf)[i]) { i_usX2Y_In04Int() 213 usX2Y->In04Last[i] = ((char*)usX2Y->In04Buf)[i]; i_usX2Y_In04Int() 221 memcpy(us428ctls->CtlSnapShot + n, usX2Y->In04Buf, sizeof(us428ctls->CtlSnapShot[0])); i_usX2Y_In04Int() 224 wake_up(&usX2Y->us428ctls_wait_queue_head); i_usX2Y_In04Int() 229 if (usX2Y->US04) { i_usX2Y_In04Int() 230 if (0 == usX2Y->US04->submitted) i_usX2Y_In04Int() 232 err = usb_submit_urb(usX2Y->US04->urb[usX2Y->US04->submitted++], GFP_ATOMIC); i_usX2Y_In04Int() 233 } while (!err && usX2Y->US04->submitted < usX2Y->US04->len); i_usX2Y_In04Int() 241 if (0 == usX2Y->AS04.urb[j]->status) { i_usX2Y_In04Int() 243 usb_fill_bulk_urb(usX2Y->AS04.urb[j], usX2Y->dev, i_usX2Y_In04Int() 244 usb_sndbulkpipe(usX2Y->dev, 0x04), &p4out->val.vol, i_usX2Y_In04Int() 246 i_usX2Y_Out04Int, usX2Y); i_usX2Y_In04Int() 247 err = usb_submit_urb(usX2Y->AS04.urb[j], GFP_ATOMIC); i_usX2Y_In04Int() 257 urb->dev = usX2Y->dev; i_usX2Y_In04Int() 264 int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y) usX2Y_AsyncSeq04_init() argument 269 if (NULL == (usX2Y->AS04.buffer = kmalloc(URB_DataLen_AsyncSeq*URBS_AsyncSeq, GFP_KERNEL))) { usX2Y_AsyncSeq04_init() 273 if (NULL == (usX2Y->AS04.urb[i] = usb_alloc_urb(0, GFP_KERNEL))) { usX2Y_AsyncSeq04_init() 277 usb_fill_bulk_urb( usX2Y->AS04.urb[i], usX2Y->dev, usX2Y_AsyncSeq04_init() 278 usb_sndbulkpipe(usX2Y->dev, 0x04), usX2Y_AsyncSeq04_init() 279 usX2Y->AS04.buffer + URB_DataLen_AsyncSeq*i, 0, usX2Y_AsyncSeq04_init() 280 i_usX2Y_Out04Int, usX2Y usX2Y_AsyncSeq04_init() 286 int usX2Y_In04_init(struct usX2Ydev *usX2Y) usX2Y_In04_init() argument 288 if (! (usX2Y->In04urb = usb_alloc_urb(0, GFP_KERNEL))) usX2Y_In04_init() 291 if (! (usX2Y->In04Buf = kmalloc(21, GFP_KERNEL))) { usX2Y_In04_init() 292 usb_free_urb(usX2Y->In04urb); usX2Y_In04_init() 296 init_waitqueue_head(&usX2Y->In04WaitQueue); usX2Y_In04_init() 297 usb_fill_int_urb(usX2Y->In04urb, usX2Y->dev, usb_rcvintpipe(usX2Y->dev, 0x4), usX2Y_In04_init() 298 usX2Y->In04Buf, 21, usX2Y_In04_init() 299 i_usX2Y_In04Int, usX2Y, usX2Y_In04_init() 301 return usb_submit_urb(usX2Y->In04urb, GFP_KERNEL); usX2Y_In04_init() 352 snd_usX2Y_card_used[usX2Y(card)->card_index = dev] = 1; usX2Y_create_card() 354 usX2Y(card)->dev = device; usX2Y_create_card() 355 init_waitqueue_head(&usX2Y(card)->prepare_wait_queue); usX2Y_create_card() 356 mutex_init(&usX2Y(card)->pcm_mutex); usX2Y_create_card() 357 INIT_LIST_HEAD(&usX2Y(card)->midi_list); usX2Y_create_card() 365 usX2Y(card)->dev->bus->busnum, usX2Y(card)->dev->devnum usX2Y_create_card() 430 kfree(usX2Y(card)->In04Buf); snd_usX2Y_card_private_free() 431 usb_free_urb(usX2Y(card)->In04urb); snd_usX2Y_card_private_free() 432 if (usX2Y(card)->us428ctls_sharedmem) snd_usX2Y_card_private_free() 433 snd_free_pages(usX2Y(card)->us428ctls_sharedmem, sizeof(*usX2Y(card)->us428ctls_sharedmem)); snd_usX2Y_card_private_free() 434 if (usX2Y(card)->card_index >= 0 && usX2Y(card)->card_index < SNDRV_CARDS) snd_usX2Y_card_private_free() 435 snd_usX2Y_card_used[usX2Y(card)->card_index] = 0; snd_usX2Y_card_private_free() 445 struct usX2Ydev *usX2Y = usX2Y(card); usX2Y_usb_disconnect() local 447 usX2Y->chip_status = USX2Y_STAT_CHIP_HUP; usX2Y_usb_disconnect() 448 usX2Y_unlinkSeq(&usX2Y->AS04); usX2Y_usb_disconnect() 449 usb_kill_urb(usX2Y->In04urb); usX2Y_usb_disconnect() 452 list_for_each(p, &usX2Y->midi_list) { usX2Y_usb_disconnect() 455 if (usX2Y->us428ctls_sharedmem) usX2Y_usb_disconnect() 456 wake_up(&usX2Y->us428ctls_wait_queue_head); usX2Y_usb_disconnect()
|
H A D | usx2yhwdeppcm.c | 67 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_usbpcm_urb_capt_retire() local 68 if (0 > usX2Y->hwdep_pcm_shm->capture_iso_start) { //FIXME usX2Y_usbpcm_urb_capt_retire() 69 int head = usX2Y->hwdep_pcm_shm->captured_iso_head + 1; usX2Y_usbpcm_urb_capt_retire() 70 if (head >= ARRAY_SIZE(usX2Y->hwdep_pcm_shm->captured_iso)) usX2Y_usbpcm_urb_capt_retire() 72 usX2Y->hwdep_pcm_shm->capture_iso_start = head; usX2Y_usbpcm_urb_capt_retire() 80 lens += urb->iso_frame_desc[i].actual_length / usX2Y->stride; usX2Y_usbpcm_urb_capt_retire() 95 struct usX2Ydev * usX2Y) usX2Y_iso_frames_per_buffer() 97 return (runtime->buffer_size * 1000) / usX2Y->rate + 1; //FIXME: so far only correct period_size == 2^x ? usX2Y_iso_frames_per_buffer() 114 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_hwdep_urb_play_prepare() local 115 struct snd_usX2Y_hwdep_pcm_shm *shm = usX2Y->hwdep_pcm_shm; usX2Y_hwdep_urb_play_prepare() 120 usX2Y_iso_frames_per_buffer(runtime, usX2Y); usX2Y_hwdep_urb_play_prepare() 129 counts = shm->captured_iso[shm->playback_iso_head].length / usX2Y->stride; usX2Y_hwdep_urb_play_prepare() 144 urb->transfer_buffer_length = count * usX2Y->stride; usX2Y_hwdep_urb_play_prepare() 156 struct snd_usX2Y_hwdep_pcm_shm *shm = subs->usX2Y->hwdep_pcm_shm; usX2Y_usbpcm_urb_capt_iso_advance() 233 struct usX2Ydev *usX2Y = subs->usX2Y; i_usX2Y_usbpcm_urb_complete() local 238 usb_get_current_frame_number(usX2Y->dev), i_usX2Y_usbpcm_urb_complete() 244 usX2Y_error_urb_status(usX2Y, subs, urb); i_usX2Y_usbpcm_urb_complete() 249 capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; i_usX2Y_usbpcm_urb_complete() 250 capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; i_usX2Y_usbpcm_urb_complete() 251 playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; i_usX2Y_usbpcm_urb_complete() 256 usX2Y->wait_iso_frame += nr_of_packs(); i_usX2Y_usbpcm_urb_complete() 259 usX2Y_clients_stop(usX2Y); i_usX2Y_usbpcm_urb_complete() 283 static void usX2Y_usbpcm_subs_startup_finish(struct usX2Ydev * usX2Y) usX2Y_usbpcm_subs_startup_finish() argument 285 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_urb_complete); usX2Y_usbpcm_subs_startup_finish() 286 usX2Y->prepare_subs = NULL; usX2Y_usbpcm_subs_startup_finish() 292 struct usX2Ydev *usX2Y = subs->usX2Y; i_usX2Y_usbpcm_subs_startup() local 293 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; i_usX2Y_usbpcm_subs_startup() 297 if (prepare_subs == usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]) { i_usX2Y_usbpcm_subs_startup() 298 struct snd_usX2Y_substream *cap_subs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; i_usX2Y_usbpcm_subs_startup() 302 usX2Y_usbpcm_subs_startup_finish(usX2Y); i_usX2Y_usbpcm_subs_startup() 303 wake_up(&usX2Y->prepare_wait_queue); i_usX2Y_usbpcm_subs_startup() 316 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; usX2Y_usbpcm_urbs_allocate() 317 struct usb_device *dev = subs->usX2Y->dev; usX2Y_usbpcm_urbs_allocate() 338 subs->usX2Y->hwdep_pcm_shm->playback : ( usX2Y_usbpcm_urbs_allocate() 340 subs->usX2Y->hwdep_pcm_shm->capture0x8 : usX2Y_usbpcm_urbs_allocate() 341 subs->usX2Y->hwdep_pcm_shm->capture0xA); usX2Y_usbpcm_urbs_allocate() 360 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; snd_usX2Y_usbpcm_hw_free() 361 mutex_lock(&subs->usX2Y->pcm_mutex); snd_usX2Y_usbpcm_hw_free() 365 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; snd_usX2Y_usbpcm_hw_free() 380 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; snd_usX2Y_usbpcm_hw_free() 390 mutex_unlock(&subs->usX2Y->pcm_mutex); snd_usX2Y_usbpcm_hw_free() 396 struct usX2Ydev * usX2Y = subs->usX2Y; usX2Y_usbpcm_subs_startup() local 397 usX2Y->prepare_subs = subs; usX2Y_usbpcm_subs_startup() 400 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup); usX2Y_usbpcm_subs_startup() 407 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_usbpcm_urbs_start() local 410 usX2Y->hwdep_pcm_shm->captured_iso_head = -1; usX2Y_usbpcm_urbs_start() 411 usX2Y->hwdep_pcm_shm->captured_iso_frames = 0; usX2Y_usbpcm_urbs_start() 415 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; usX2Y_usbpcm_urbs_start() 424 struct snd_usX2Y_substream *subs = usX2Y->subs[p]; usX2Y_usbpcm_urbs_start() 433 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; usX2Y_usbpcm_urbs_start() 440 urb->dev = usX2Y->dev; usX2Y_usbpcm_urbs_start() 453 usX2Y->wait_iso_frame = urb->start_frame; usX2Y_usbpcm_urbs_start() 464 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); usX2Y_usbpcm_urbs_start() 470 usX2Y_subs_startup_finish(usX2Y); // Call it now usX2Y_usbpcm_urbs_start() 471 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything usX2Y_usbpcm_urbs_start() 485 struct usX2Ydev *usX2Y = subs->usX2Y; snd_usX2Y_usbpcm_prepare() local 486 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; snd_usX2Y_usbpcm_prepare() 490 if (NULL == usX2Y->hwdep_pcm_shm) { snd_usX2Y_usbpcm_prepare() 491 if (NULL == (usX2Y->hwdep_pcm_shm = snd_malloc_pages(sizeof(struct snd_usX2Y_hwdep_pcm_shm), GFP_KERNEL))) snd_usX2Y_usbpcm_prepare() 493 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); snd_usX2Y_usbpcm_prepare() 496 mutex_lock(&usX2Y->pcm_mutex); snd_usX2Y_usbpcm_prepare() 501 if (usX2Y->format != runtime->format) snd_usX2Y_usbpcm_prepare() 502 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) snd_usX2Y_usbpcm_prepare() 504 if (usX2Y->rate != runtime->rate) snd_usX2Y_usbpcm_prepare() 505 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) snd_usX2Y_usbpcm_prepare() 514 usX2Y->hwdep_pcm_shm->playback_iso_start = -1; snd_usX2Y_usbpcm_prepare() 516 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > snd_usX2Y_usbpcm_prepare() 517 usX2Y->hwdep_pcm_shm->captured_iso_frames) { snd_usX2Y_usbpcm_prepare() 520 usX2Y_iso_frames_per_buffer(runtime, usX2Y), snd_usX2Y_usbpcm_prepare() 521 usX2Y->hwdep_pcm_shm->captured_iso_frames); snd_usX2Y_usbpcm_prepare() 531 usX2Y_iso_frames_per_buffer(runtime, usX2Y), snd_usX2Y_usbpcm_prepare() 532 usX2Y->hwdep_pcm_shm->captured_iso_frames); snd_usX2Y_usbpcm_prepare() 534 usX2Y->hwdep_pcm_shm->capture_iso_start = -1; snd_usX2Y_usbpcm_prepare() 537 mutex_unlock(&usX2Y->pcm_mutex); snd_usX2Y_usbpcm_prepare() 568 if (!(subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) snd_usX2Y_usbpcm_open() 572 (subs->usX2Y->subs[3] ? snd_usX2Y_4c : snd_usX2Y_2c); snd_usX2Y_usbpcm_open() 605 struct usX2Ydev *dev = usX2Y(card); usX2Y_pcms_busy_check() 622 mutex_lock(&usX2Y(card)->pcm_mutex); snd_usX2Y_hwdep_pcm_open() 625 usX2Y(card)->chip_status |= USX2Y_STAT_CHIP_MMAP_PCM_URBS; snd_usX2Y_hwdep_pcm_open() 626 mutex_unlock(&usX2Y(card)->pcm_mutex); snd_usX2Y_hwdep_pcm_open() 636 mutex_lock(&usX2Y(card)->pcm_mutex); snd_usX2Y_hwdep_pcm_release() 639 usX2Y(hw->card)->chip_status &= ~USX2Y_STAT_CHIP_MMAP_PCM_URBS; snd_usX2Y_hwdep_pcm_release() 640 mutex_unlock(&usX2Y(card)->pcm_mutex); snd_usX2Y_hwdep_pcm_release() 679 struct usX2Ydev *usX2Y = hw->private_data; snd_usX2Y_hwdep_pcm_mmap() local 681 if (!(usX2Y->chip_status & USX2Y_STAT_CHIP_INIT)) snd_usX2Y_hwdep_pcm_mmap() 690 if (!usX2Y->hwdep_pcm_shm) { snd_usX2Y_hwdep_pcm_mmap() 702 struct usX2Ydev *usX2Y = hwdep->private_data; snd_usX2Y_hwdep_pcm_private_free() local 703 if (NULL != usX2Y->hwdep_pcm_shm) snd_usX2Y_hwdep_pcm_private_free() 704 snd_free_pages(usX2Y->hwdep_pcm_shm, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); snd_usX2Y_hwdep_pcm_private_free() 713 struct usb_device *dev = usX2Y(card)->dev; usX2Y_hwdep_pcm_new() 721 hw->private_data = usX2Y(card); usX2Y_hwdep_pcm_new() 736 pcm->private_data = usX2Y(card)->subs; usX2Y_hwdep_pcm_new() 94 usX2Y_iso_frames_per_buffer(struct snd_pcm_runtime *runtime, struct usX2Ydev * usX2Y) usX2Y_iso_frames_per_buffer() argument
|
H A D | usbusx2yaudio.c | 77 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_urb_capt_retire() local 87 len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; usX2Y_urb_capt_retire() 96 int blen = cnt * usX2Y->stride; usX2Y_urb_capt_retire() 97 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen); usX2Y_urb_capt_retire() 98 memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen); usX2Y_urb_capt_retire() 100 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, usX2Y_urb_capt_retire() 101 len * usX2Y->stride); usX2Y_urb_capt_retire() 132 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_urb_play_prepare() local 138 counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride; usX2Y_urb_play_prepare() 160 subs->hwptr * usX2Y->stride, len * usX2Y->stride); usX2Y_urb_play_prepare() 161 memcpy(subs->tmpbuf + len * usX2Y->stride, usX2Y_urb_play_prepare() 162 runtime->dma_area, (count - len) * usX2Y->stride); usX2Y_urb_play_prepare() 167 urb->transfer_buffer = runtime->dma_area + subs->hwptr * usX2Y->stride; usX2Y_urb_play_prepare() 173 urb->transfer_buffer_length = count * usX2Y->stride; usX2Y_urb_play_prepare() 185 int len = urb->actual_length / subs->usX2Y->stride; usX2Y_urb_play_retire() 204 urb->dev = subs->usX2Y->dev; /* we need to set this at each time */ usX2Y_urb_submit() 261 static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) usX2Y_clients_stop() argument 266 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; usX2Y_clients_stop() 273 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; usX2Y_clients_stop() 285 usX2Y->prepare_subs = NULL; usX2Y_clients_stop() 286 wake_up(&usX2Y->prepare_wait_queue); usX2Y_clients_stop() 289 static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y, usX2Y_error_urb_status() argument 294 usX2Y_clients_stop(usX2Y); usX2Y_error_urb_status() 300 struct usX2Ydev *usX2Y = subs->usX2Y; i_usX2Y_urb_complete() local 304 usb_get_current_frame_number(usX2Y->dev), i_usX2Y_urb_complete() 310 usX2Y_error_urb_status(usX2Y, subs, urb); i_usX2Y_urb_complete() 317 struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], i_usX2Y_urb_complete() 318 *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; i_usX2Y_urb_complete() 324 usX2Y->wait_iso_frame += nr_of_packs(); i_usX2Y_urb_complete() 327 usX2Y_clients_stop(usX2Y); i_usX2Y_urb_complete() 333 static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y, usX2Y_urbs_set_complete() argument 338 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; usX2Y_urbs_set_complete() 348 static void usX2Y_subs_startup_finish(struct usX2Ydev * usX2Y) usX2Y_subs_startup_finish() argument 350 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_urb_complete); usX2Y_subs_startup_finish() 351 usX2Y->prepare_subs = NULL; usX2Y_subs_startup_finish() 357 struct usX2Ydev *usX2Y = subs->usX2Y; i_usX2Y_subs_startup() local 358 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; i_usX2Y_subs_startup() 361 usX2Y_subs_startup_finish(usX2Y); i_usX2Y_subs_startup() 363 wake_up(&usX2Y->prepare_wait_queue); i_usX2Y_subs_startup() 399 subs != subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]); usX2Y_urbs_release() 411 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; usX2Y_urbs_allocate() 412 struct usb_device *dev = subs->usX2Y->dev; usX2Y_urbs_allocate() 459 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_subs_startup() local 460 usX2Y->prepare_subs = subs; usX2Y_subs_startup() 463 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_subs_startup); usX2Y_subs_startup() 469 struct usX2Ydev *usX2Y = subs->usX2Y; usX2Y_urbs_start() local 475 struct snd_usX2Y_substream *subs = usX2Y->subs[i]; usX2Y_urbs_start() 488 urb->dev = usX2Y->dev; usX2Y_urbs_start() 500 usX2Y->wait_iso_frame = urb->start_frame; usX2Y_urbs_start() 508 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); usX2Y_urbs_start() 514 usX2Y_subs_startup_finish(usX2Y); usX2Y_urbs_start() 515 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything usX2Y_urbs_start() 539 atomic_read(&subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]->state) >= state_PREPARED) { snd_usX2Y_pcm_trigger() 646 struct usX2Ydev *usX2Y = urb->context; i_usX2Y_04Int() local 650 if (0 == --usX2Y->US04->len) i_usX2Y_04Int() 651 wake_up(&usX2Y->In04WaitQueue); i_usX2Y_04Int() 654 static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate) usX2Y_rate_set() argument 661 if (usX2Y->rate != rate) { usX2Y_rate_set() 679 usb_fill_bulk_urb(us->urb[i], usX2Y->dev, usb_sndbulkpipe(usX2Y->dev, 4), usX2Y_rate_set() 680 usbdata + i, 2, i_usX2Y_04Int, usX2Y); usX2Y_rate_set() 684 usX2Y->US04 = us; usX2Y_rate_set() 685 wait_event_timeout(usX2Y->In04WaitQueue, 0 == us->len, HZ); usX2Y_rate_set() 686 usX2Y->US04 = NULL; usX2Y_rate_set() 701 usX2Y->US04 = NULL; usX2Y_rate_set() 705 usX2Y->rate = rate; usX2Y_rate_set() 713 static int usX2Y_format_set(struct usX2Ydev *usX2Y, snd_pcm_format_t format) usX2Y_format_set() argument 719 usX2Y->stride = 6; usX2Y_format_set() 722 usX2Y->stride = 4; usX2Y_format_set() 724 list_for_each(p, &usX2Y->midi_list) { usX2Y_format_set() 727 usb_kill_urb(usX2Y->In04urb); usX2Y_format_set() 728 if ((err = usb_set_interface(usX2Y->dev, 0, alternate))) { usX2Y_format_set() 732 usX2Y->In04urb->dev = usX2Y->dev; usX2Y_format_set() 733 err = usb_submit_urb(usX2Y->In04urb, GFP_KERNEL); usX2Y_format_set() 734 list_for_each(p, &usX2Y->midi_list) { usX2Y_format_set() 737 usX2Y->format = format; usX2Y_format_set() 738 usX2Y->rate = 0; usX2Y_format_set() 750 struct usX2Ydev *dev = usX2Y(card); snd_usX2Y_pcm_hw_params() 753 mutex_lock(&usX2Y(card)->pcm_mutex); snd_usX2Y_pcm_hw_params() 755 /* all pcm substreams off one usX2Y have to operate at the same snd_usX2Y_pcm_hw_params() 786 mutex_unlock(&usX2Y(card)->pcm_mutex); snd_usX2Y_pcm_hw_params() 797 mutex_lock(&subs->usX2Y->pcm_mutex); snd_usX2Y_pcm_hw_free() 801 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; snd_usX2Y_pcm_hw_free() 812 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; snd_usX2Y_pcm_hw_free() 818 mutex_unlock(&subs->usX2Y->pcm_mutex); snd_usX2Y_pcm_hw_free() 830 struct usX2Ydev *usX2Y = subs->usX2Y; snd_usX2Y_pcm_prepare() local 831 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; snd_usX2Y_pcm_prepare() 835 mutex_lock(&usX2Y->pcm_mutex); snd_usX2Y_pcm_prepare() 840 if (usX2Y->format != runtime->format) snd_usX2Y_pcm_prepare() 841 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) snd_usX2Y_pcm_prepare() 843 if (usX2Y->rate != runtime->rate) snd_usX2Y_pcm_prepare() 844 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) snd_usX2Y_pcm_prepare() 855 mutex_unlock(&usX2Y->pcm_mutex); snd_usX2Y_pcm_prepare() 887 if (subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS) snd_usX2Y_pcm_open() 947 usX2Y(card)->subs + 2 * usX2Y(card)->pcm_devs; usX2Y_audio_stream_new() 956 usX2Y_substream[i]->usX2Y = usX2Y(card); usX2Y_audio_stream_new() 963 err = snd_pcm_new(card, NAME_ALLCAPS" Audio", usX2Y(card)->pcm_devs, usX2Y_audio_stream_new() 979 sprintf(pcm->name, NAME_ALLCAPS" Audio #%d", usX2Y(card)->pcm_devs); usX2Y_audio_stream_new() 993 usX2Y(card)->pcm_devs++; usX2Y_audio_stream_new() 1005 INIT_LIST_HEAD(&usX2Y(card)->pcm_list); usX2Y_audio_create() 1009 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) == USB_ID_US428) usX2Y_audio_create() 1012 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) != USB_ID_US122) usX2Y_audio_create() 1013 err = usX2Y_rate_set(usX2Y(card), 44100); // Lets us428 recognize output-volume settings, disturbs us122. usX2Y_audio_create()
|
H A D | usbusx2y.h | 54 struct usX2Ydev *usX2Y; member in struct:snd_usX2Y_substream 79 #define usX2Y(c) ((struct usX2Ydev *)(c)->private_data) macro 83 int usX2Y_AsyncSeq04_init(struct usX2Ydev *usX2Y); 84 int usX2Y_In04_init(struct usX2Ydev *usX2Y);
|
H A D | usX2Yhwdep.c | 168 struct usb_device *dev = usX2Y(card)->dev; usX2Y_create_usbmidi() 175 return snd_usbmidi_create(card, iface, &usX2Y(card)->midi_list, quirk); usX2Y_create_usbmidi() 256 hw->private_data = usX2Y(card); usX2Y_hwdep_new()
|