Merge remote-tracking branch 'omap_dss2/for-next'
[deliverable/linux.git] / sound / usb / line6 / pcm.c
CommitLineData
705ececd 1/*
c078a4aa 2 * Line 6 Linux USB driver
705ececd 3 *
1027f476 4 * Copyright (C) 2004-2010 Markus Grabner (grabner@icg.tugraz.at)
705ececd
MG
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation, version 2.
9 *
10 */
11
5a0e3ad6 12#include <linux/slab.h>
ccddbe4a 13#include <linux/export.h>
705ececd
MG
14#include <sound/core.h>
15#include <sound/control.h>
16#include <sound/pcm.h>
17#include <sound/pcm_params.h>
18
705ececd 19#include "capture.h"
1027f476 20#include "driver.h"
705ececd 21#include "playback.h"
705ececd 22
075587b7
TI
23/* impulse response volume controls */
24static int snd_line6_impulse_volume_info(struct snd_kcontrol *kcontrol,
25 struct snd_ctl_elem_info *uinfo)
1027f476 26{
075587b7
TI
27 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
28 uinfo->count = 1;
29 uinfo->value.integer.min = 0;
30 uinfo->value.integer.max = 255;
31 return 0;
1027f476
MG
32}
33
075587b7
TI
34static int snd_line6_impulse_volume_get(struct snd_kcontrol *kcontrol,
35 struct snd_ctl_elem_value *ucontrol)
1027f476 36{
075587b7
TI
37 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
38
39 ucontrol->value.integer.value[0] = line6pcm->impulse_volume;
40 return 0;
1027f476
MG
41}
42
075587b7
TI
43static int snd_line6_impulse_volume_put(struct snd_kcontrol *kcontrol,
44 struct snd_ctl_elem_value *ucontrol)
1027f476 45{
075587b7
TI
46 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
47 int value = ucontrol->value.integer.value[0];
247d95ee 48 int err;
cdf5e551 49
075587b7
TI
50 if (line6pcm->impulse_volume == value)
51 return 0;
cdf5e551 52
1027f476 53 line6pcm->impulse_volume = value;
247d95ee
TI
54 if (value > 0) {
55 err = line6_pcm_acquire(line6pcm, LINE6_STREAM_IMPULSE);
56 if (err < 0) {
57 line6pcm->impulse_volume = 0;
247d95ee
TI
58 return err;
59 }
60 } else {
63e20df1 61 line6_pcm_release(line6pcm, LINE6_STREAM_IMPULSE);
247d95ee 62 }
075587b7
TI
63 return 1;
64}
1027f476 65
075587b7
TI
66/* impulse response period controls */
67static int snd_line6_impulse_period_info(struct snd_kcontrol *kcontrol,
68 struct snd_ctl_elem_info *uinfo)
69{
70 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
71 uinfo->count = 1;
72 uinfo->value.integer.min = 0;
73 uinfo->value.integer.max = 2000;
74 return 0;
1027f476
MG
75}
76
075587b7
TI
77static int snd_line6_impulse_period_get(struct snd_kcontrol *kcontrol,
78 struct snd_ctl_elem_value *ucontrol)
1027f476 79{
075587b7
TI
80 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
81
82 ucontrol->value.integer.value[0] = line6pcm->impulse_period;
83 return 0;
1027f476
MG
84}
85
075587b7
TI
86static int snd_line6_impulse_period_put(struct snd_kcontrol *kcontrol,
87 struct snd_ctl_elem_value *ucontrol)
1027f476 88{
075587b7
TI
89 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
90 int value = ucontrol->value.integer.value[0];
a3762902 91
075587b7
TI
92 if (line6pcm->impulse_period == value)
93 return 0;
a3762902 94
075587b7
TI
95 line6pcm->impulse_period = value;
96 return 1;
1027f476 97}
1027f476 98
d8131e67
TI
99/*
100 Unlink all currently active URBs.
101*/
102static void line6_unlink_audio_urbs(struct snd_line6_pcm *line6pcm,
103 struct line6_pcm_stream *pcms)
104{
105 int i;
106
107 for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
108 if (test_bit(i, &pcms->active_urbs)) {
109 if (!test_and_set_bit(i, &pcms->unlink_urbs))
110 usb_unlink_urb(pcms->urbs[i]);
111 }
112 }
113}
114
115/*
116 Wait until unlinking of all currently active URBs has been finished.
117*/
118static void line6_wait_clear_audio_urbs(struct snd_line6_pcm *line6pcm,
119 struct line6_pcm_stream *pcms)
120{
121 int timeout = HZ;
122 int i;
123 int alive;
124
125 do {
126 alive = 0;
127 for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
128 if (test_bit(i, &pcms->active_urbs))
129 alive++;
130 }
131 if (!alive)
132 break;
133 set_current_state(TASK_UNINTERRUPTIBLE);
134 schedule_timeout(1);
135 } while (--timeout > 0);
136 if (alive)
ccaac9ed
TI
137 dev_err(line6pcm->line6->ifcdev,
138 "timeout: still %d active urbs..\n", alive);
d8131e67
TI
139}
140
63e20df1
TI
141static inline struct line6_pcm_stream *
142get_stream(struct snd_line6_pcm *line6pcm, int direction)
e90576c5 143{
63e20df1
TI
144 return (direction == SNDRV_PCM_STREAM_PLAYBACK) ?
145 &line6pcm->out : &line6pcm->in;
e90576c5
TI
146}
147
63e20df1
TI
148/* allocate a buffer if not opened yet;
149 * call this in line6pcm.state_change mutex
150 */
151static int line6_buffer_acquire(struct snd_line6_pcm *line6pcm,
152 struct line6_pcm_stream *pstr, int type)
e90576c5 153{
63e20df1
TI
154 /* Invoked multiple times in a row so allocate once only */
155 if (!test_and_set_bit(type, &pstr->opened) && !pstr->buffer) {
156 pstr->buffer = kmalloc(LINE6_ISO_BUFFERS * LINE6_ISO_PACKETS *
157 line6pcm->max_packet_size, GFP_KERNEL);
158 if (!pstr->buffer)
159 return -ENOMEM;
160 }
161 return 0;
e90576c5
TI
162}
163
63e20df1
TI
164/* free a buffer if all streams are closed;
165 * call this in line6pcm.state_change mutex
166 */
167static void line6_buffer_release(struct snd_line6_pcm *line6pcm,
168 struct line6_pcm_stream *pstr, int type)
6b02a17e 169{
63e20df1
TI
170
171 clear_bit(type, &pstr->opened);
172 if (!pstr->opened) {
173 line6_wait_clear_audio_urbs(line6pcm, pstr);
174 kfree(pstr->buffer);
175 pstr->buffer = NULL;
176 }
6b02a17e
MG
177}
178
63e20df1
TI
179/* start a PCM stream */
180static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction,
181 int type)
1027f476 182{
63e20df1
TI
183 unsigned long flags;
184 struct line6_pcm_stream *pstr = get_stream(line6pcm, direction);
185 int ret = 0;
186
187 spin_lock_irqsave(&pstr->lock, flags);
4d0e6775
TI
188 if (!test_and_set_bit(type, &pstr->running) &&
189 !(pstr->active_urbs || pstr->unlink_urbs)) {
63e20df1
TI
190 pstr->count = 0;
191 /* Submit all currently available URBs */
192 if (direction == SNDRV_PCM_STREAM_PLAYBACK)
193 ret = line6_submit_audio_out_all_urbs(line6pcm);
194 else
195 ret = line6_submit_audio_in_all_urbs(line6pcm);
0ca54888 196 }
63e20df1
TI
197 if (ret < 0)
198 clear_bit(type, &pstr->running);
199 spin_unlock_irqrestore(&pstr->lock, flags);
200 return ret;
201}
0ca54888 202
63e20df1
TI
203/* stop a PCM stream; this doesn't sync with the unlinked URBs */
204static void line6_stream_stop(struct snd_line6_pcm *line6pcm, int direction,
205 int type)
206{
207 unsigned long flags;
208 struct line6_pcm_stream *pstr = get_stream(line6pcm, direction);
209
210 spin_lock_irqsave(&pstr->lock, flags);
211 clear_bit(type, &pstr->running);
212 if (!pstr->running) {
adc8a43a 213 spin_unlock_irqrestore(&pstr->lock, flags);
63e20df1 214 line6_unlink_audio_urbs(line6pcm, pstr);
adc8a43a 215 spin_lock_irqsave(&pstr->lock, flags);
63e20df1
TI
216 if (direction == SNDRV_PCM_STREAM_CAPTURE) {
217 line6pcm->prev_fbuf = NULL;
218 line6pcm->prev_fsize = 0;
6b02a17e 219 }
63e20df1
TI
220 }
221 spin_unlock_irqrestore(&pstr->lock, flags);
222}
6b02a17e 223
63e20df1
TI
224/* common PCM trigger callback */
225int snd_line6_trigger(struct snd_pcm_substream *substream, int cmd)
226{
227 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
228 struct snd_pcm_substream *s;
229 int err;
e1a164d7 230
63e20df1 231 clear_bit(LINE6_FLAG_PREPARED, &line6pcm->flags);
0ca54888 232
63e20df1
TI
233 snd_pcm_group_for_each_entry(s, substream) {
234 if (s->pcm->card != substream->pcm->card)
235 continue;
e1a164d7 236
63e20df1
TI
237 switch (cmd) {
238 case SNDRV_PCM_TRIGGER_START:
239 case SNDRV_PCM_TRIGGER_RESUME:
240 err = line6_stream_start(line6pcm, s->stream,
241 LINE6_STREAM_PCM);
242 if (err < 0)
243 return err;
244 break;
6b02a17e 245
63e20df1
TI
246 case SNDRV_PCM_TRIGGER_STOP:
247 case SNDRV_PCM_TRIGGER_SUSPEND:
248 line6_stream_stop(line6pcm, s->stream,
249 LINE6_STREAM_PCM);
250 break;
6b02a17e 251
63e20df1
TI
252 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
253 if (s->stream != SNDRV_PCM_STREAM_PLAYBACK)
254 return -EINVAL;
255 set_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags);
256 break;
e1a164d7 257
63e20df1
TI
258 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
259 if (s->stream != SNDRV_PCM_STREAM_PLAYBACK)
260 return -EINVAL;
261 clear_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags);
262 break;
0ca54888 263
63e20df1
TI
264 default:
265 return -EINVAL;
266 }
1027f476 267 }
e1a164d7 268
1027f476
MG
269 return 0;
270}
271
2954f914
TI
272/* common PCM pointer callback */
273snd_pcm_uframes_t snd_line6_pointer(struct snd_pcm_substream *substream)
274{
275 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
276 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream);
277
278 return pstr->pos_done;
279}
280
63e20df1
TI
281/* Acquire and start duplex streams:
282 * type is either LINE6_STREAM_IMPULSE or LINE6_STREAM_MONITOR
283 */
284int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int type)
1027f476 285{
63e20df1
TI
286 struct line6_pcm_stream *pstr;
287 int ret = 0, dir;
288
289 mutex_lock(&line6pcm->state_mutex);
290 for (dir = 0; dir < 2; dir++) {
291 pstr = get_stream(line6pcm, dir);
292 ret = line6_buffer_acquire(line6pcm, pstr, type);
293 if (ret < 0)
294 goto error;
295 if (!pstr->running)
296 line6_wait_clear_audio_urbs(line6pcm, pstr);
f2bb614b 297 }
63e20df1
TI
298 for (dir = 0; dir < 2; dir++) {
299 ret = line6_stream_start(line6pcm, dir, type);
300 if (ret < 0)
301 goto error;
1027f476 302 }
63e20df1
TI
303 error:
304 mutex_unlock(&line6pcm->state_mutex);
305 if (ret < 0)
306 line6_pcm_release(line6pcm, type);
307 return ret;
308}
309EXPORT_SYMBOL_GPL(line6_pcm_acquire);
1027f476 310
63e20df1
TI
311/* Stop and release duplex streams */
312void line6_pcm_release(struct snd_line6_pcm *line6pcm, int type)
313{
314 struct line6_pcm_stream *pstr;
315 int dir;
316
317 mutex_lock(&line6pcm->state_mutex);
318 for (dir = 0; dir < 2; dir++)
319 line6_stream_stop(line6pcm, dir, type);
320 for (dir = 0; dir < 2; dir++) {
321 pstr = get_stream(line6pcm, dir);
322 line6_buffer_release(line6pcm, pstr, type);
1027f476 323 }
63e20df1 324 mutex_unlock(&line6pcm->state_mutex);
1027f476 325}
ccddbe4a 326EXPORT_SYMBOL_GPL(line6_pcm_release);
1027f476 327
63e20df1
TI
328/* common PCM hw_params callback */
329int snd_line6_hw_params(struct snd_pcm_substream *substream,
330 struct snd_pcm_hw_params *hw_params)
705ececd 331{
63e20df1 332 int ret;
705ececd 333 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
63e20df1
TI
334 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream);
335
336 mutex_lock(&line6pcm->state_mutex);
337 ret = line6_buffer_acquire(line6pcm, pstr, LINE6_STREAM_PCM);
338 if (ret < 0)
339 goto error;
340
341 ret = snd_pcm_lib_malloc_pages(substream,
342 params_buffer_bytes(hw_params));
343 if (ret < 0) {
344 line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM);
345 goto error;
346 }
705ececd 347
63e20df1
TI
348 pstr->period = params_period_bytes(hw_params);
349 error:
350 mutex_unlock(&line6pcm->state_mutex);
351 return ret;
352}
705ececd 353
63e20df1
TI
354/* common PCM hw_free callback */
355int snd_line6_hw_free(struct snd_pcm_substream *substream)
356{
357 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
358 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream);
705ececd 359
63e20df1
TI
360 mutex_lock(&line6pcm->state_mutex);
361 line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM);
362 mutex_unlock(&line6pcm->state_mutex);
363 return snd_pcm_lib_free_pages(substream);
705ececd
MG
364}
365
63e20df1 366
705ececd 367/* control info callback */
1027f476
MG
368static int snd_line6_control_playback_info(struct snd_kcontrol *kcontrol,
369 struct snd_ctl_elem_info *uinfo)
68dc3dde 370{
705ececd
MG
371 uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
372 uinfo->count = 2;
373 uinfo->value.integer.min = 0;
374 uinfo->value.integer.max = 256;
375 return 0;
376}
377
378/* control get callback */
1027f476
MG
379static int snd_line6_control_playback_get(struct snd_kcontrol *kcontrol,
380 struct snd_ctl_elem_value *ucontrol)
68dc3dde 381{
705ececd
MG
382 int i;
383 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
384
9fb754b7 385 for (i = 0; i < 2; i++)
1027f476 386 ucontrol->value.integer.value[i] = line6pcm->volume_playback[i];
705ececd
MG
387
388 return 0;
389}
390
391/* control put callback */
1027f476
MG
392static int snd_line6_control_playback_put(struct snd_kcontrol *kcontrol,
393 struct snd_ctl_elem_value *ucontrol)
68dc3dde 394{
705ececd
MG
395 int i, changed = 0;
396 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol);
397
9fb754b7 398 for (i = 0; i < 2; i++)
e1a164d7
MG
399 if (line6pcm->volume_playback[i] !=
400 ucontrol->value.integer.value[i]) {
401 line6pcm->volume_playback[i] =
402 ucontrol->value.integer.value[i];
705ececd
MG
403 changed = 1;
404 }
405
406 return changed;
407}
408
409/* control definition */
075587b7
TI
410static struct snd_kcontrol_new line6_controls[] = {
411 {
412 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
413 .name = "PCM Playback Volume",
414 .info = snd_line6_control_playback_info,
415 .get = snd_line6_control_playback_get,
416 .put = snd_line6_control_playback_put
417 },
418 {
419 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
420 .name = "Impulse Response Volume",
421 .info = snd_line6_impulse_volume_info,
422 .get = snd_line6_impulse_volume_get,
423 .put = snd_line6_impulse_volume_put
424 },
425 {
426 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
427 .name = "Impulse Response Period",
428 .info = snd_line6_impulse_period_info,
429 .get = snd_line6_impulse_period_get,
430 .put = snd_line6_impulse_period_put
431 },
705ececd
MG
432};
433
434/*
435 Cleanup the PCM device.
436*/
d8131e67 437static void cleanup_urbs(struct line6_pcm_stream *pcms)
705ececd
MG
438{
439 int i;
705ececd 440
9fb754b7 441 for (i = 0; i < LINE6_ISO_BUFFERS; i++) {
d8131e67
TI
442 if (pcms->urbs[i]) {
443 usb_kill_urb(pcms->urbs[i]);
444 usb_free_urb(pcms->urbs[i]);
705ececd
MG
445 }
446 }
d8131e67
TI
447}
448
449static void line6_cleanup_pcm(struct snd_pcm *pcm)
450{
451 struct snd_line6_pcm *line6pcm = snd_pcm_chip(pcm);
452
453 cleanup_urbs(&line6pcm->out);
454 cleanup_urbs(&line6pcm->in);
b45a7c56 455 kfree(line6pcm);
705ececd
MG
456}
457
458/* create a PCM device */
b45a7c56 459static int snd_line6_new_pcm(struct usb_line6 *line6, struct snd_pcm **pcm_ret)
705ececd
MG
460{
461 struct snd_pcm *pcm;
462 int err;
463
b45a7c56
TI
464 err = snd_pcm_new(line6->card, (char *)line6->properties->name,
465 0, 1, 1, pcm_ret);
68dc3dde 466 if (err < 0)
705ececd 467 return err;
b45a7c56
TI
468 pcm = *pcm_ret;
469 strcpy(pcm->name, line6->properties->name);
705ececd
MG
470
471 /* set operators */
afb9091d
SB
472 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
473 &snd_line6_playback_ops);
e1a164d7 474 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_line6_capture_ops);
705ececd
MG
475
476 /* pre-allocation of buffers */
68dc3dde 477 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
e1a164d7
MG
478 snd_dma_continuous_data
479 (GFP_KERNEL), 64 * 1024,
480 128 * 1024);
705ececd
MG
481 return 0;
482}
483
1027f476 484/*
5a475311 485 Sync with PCM stream stops.
1027f476
MG
486*/
487void line6_pcm_disconnect(struct snd_line6_pcm *line6pcm)
488{
d8131e67
TI
489 line6_unlink_audio_urbs(line6pcm, &line6pcm->out);
490 line6_unlink_audio_urbs(line6pcm, &line6pcm->in);
491 line6_wait_clear_audio_urbs(line6pcm, &line6pcm->out);
492 line6_wait_clear_audio_urbs(line6pcm, &line6pcm->in);
1027f476
MG
493}
494
705ececd
MG
495/*
496 Create and register the PCM device and mixer entries.
497 Create URBs for playback and capture.
498*/
68dc3dde
GKH
499int line6_init_pcm(struct usb_line6 *line6,
500 struct line6_pcm_properties *properties)
705ececd 501{
075587b7 502 int i, err;
16d603d3
CR
503 unsigned ep_read = line6->properties->ep_audio_r;
504 unsigned ep_write = line6->properties->ep_audio_w;
b45a7c56 505 struct snd_pcm *pcm;
705ececd
MG
506 struct snd_line6_pcm *line6pcm;
507
4cb1a4ae 508 if (!(line6->properties->capabilities & LINE6_CAP_PCM))
e1a164d7 509 return 0; /* skip PCM initialization and report success */
705ececd 510
b45a7c56
TI
511 err = snd_line6_new_pcm(line6, &pcm);
512 if (err < 0)
513 return err;
705ececd 514
b45a7c56
TI
515 line6pcm = kzalloc(sizeof(*line6pcm), GFP_KERNEL);
516 if (!line6pcm)
705ececd
MG
517 return -ENOMEM;
518
63e20df1 519 mutex_init(&line6pcm->state_mutex);
b45a7c56
TI
520 line6pcm->pcm = pcm;
521 line6pcm->properties = properties;
1027f476
MG
522 line6pcm->volume_playback[0] = line6pcm->volume_playback[1] = 255;
523 line6pcm->volume_monitor = 255;
705ececd 524 line6pcm->line6 = line6;
3b08db37
SH
525
526 /* Read and write buffers are sized identically, so choose minimum */
527 line6pcm->max_packet_size = min(
528 usb_maxpacket(line6->usbdev,
529 usb_rcvisocpipe(line6->usbdev, ep_read), 0),
530 usb_maxpacket(line6->usbdev,
531 usb_sndisocpipe(line6->usbdev, ep_write), 1));
532
ad0119ab
TI
533 spin_lock_init(&line6pcm->out.lock);
534 spin_lock_init(&line6pcm->in.lock);
075587b7 535 line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD;
705ececd 536
b45a7c56
TI
537 line6->line6pcm = line6pcm;
538
539 pcm->private_data = line6pcm;
540 pcm->private_free = line6_cleanup_pcm;
541
1027f476 542 err = line6_create_audio_out_urbs(line6pcm);
68dc3dde 543 if (err < 0)
705ececd
MG
544 return err;
545
1027f476 546 err = line6_create_audio_in_urbs(line6pcm);
68dc3dde 547 if (err < 0)
705ececd
MG
548 return err;
549
550 /* mixer: */
075587b7
TI
551 for (i = 0; i < ARRAY_SIZE(line6_controls); i++) {
552 err = snd_ctl_add(line6->card,
553 snd_ctl_new1(&line6_controls[i], line6pcm));
554 if (err < 0)
555 return err;
556 }
1027f476 557
705ececd
MG
558 return 0;
559}
ccddbe4a 560EXPORT_SYMBOL_GPL(line6_init_pcm);
705ececd
MG
561
562/* prepare pcm callback */
563int snd_line6_prepare(struct snd_pcm_substream *substream)
564{
565 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream);
63e20df1 566 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream);
705ececd 567
63e20df1
TI
568 mutex_lock(&line6pcm->state_mutex);
569 if (!pstr->running)
570 line6_wait_clear_audio_urbs(line6pcm, pstr);
665f3f50 571
63e20df1 572 if (!test_and_set_bit(LINE6_FLAG_PREPARED, &line6pcm->flags)) {
ad0119ab
TI
573 line6pcm->out.count = 0;
574 line6pcm->out.pos = 0;
575 line6pcm->out.pos_done = 0;
576 line6pcm->out.bytes = 0;
577 line6pcm->in.count = 0;
578 line6pcm->in.pos_done = 0;
579 line6pcm->in.bytes = 0;
705ececd
MG
580 }
581
63e20df1 582 mutex_unlock(&line6pcm->state_mutex);
705ececd
MG
583 return 0;
584}
This page took 0.625409 seconds and 5 git commands to generate.