Lines Matching refs:usX2Y
55 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_usbpcm_urb_capt_retire() local
56 if (0 > usX2Y->hwdep_pcm_shm->capture_iso_start) { //FIXME in usX2Y_usbpcm_urb_capt_retire()
57 int head = usX2Y->hwdep_pcm_shm->captured_iso_head + 1; in usX2Y_usbpcm_urb_capt_retire()
58 if (head >= ARRAY_SIZE(usX2Y->hwdep_pcm_shm->captured_iso)) in usX2Y_usbpcm_urb_capt_retire()
60 usX2Y->hwdep_pcm_shm->capture_iso_start = head; in usX2Y_usbpcm_urb_capt_retire()
68 lens += urb->iso_frame_desc[i].actual_length / usX2Y->stride; in usX2Y_usbpcm_urb_capt_retire()
83 struct usX2Ydev * usX2Y) in usX2Y_iso_frames_per_buffer() argument
85 …return (runtime->buffer_size * 1000) / usX2Y->rate + 1; //FIXME: so far only correct period_size =… in usX2Y_iso_frames_per_buffer()
102 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_hwdep_urb_play_prepare() local
103 struct snd_usX2Y_hwdep_pcm_shm *shm = usX2Y->hwdep_pcm_shm; in usX2Y_hwdep_urb_play_prepare()
108 usX2Y_iso_frames_per_buffer(runtime, usX2Y); in usX2Y_hwdep_urb_play_prepare()
117 counts = shm->captured_iso[shm->playback_iso_head].length / usX2Y->stride; in usX2Y_hwdep_urb_play_prepare()
132 urb->transfer_buffer_length = count * usX2Y->stride; in usX2Y_hwdep_urb_play_prepare()
144 struct snd_usX2Y_hwdep_pcm_shm *shm = subs->usX2Y->hwdep_pcm_shm; in usX2Y_usbpcm_urb_capt_iso_advance()
221 struct usX2Ydev *usX2Y = subs->usX2Y; in i_usX2Y_usbpcm_urb_complete() local
226 usb_get_current_frame_number(usX2Y->dev), in i_usX2Y_usbpcm_urb_complete()
232 usX2Y_error_urb_status(usX2Y, subs, urb); in i_usX2Y_usbpcm_urb_complete()
237 capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; in i_usX2Y_usbpcm_urb_complete()
238 capsubs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; in i_usX2Y_usbpcm_urb_complete()
239 playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in i_usX2Y_usbpcm_urb_complete()
244 usX2Y->wait_iso_frame += nr_of_packs(); in i_usX2Y_usbpcm_urb_complete()
247 usX2Y_clients_stop(usX2Y); in i_usX2Y_usbpcm_urb_complete()
271 static void usX2Y_usbpcm_subs_startup_finish(struct usX2Ydev * usX2Y) in usX2Y_usbpcm_subs_startup_finish() argument
273 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_urb_complete); in usX2Y_usbpcm_subs_startup_finish()
274 usX2Y->prepare_subs = NULL; in usX2Y_usbpcm_subs_startup_finish()
280 struct usX2Ydev *usX2Y = subs->usX2Y; in i_usX2Y_usbpcm_subs_startup() local
281 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; in i_usX2Y_usbpcm_subs_startup()
285 if (prepare_subs == usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]) { in i_usX2Y_usbpcm_subs_startup()
286 struct snd_usX2Y_substream *cap_subs2 = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; in i_usX2Y_usbpcm_subs_startup()
290 usX2Y_usbpcm_subs_startup_finish(usX2Y); in i_usX2Y_usbpcm_subs_startup()
291 wake_up(&usX2Y->prepare_wait_queue); in i_usX2Y_usbpcm_subs_startup()
304 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in usX2Y_usbpcm_urbs_allocate()
305 struct usb_device *dev = subs->usX2Y->dev; in usX2Y_usbpcm_urbs_allocate()
326 subs->usX2Y->hwdep_pcm_shm->playback : ( in usX2Y_usbpcm_urbs_allocate()
328 subs->usX2Y->hwdep_pcm_shm->capture0x8 : in usX2Y_usbpcm_urbs_allocate()
329 subs->usX2Y->hwdep_pcm_shm->capture0xA); in usX2Y_usbpcm_urbs_allocate()
348 *cap_subs2 = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE + 2]; in snd_usX2Y_usbpcm_hw_free()
349 mutex_lock(&subs->usX2Y->pcm_mutex); in snd_usX2Y_usbpcm_hw_free()
353 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; in snd_usX2Y_usbpcm_hw_free()
368 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in snd_usX2Y_usbpcm_hw_free()
378 mutex_unlock(&subs->usX2Y->pcm_mutex); in snd_usX2Y_usbpcm_hw_free()
384 struct usX2Ydev * usX2Y = subs->usX2Y; in usX2Y_usbpcm_subs_startup() local
385 usX2Y->prepare_subs = subs; in usX2Y_usbpcm_subs_startup()
388 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_usbpcm_subs_startup); in usX2Y_usbpcm_subs_startup()
395 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_usbpcm_urbs_start() local
398 usX2Y->hwdep_pcm_shm->captured_iso_head = -1; in usX2Y_usbpcm_urbs_start()
399 usX2Y->hwdep_pcm_shm->captured_iso_frames = 0; in usX2Y_usbpcm_urbs_start()
403 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; in usX2Y_usbpcm_urbs_start()
412 struct snd_usX2Y_substream *subs = usX2Y->subs[p]; in usX2Y_usbpcm_urbs_start()
421 struct snd_usX2Y_substream *subs = usX2Y->subs[stream + p]; in usX2Y_usbpcm_urbs_start()
428 urb->dev = usX2Y->dev; in usX2Y_usbpcm_urbs_start()
441 usX2Y->wait_iso_frame = urb->start_frame; in usX2Y_usbpcm_urbs_start()
452 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); in usX2Y_usbpcm_urbs_start()
458 usX2Y_subs_startup_finish(usX2Y); // Call it now in usX2Y_usbpcm_urbs_start()
459 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything in usX2Y_usbpcm_urbs_start()
473 struct usX2Ydev *usX2Y = subs->usX2Y; in snd_usX2Y_usbpcm_prepare() local
474 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; in snd_usX2Y_usbpcm_prepare()
478 if (NULL == usX2Y->hwdep_pcm_shm) { in snd_usX2Y_usbpcm_prepare()
479 usX2Y->hwdep_pcm_shm = alloc_pages_exact(sizeof(struct snd_usX2Y_hwdep_pcm_shm), in snd_usX2Y_usbpcm_prepare()
481 if (!usX2Y->hwdep_pcm_shm) in snd_usX2Y_usbpcm_prepare()
483 memset(usX2Y->hwdep_pcm_shm, 0, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); in snd_usX2Y_usbpcm_prepare()
486 mutex_lock(&usX2Y->pcm_mutex); in snd_usX2Y_usbpcm_prepare()
491 if (usX2Y->format != runtime->format) in snd_usX2Y_usbpcm_prepare()
492 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) in snd_usX2Y_usbpcm_prepare()
494 if (usX2Y->rate != runtime->rate) in snd_usX2Y_usbpcm_prepare()
495 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) in snd_usX2Y_usbpcm_prepare()
504 usX2Y->hwdep_pcm_shm->playback_iso_start = -1; in snd_usX2Y_usbpcm_prepare()
506 while (usX2Y_iso_frames_per_buffer(runtime, usX2Y) > in snd_usX2Y_usbpcm_prepare()
507 usX2Y->hwdep_pcm_shm->captured_iso_frames) { in snd_usX2Y_usbpcm_prepare()
510 usX2Y_iso_frames_per_buffer(runtime, usX2Y), in snd_usX2Y_usbpcm_prepare()
511 usX2Y->hwdep_pcm_shm->captured_iso_frames); in snd_usX2Y_usbpcm_prepare()
521 usX2Y_iso_frames_per_buffer(runtime, usX2Y), in snd_usX2Y_usbpcm_prepare()
522 usX2Y->hwdep_pcm_shm->captured_iso_frames); in snd_usX2Y_usbpcm_prepare()
524 usX2Y->hwdep_pcm_shm->capture_iso_start = -1; in snd_usX2Y_usbpcm_prepare()
527 mutex_unlock(&usX2Y->pcm_mutex); in snd_usX2Y_usbpcm_prepare()
558 if (!(subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)) in snd_usX2Y_usbpcm_open()
562 (subs->usX2Y->subs[3] ? snd_usX2Y_4c : snd_usX2Y_2c); in snd_usX2Y_usbpcm_open()
594 struct usX2Ydev *dev = usX2Y(card); in usX2Y_pcms_busy_check()
611 mutex_lock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_hwdep_pcm_open()
614 usX2Y(card)->chip_status |= USX2Y_STAT_CHIP_MMAP_PCM_URBS; in snd_usX2Y_hwdep_pcm_open()
615 mutex_unlock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_hwdep_pcm_open()
625 mutex_lock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_hwdep_pcm_release()
628 usX2Y(hw->card)->chip_status &= ~USX2Y_STAT_CHIP_MMAP_PCM_URBS; in snd_usX2Y_hwdep_pcm_release()
629 mutex_unlock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_hwdep_pcm_release()
667 struct usX2Ydev *usX2Y = hw->private_data; in snd_usX2Y_hwdep_pcm_mmap() local
669 if (!(usX2Y->chip_status & USX2Y_STAT_CHIP_INIT)) in snd_usX2Y_hwdep_pcm_mmap()
678 if (!usX2Y->hwdep_pcm_shm) { in snd_usX2Y_hwdep_pcm_mmap()
690 struct usX2Ydev *usX2Y = hwdep->private_data; in snd_usX2Y_hwdep_pcm_private_free() local
691 if (NULL != usX2Y->hwdep_pcm_shm) in snd_usX2Y_hwdep_pcm_private_free()
692 free_pages_exact(usX2Y->hwdep_pcm_shm, sizeof(struct snd_usX2Y_hwdep_pcm_shm)); in snd_usX2Y_hwdep_pcm_private_free()
701 struct usb_device *dev = usX2Y(card)->dev; in usX2Y_hwdep_pcm_new()
709 hw->private_data = usX2Y(card); in usX2Y_hwdep_pcm_new()
724 pcm->private_data = usX2Y(card)->subs; in usX2Y_hwdep_pcm_new()