Lines Matching refs:line6pcm
32 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
36 spin_lock_irqsave(&line6pcm->lock_audio_in, flags);
38 find_first_zero_bit(&line6pcm->active_urb_in, LINE6_ISO_BUFFERS);
41 spin_unlock_irqrestore(&line6pcm->lock_audio_in, flags);
46 urb_in = line6pcm->urb_audio_in[index];
53 fin->length = line6pcm->max_packet_size;
54 urb_size += line6pcm->max_packet_size;
58 line6pcm->buffer_in +
59 index * LINE6_ISO_PACKETS * line6pcm->max_packet_size;
64 set_bit(index, &line6pcm->active_urb_in);
69 spin_unlock_irqrestore(&line6pcm->lock_audio_in, flags);
92 static void unlink_audio_in_urbs(struct snd_line6_pcm *line6pcm)
97 if (test_bit(i, &line6pcm->active_urb_in)) {
98 if (!test_and_set_bit(i, &line6pcm->unlink_urb_in)) {
99 struct urb *u = line6pcm->urb_audio_in[i];
110 static void wait_clear_audio_in_urbs(struct snd_line6_pcm *line6pcm)
119 if (test_bit(i, &line6pcm->active_urb_in))
130 line6pcm->active_urb_in = 0;
131 line6pcm->unlink_urb_in = 0;
137 void unlink_wait_clear_audio_in_urbs(struct snd_line6_pcm *line6pcm)
139 unlink_audio_in_urbs(line6pcm);
140 wait_clear_audio_in_urbs(line6pcm);
154 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
155 const int bytes_per_frame = line6pcm->properties->bytes_per_frame;
160 if (urb == line6pcm->urb_audio_in[index])
167 line6_write_hexdump(line6pcm->line6, 'C',
173 spin_lock_irqsave(&line6pcm->lock_audio_in, flags);
192 if (line6pcm->pos_in_done + frames >
201 line6pcm->pos_in_done;
205 line6pcm->pos_in_done *
220 line6pcm->pos_in_done * bytes_per_frame,
224 line6pcm->pos_in_done += frames;
225 if (line6pcm->pos_in_done >= runtime->buffer_size)
226 line6pcm->pos_in_done -= runtime->buffer_size;
230 clear_bit(index, &line6pcm->active_urb_in);
232 if (test_bit(index, &line6pcm->unlink_urb_in))
235 spin_unlock_irqrestore(&line6pcm->lock_audio_in, flags);
240 line6pcm->bytes_in += length;
241 if (line6pcm->bytes_in >= line6pcm->period_in) {
242 line6pcm->bytes_in -= line6pcm->period_in;
253 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
257 (&line6pcm->properties->
262 runtime->hw = line6pcm->properties->snd_line6_capture_hw;
277 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
281 if (line6pcm == NULL) {
287 line6pcm = snd_pcm_substream_chip(substream);
296 line6pcm->period_in = params_period_bytes(hw_params);
297 line6pcm->buffer_in =
301 if (!line6pcm->buffer_in) {
312 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
313 unlink_wait_clear_audio_in_urbs(line6pcm);
315 kfree(line6pcm->buffer_in);
316 line6pcm->buffer_in = NULL;
324 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
326 line6pcm->count_in = 0;
330 if (!test_and_set_bit(BIT_RUNNING_CAPTURE, &line6pcm->flags)) {
335 &line6pcm->flags);
343 if (test_and_clear_bit(BIT_RUNNING_CAPTURE, &line6pcm->flags))
344 unlink_audio_in_urbs(line6pcm);
359 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
360 return line6pcm->pos_in_done;
375 int create_audio_in_urbs(struct snd_line6_pcm *line6pcm)
384 urb = line6pcm->urb_audio_in[i] =
388 dev_err(line6pcm->line6->ifcdev, "Out of memory\n");
392 urb->dev = line6pcm->line6->usbdev;
394 usb_rcvisocpipe(line6pcm->line6->usbdev,
395 line6pcm->