Lines Matching defs:usX2Y
68 struct usX2Ydev *usX2Y = subs->usX2Y;
69 if (0 > usX2Y->hwdep_pcm_shm->capture_iso_start) {
70 int head = usX2Y->hwdep_pcm_shm->captured_iso_head + 1;
71 if (head >= ARRAY_SIZE(usX2Y->hwdep_pcm_shm->captured_iso))
73 usX2Y->hwdep_pcm_shm->capture_iso_start = head;
81 lens += urb->iso_frame_desc[i].actual_length / usX2Y->stride;
96 struct usX2Ydev * usX2Y)
98 return (runtime->buffer_size * 1000) / usX2Y->rate + 1;
115 struct usX2Ydev *usX2Y = subs->usX2Y;
116 struct snd_usX2Y_hwdep_pcm_shm *shm = usX2Y->hwdep_pcm_shm;
121 usX2Y_iso_frames_per_buffer(runtime, usX2Y);
130 counts = shm->captured_iso[shm->playback_iso_head].length / usX2Y->stride;
145 urb->transfer_buffer_length = count * usX2Y->stride;
157 struct snd_usX2Y_hwdep_pcm_shm *shm = subs->usX2Y->hwdep_pcm_shm;
234 struct usX2Ydev *usX2Y = subs->usX2Y;
239 usb_get_current_frame_number(usX2Y->dev),
245 usX2Y_error_urb_status(usX2Y, subs, urb);
248 if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF)))
251 usX2Y_error_sequence(usX2Y, subs, urb);
255 capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
256 capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
257 playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
262 usX2Y->wait_iso_frame += nr_of_packs();
265 usX2Y_clients_stop(usX2Y);
289 static void usX2Y_usbpcm_subs_startup_finish(struct usX2Ydev * usX2Y)
291 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_urb_complete);
292 usX2Y->prepare_subs = NULL;
298 struct usX2Ydev *usX2Y = subs->usX2Y;
299 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs;
303 if (prepare_subs == usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]) {
304 struct snd_usX2Y_substream *cap_subs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
308 usX2Y_usbpcm_subs_startup_finish(usX2Y);
309 wake_up(&usX2Y->prepare_wait_queue);
322 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
323 struct usb_device *dev = subs->usX2Y->dev;
344 subs->usX2Y->hwdep_pcm_shm->playback : (
346 subs->usX2Y->hwdep_pcm_shm->capture0x8 :
347 subs->usX2Y->hwdep_pcm_shm->capture0xA);
366 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2];
367 mutex_lock(&subs->usX2Y->prepare_mutex);
371 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
386 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
396 mutex_unlock(&subs->usX2Y->prepare_mutex);
402 struct usX2Ydev * usX2Y = subs->usX2Y;
403 usX2Y->prepare_subs = subs;
406 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup);
413 struct usX2Ydev *usX2Y = subs->usX2Y;
416 usX2Y->hwdep_pcm_shm->captured_iso_head = -1;
417 usX2Y->hwdep_pcm_shm->captured_iso_frames = 0;
421 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p];
430 struct snd_usX2Y_substream *subs = usX2Y->subs[p];
439 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p];
446 urb->dev = usX2Y->dev;
460 usX2Y->wait_iso_frame = urb->start_frame;
471 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs);
477 usX2Y_subs_startup_finish(usX2Y); // Call it now
478 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything
492 struct usX2Ydev *usX2Y = subs->usX2Y;
493 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
497 if (NULL == usX2Y->hwdep_pcm_shm) {
498 if (NULL == (usX2Y->hwdep_pcm_shm = snd_malloc_pages(sizeof(struct snd_usX2Y_hwdep_pcm_shm), GFP_KERNEL)))
500 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm));
503 mutex_lock(&usX2Y->prepare_mutex);
508 if (usX2Y->format != runtime->format)
509 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0)
511 if (usX2Y->rate != runtime->rate)
512 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0)
521 usX2Y->hwdep_pcm_shm->playback_iso_start = -1;
523 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) >
524 usX2Y->hwdep_pcm_shm->captured_iso_frames) {
527 usX2Y_iso_frames_per_buffer(runtime, usX2Y),
528 usX2Y->hwdep_pcm_shm->captured_iso_frames);
538 usX2Y_iso_frames_per_buffer(runtime, usX2Y),
539 usX2Y->hwdep_pcm_shm->captured_iso_frames);
541 usX2Y->hwdep_pcm_shm->capture_iso_start = -1;
544 mutex_unlock(&usX2Y->prepare_mutex);
575 if (!(subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS))
579 (subs->usX2Y->subs[3] ? snd_usX2Y_4c : snd_usX2Y_2c);
661 usX2Y(card)->chip_status |= USX2Y_STAT_CHIP_MMAP_PCM_URBS;
672 usX2Y(hw->card)->chip_status &= ~USX2Y_STAT_CHIP_MMAP_PCM_URBS;
712 struct usX2Ydev *usX2Y = hw->private_data;
714 if (!(usX2Y->chip_status & USX2Y_STAT_CHIP_INIT))
723 if (!usX2Y->hwdep_pcm_shm) {
735 struct usX2Ydev *usX2Y = hwdep->private_data;
736 if (NULL != usX2Y->hwdep_pcm_shm)
737 snd_free_pages(usX2Y->hwdep_pcm_shm, sizeof(struct snd_usX2Y_hwdep_pcm_shm));
746 struct usb_device *dev = usX2Y(card)->dev;
754 hw->private_data = usX2Y(card);
769 pcm->private_data = usX2Y(card)->subs;