Lines Matching refs:usX2Y
63 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_urb_capt_retire() local
73 len = urb->iso_frame_desc[i].actual_length / usX2Y->stride; in usX2Y_urb_capt_retire()
82 int blen = cnt * usX2Y->stride; in usX2Y_urb_capt_retire()
83 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen); in usX2Y_urb_capt_retire()
84 memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen); in usX2Y_urb_capt_retire()
86 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, in usX2Y_urb_capt_retire()
87 len * usX2Y->stride); in usX2Y_urb_capt_retire()
118 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_urb_play_prepare() local
124 counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride; in usX2Y_urb_play_prepare()
146 subs->hwptr * usX2Y->stride, len * usX2Y->stride); in usX2Y_urb_play_prepare()
147 memcpy(subs->tmpbuf + len * usX2Y->stride, in usX2Y_urb_play_prepare()
148 runtime->dma_area, (count - len) * usX2Y->stride); in usX2Y_urb_play_prepare()
153 urb->transfer_buffer = runtime->dma_area + subs->hwptr * usX2Y->stride; in usX2Y_urb_play_prepare()
159 urb->transfer_buffer_length = count * usX2Y->stride; in usX2Y_urb_play_prepare()
171 int len = urb->actual_length / subs->usX2Y->stride; in usX2Y_urb_play_retire()
190 urb->dev = subs->usX2Y->dev; /* we need to set this at each time */ in usX2Y_urb_submit()
247 static void usX2Y_clients_stop(struct usX2Ydev *usX2Y) in usX2Y_clients_stop() argument
252 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; in usX2Y_clients_stop()
259 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; in usX2Y_clients_stop()
271 usX2Y->prepare_subs = NULL; in usX2Y_clients_stop()
272 wake_up(&usX2Y->prepare_wait_queue); in usX2Y_clients_stop()
275 static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y, in usX2Y_error_urb_status() argument
280 usX2Y_clients_stop(usX2Y); in usX2Y_error_urb_status()
286 struct usX2Ydev *usX2Y = subs->usX2Y; in i_usX2Y_urb_complete() local
290 usb_get_current_frame_number(usX2Y->dev), in i_usX2Y_urb_complete()
296 usX2Y_error_urb_status(usX2Y, subs, urb); in i_usX2Y_urb_complete()
303 struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE], in i_usX2Y_urb_complete()
304 *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in i_usX2Y_urb_complete()
310 usX2Y->wait_iso_frame += nr_of_packs(); in i_usX2Y_urb_complete()
313 usX2Y_clients_stop(usX2Y); in i_usX2Y_urb_complete()
319 static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y, in usX2Y_urbs_set_complete() argument
324 struct snd_usX2Y_substream *subs = usX2Y->subs[s]; in usX2Y_urbs_set_complete()
334 static void usX2Y_subs_startup_finish(struct usX2Ydev * usX2Y) in usX2Y_subs_startup_finish() argument
336 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_urb_complete); in usX2Y_subs_startup_finish()
337 usX2Y->prepare_subs = NULL; in usX2Y_subs_startup_finish()
343 struct usX2Ydev *usX2Y = subs->usX2Y; in i_usX2Y_subs_startup() local
344 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs; in i_usX2Y_subs_startup()
347 usX2Y_subs_startup_finish(usX2Y); in i_usX2Y_subs_startup()
349 wake_up(&usX2Y->prepare_wait_queue); in i_usX2Y_subs_startup()
385 subs != subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]); in usX2Y_urbs_release()
397 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in usX2Y_urbs_allocate()
398 struct usb_device *dev = subs->usX2Y->dev; in usX2Y_urbs_allocate()
445 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_subs_startup() local
446 usX2Y->prepare_subs = subs; in usX2Y_subs_startup()
449 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_subs_startup); in usX2Y_subs_startup()
455 struct usX2Ydev *usX2Y = subs->usX2Y; in usX2Y_urbs_start() local
461 struct snd_usX2Y_substream *subs = usX2Y->subs[i]; in usX2Y_urbs_start()
474 urb->dev = usX2Y->dev; in usX2Y_urbs_start()
486 usX2Y->wait_iso_frame = urb->start_frame; in usX2Y_urbs_start()
494 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs); in usX2Y_urbs_start()
500 usX2Y_subs_startup_finish(usX2Y); in usX2Y_urbs_start()
501 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything in usX2Y_urbs_start()
525 atomic_read(&subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]->state) >= state_PREPARED) { in snd_usX2Y_pcm_trigger()
632 struct usX2Ydev *usX2Y = urb->context; in i_usX2Y_04Int() local
636 if (0 == --usX2Y->US04->len) in i_usX2Y_04Int()
637 wake_up(&usX2Y->In04WaitQueue); in i_usX2Y_04Int()
640 static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate) in usX2Y_rate_set() argument
647 if (usX2Y->rate != rate) { in usX2Y_rate_set()
666 usb_fill_bulk_urb(us->urb[i], usX2Y->dev, usb_sndbulkpipe(usX2Y->dev, 4), in usX2Y_rate_set()
667 usbdata + i, 2, i_usX2Y_04Int, usX2Y); in usX2Y_rate_set()
674 usX2Y->US04 = us; in usX2Y_rate_set()
675 wait_event_timeout(usX2Y->In04WaitQueue, 0 == us->len, HZ); in usX2Y_rate_set()
676 usX2Y->US04 = NULL; in usX2Y_rate_set()
693 usX2Y->US04 = NULL; in usX2Y_rate_set()
697 usX2Y->rate = rate; in usX2Y_rate_set()
705 static int usX2Y_format_set(struct usX2Ydev *usX2Y, snd_pcm_format_t format) in usX2Y_format_set() argument
711 usX2Y->stride = 6; in usX2Y_format_set()
714 usX2Y->stride = 4; in usX2Y_format_set()
716 list_for_each(p, &usX2Y->midi_list) { in usX2Y_format_set()
719 usb_kill_urb(usX2Y->In04urb); in usX2Y_format_set()
720 if ((err = usb_set_interface(usX2Y->dev, 0, alternate))) { in usX2Y_format_set()
724 usX2Y->In04urb->dev = usX2Y->dev; in usX2Y_format_set()
725 err = usb_submit_urb(usX2Y->In04urb, GFP_KERNEL); in usX2Y_format_set()
726 list_for_each(p, &usX2Y->midi_list) { in usX2Y_format_set()
729 usX2Y->format = format; in usX2Y_format_set()
730 usX2Y->rate = 0; in usX2Y_format_set()
742 struct usX2Ydev *dev = usX2Y(card); in snd_usX2Y_pcm_hw_params()
745 mutex_lock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_pcm_hw_params()
770 mutex_unlock(&usX2Y(card)->pcm_mutex); in snd_usX2Y_pcm_hw_params()
781 mutex_lock(&subs->usX2Y->pcm_mutex); in snd_usX2Y_pcm_hw_free()
785 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; in snd_usX2Y_pcm_hw_free()
796 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]; in snd_usX2Y_pcm_hw_free()
802 mutex_unlock(&subs->usX2Y->pcm_mutex); in snd_usX2Y_pcm_hw_free()
814 struct usX2Ydev *usX2Y = subs->usX2Y; in snd_usX2Y_pcm_prepare() local
815 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]; in snd_usX2Y_pcm_prepare()
819 mutex_lock(&usX2Y->pcm_mutex); in snd_usX2Y_pcm_prepare()
824 if (usX2Y->format != runtime->format) in snd_usX2Y_pcm_prepare()
825 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0) in snd_usX2Y_pcm_prepare()
827 if (usX2Y->rate != runtime->rate) in snd_usX2Y_pcm_prepare()
828 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0) in snd_usX2Y_pcm_prepare()
839 mutex_unlock(&usX2Y->pcm_mutex); in snd_usX2Y_pcm_prepare()
871 if (subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS) in snd_usX2Y_pcm_open()
931 usX2Y(card)->subs + 2 * usX2Y(card)->pcm_devs; in usX2Y_audio_stream_new()
939 usX2Y_substream[i]->usX2Y = usX2Y(card); in usX2Y_audio_stream_new()
946 err = snd_pcm_new(card, NAME_ALLCAPS" Audio", usX2Y(card)->pcm_devs, in usX2Y_audio_stream_new()
962 sprintf(pcm->name, NAME_ALLCAPS" Audio #%d", usX2Y(card)->pcm_devs); in usX2Y_audio_stream_new()
975 usX2Y(card)->pcm_devs++; in usX2Y_audio_stream_new()
987 INIT_LIST_HEAD(&usX2Y(card)->pcm_list); in usX2Y_audio_create()
991 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) == USB_ID_US428) in usX2Y_audio_create()
994 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) != USB_ID_US122) in usX2Y_audio_create()
995 …err = usX2Y_rate_set(usX2Y(card), 44100); // Lets us428 recognize output-volume settings, disturbs… in usX2Y_audio_create()