Lines Matching defs:usX2Y
76 struct usX2Ydev *usX2Y = subs->usX2Y;
86 len = urb->iso_frame_desc[i].actual_length / usX2Y->stride;
95 int blen = cnt * usX2Y->stride;
96 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp, blen);
97 memcpy(runtime->dma_area, cp + blen, len * usX2Y->stride - blen);
99 memcpy(runtime->dma_area + hwptr_done * usX2Y->stride, cp,
100 len * usX2Y->stride);
131 struct usX2Ydev *usX2Y = subs->usX2Y;
137 counts = cap_urb->iso_frame_desc[pack].actual_length / usX2Y->stride;
159 subs->hwptr * usX2Y->stride, len * usX2Y->stride);
160 memcpy(subs->tmpbuf + len * usX2Y->stride,
161 runtime->dma_area, (count - len) * usX2Y->stride);
166 urb->transfer_buffer = runtime->dma_area + subs->hwptr * usX2Y->stride;
172 urb->transfer_buffer_length = count * usX2Y->stride;
184 int len = urb->actual_length / subs->usX2Y->stride;
203 urb->dev = subs->usX2Y->dev; /* we need to set this at each time */
260 static void usX2Y_clients_stop(struct usX2Ydev *usX2Y)
265 struct snd_usX2Y_substream *subs = usX2Y->subs[s];
272 struct snd_usX2Y_substream *subs = usX2Y->subs[s];
285 usX2Y->prepare_subs = NULL;
286 wake_up(&usX2Y->prepare_wait_queue);
289 static void usX2Y_error_urb_status(struct usX2Ydev *usX2Y,
294 usX2Y_clients_stop(usX2Y);
297 static void usX2Y_error_sequence(struct usX2Ydev *usX2Y,
304 usb_get_current_frame_number(usX2Y->dev),
306 usX2Y->wait_iso_frame, urb->start_frame, usX2Y->wait_iso_frame);
307 usX2Y_clients_stop(usX2Y);
313 struct usX2Ydev *usX2Y = subs->usX2Y;
317 usb_get_current_frame_number(usX2Y->dev),
323 usX2Y_error_urb_status(usX2Y, subs, urb);
326 if (likely((urb->start_frame & 0xFFFF) == (usX2Y->wait_iso_frame & 0xFFFF)))
329 usX2Y_error_sequence(usX2Y, subs, urb);
333 struct snd_usX2Y_substream *capsubs = usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE],
334 *playbacksubs = usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
340 usX2Y->wait_iso_frame += nr_of_packs();
343 usX2Y_clients_stop(usX2Y);
349 static void usX2Y_urbs_set_complete(struct usX2Ydev * usX2Y,
354 struct snd_usX2Y_substream *subs = usX2Y->subs[s];
364 static void usX2Y_subs_startup_finish(struct usX2Ydev * usX2Y)
366 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_urb_complete);
367 usX2Y->prepare_subs = NULL;
373 struct usX2Ydev *usX2Y = subs->usX2Y;
374 struct snd_usX2Y_substream *prepare_subs = usX2Y->prepare_subs;
377 usX2Y_subs_startup_finish(usX2Y);
379 wake_up(&usX2Y->prepare_wait_queue);
415 subs != subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK]);
427 int is_playback = subs == subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
428 struct usb_device *dev = subs->usX2Y->dev;
475 struct usX2Ydev *usX2Y = subs->usX2Y;
476 usX2Y->prepare_subs = subs;
479 usX2Y_urbs_set_complete(usX2Y, i_usX2Y_subs_startup);
485 struct usX2Ydev *usX2Y = subs->usX2Y;
491 struct snd_usX2Y_substream *subs = usX2Y->subs[i];
504 urb->dev = usX2Y->dev;
517 usX2Y->wait_iso_frame = urb->start_frame;
525 wait_event(usX2Y->prepare_wait_queue, NULL == usX2Y->prepare_subs);
531 usX2Y_subs_startup_finish(usX2Y);
532 usX2Y_clients_stop(usX2Y); // something is completely wroong > stop evrything
556 atomic_read(&subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE]->state) >= state_PREPARED) {
663 struct usX2Ydev *usX2Y = urb->context;
667 if (0 == --usX2Y->US04->len)
668 wake_up(&usX2Y->In04WaitQueue);
671 static int usX2Y_rate_set(struct usX2Ydev *usX2Y, int rate)
678 if (usX2Y->rate != rate) {
696 usb_fill_bulk_urb(us->urb[i], usX2Y->dev, usb_sndbulkpipe(usX2Y->dev, 4),
697 usbdata + i, 2, i_usX2Y_04Int, usX2Y);
704 usX2Y->US04 = us;
705 wait_event_timeout(usX2Y->In04WaitQueue, 0 == us->len, HZ);
706 usX2Y->US04 = NULL;
721 usX2Y->US04 = NULL;
725 usX2Y->rate = rate;
733 static int usX2Y_format_set(struct usX2Ydev *usX2Y, snd_pcm_format_t format)
739 usX2Y->stride = 6;
742 usX2Y->stride = 4;
744 list_for_each(p, &usX2Y->midi_list) {
747 usb_kill_urb(usX2Y->In04urb);
748 if ((err = usb_set_interface(usX2Y->dev, 0, alternate))) {
752 usX2Y->In04urb->dev = usX2Y->dev;
753 err = usb_submit_urb(usX2Y->In04urb, GFP_KERNEL);
754 list_for_each(p, &usX2Y->midi_list) {
757 usX2Y->format = format;
758 usX2Y->rate = 0;
773 // all pcm substreams off one usX2Y have to operate at the same rate & format
809 mutex_lock(&subs->usX2Y->prepare_mutex);
813 struct snd_usX2Y_substream *cap_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
824 struct snd_usX2Y_substream *playback_subs = subs->usX2Y->subs[SNDRV_PCM_STREAM_PLAYBACK];
830 mutex_unlock(&subs->usX2Y->prepare_mutex);
842 struct usX2Ydev *usX2Y = subs->usX2Y;
843 struct snd_usX2Y_substream *capsubs = subs->usX2Y->subs[SNDRV_PCM_STREAM_CAPTURE];
847 mutex_lock(&usX2Y->prepare_mutex);
852 if (usX2Y->format != runtime->format)
853 if ((err = usX2Y_format_set(usX2Y, runtime->format)) < 0)
855 if (usX2Y->rate != runtime->rate)
856 if ((err = usX2Y_rate_set(usX2Y, runtime->rate)) < 0)
867 mutex_unlock(&usX2Y->prepare_mutex);
899 if (subs->usX2Y->chip_status & USX2Y_STAT_CHIP_MMAP_PCM_URBS)
959 usX2Y(card)->subs + 2 * usX2Y(card)->pcm_devs;
968 usX2Y_substream[i]->usX2Y = usX2Y(card);
975 err = snd_pcm_new(card, NAME_ALLCAPS" Audio", usX2Y(card)->pcm_devs,
991 sprintf(pcm->name, NAME_ALLCAPS" Audio #%d", usX2Y(card)->pcm_devs);
1005 usX2Y(card)->pcm_devs++;
1017 INIT_LIST_HEAD(&usX2Y(card)->pcm_list);
1021 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) == USB_ID_US428)
1024 if (le16_to_cpu(usX2Y(card)->dev->descriptor.idProduct) != USB_ID_US122)
1025 err = usX2Y_rate_set(usX2Y(card), 44100); // Lets us428 recognize output-volume settings, disturbs us122.