Lines Matching refs:line6pcm
37 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_impulse_volume_get() local
39 ucontrol->value.integer.value[0] = line6pcm->impulse_volume; in snd_line6_impulse_volume_get()
46 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_impulse_volume_put() local
50 if (line6pcm->impulse_volume == value) in snd_line6_impulse_volume_put()
53 line6pcm->impulse_volume = value; in snd_line6_impulse_volume_put()
55 err = line6_pcm_acquire(line6pcm, LINE6_STREAM_IMPULSE); in snd_line6_impulse_volume_put()
57 line6pcm->impulse_volume = 0; in snd_line6_impulse_volume_put()
61 line6_pcm_release(line6pcm, LINE6_STREAM_IMPULSE); in snd_line6_impulse_volume_put()
80 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_impulse_period_get() local
82 ucontrol->value.integer.value[0] = line6pcm->impulse_period; in snd_line6_impulse_period_get()
89 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_impulse_period_put() local
92 if (line6pcm->impulse_period == value) in snd_line6_impulse_period_put()
95 line6pcm->impulse_period = value; in snd_line6_impulse_period_put()
102 static void line6_unlink_audio_urbs(struct snd_line6_pcm *line6pcm, in line6_unlink_audio_urbs() argument
118 static void line6_wait_clear_audio_urbs(struct snd_line6_pcm *line6pcm, in line6_wait_clear_audio_urbs() argument
137 dev_err(line6pcm->line6->ifcdev, in line6_wait_clear_audio_urbs()
142 get_stream(struct snd_line6_pcm *line6pcm, int direction) in get_stream() argument
145 &line6pcm->out : &line6pcm->in; in get_stream()
151 static int line6_buffer_acquire(struct snd_line6_pcm *line6pcm, in line6_buffer_acquire() argument
157 line6pcm->max_packet_size, GFP_KERNEL); in line6_buffer_acquire()
167 static void line6_buffer_release(struct snd_line6_pcm *line6pcm, in line6_buffer_release() argument
173 line6_wait_clear_audio_urbs(line6pcm, pstr); in line6_buffer_release()
180 static int line6_stream_start(struct snd_line6_pcm *line6pcm, int direction, in line6_stream_start() argument
184 struct line6_pcm_stream *pstr = get_stream(line6pcm, direction); in line6_stream_start()
193 ret = line6_submit_audio_out_all_urbs(line6pcm); in line6_stream_start()
195 ret = line6_submit_audio_in_all_urbs(line6pcm); in line6_stream_start()
204 static void line6_stream_stop(struct snd_line6_pcm *line6pcm, int direction, in line6_stream_stop() argument
208 struct line6_pcm_stream *pstr = get_stream(line6pcm, direction); in line6_stream_stop()
214 line6_unlink_audio_urbs(line6pcm, pstr); in line6_stream_stop()
217 line6pcm->prev_fbuf = NULL; in line6_stream_stop()
218 line6pcm->prev_fsize = 0; in line6_stream_stop()
227 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); in snd_line6_trigger() local
231 clear_bit(LINE6_FLAG_PREPARED, &line6pcm->flags); in snd_line6_trigger()
240 err = line6_stream_start(line6pcm, s->stream, in snd_line6_trigger()
248 line6_stream_stop(line6pcm, s->stream, in snd_line6_trigger()
255 set_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); in snd_line6_trigger()
261 clear_bit(LINE6_FLAG_PAUSE_PLAYBACK, &line6pcm->flags); in snd_line6_trigger()
275 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); in snd_line6_pointer() local
276 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); in snd_line6_pointer()
284 int line6_pcm_acquire(struct snd_line6_pcm *line6pcm, int type) in line6_pcm_acquire() argument
289 mutex_lock(&line6pcm->state_mutex); in line6_pcm_acquire()
291 pstr = get_stream(line6pcm, dir); in line6_pcm_acquire()
292 ret = line6_buffer_acquire(line6pcm, pstr, type); in line6_pcm_acquire()
296 line6_wait_clear_audio_urbs(line6pcm, pstr); in line6_pcm_acquire()
299 ret = line6_stream_start(line6pcm, dir, type); in line6_pcm_acquire()
304 mutex_unlock(&line6pcm->state_mutex); in line6_pcm_acquire()
306 line6_pcm_release(line6pcm, type); in line6_pcm_acquire()
312 void line6_pcm_release(struct snd_line6_pcm *line6pcm, int type) in line6_pcm_release() argument
317 mutex_lock(&line6pcm->state_mutex); in line6_pcm_release()
319 line6_stream_stop(line6pcm, dir, type); in line6_pcm_release()
321 pstr = get_stream(line6pcm, dir); in line6_pcm_release()
322 line6_buffer_release(line6pcm, pstr, type); in line6_pcm_release()
324 mutex_unlock(&line6pcm->state_mutex); in line6_pcm_release()
333 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); in snd_line6_hw_params() local
334 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); in snd_line6_hw_params()
336 mutex_lock(&line6pcm->state_mutex); in snd_line6_hw_params()
337 ret = line6_buffer_acquire(line6pcm, pstr, LINE6_STREAM_PCM); in snd_line6_hw_params()
344 line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM); in snd_line6_hw_params()
350 mutex_unlock(&line6pcm->state_mutex); in snd_line6_hw_params()
357 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); in snd_line6_hw_free() local
358 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); in snd_line6_hw_free()
360 mutex_lock(&line6pcm->state_mutex); in snd_line6_hw_free()
361 line6_buffer_release(line6pcm, pstr, LINE6_STREAM_PCM); in snd_line6_hw_free()
362 mutex_unlock(&line6pcm->state_mutex); in snd_line6_hw_free()
383 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_control_playback_get() local
386 ucontrol->value.integer.value[i] = line6pcm->volume_playback[i]; in snd_line6_control_playback_get()
396 struct snd_line6_pcm *line6pcm = snd_kcontrol_chip(kcontrol); in snd_line6_control_playback_put() local
399 if (line6pcm->volume_playback[i] != in snd_line6_control_playback_put()
401 line6pcm->volume_playback[i] = in snd_line6_control_playback_put()
451 struct snd_line6_pcm *line6pcm = snd_pcm_chip(pcm); in line6_cleanup_pcm() local
453 cleanup_urbs(&line6pcm->out); in line6_cleanup_pcm()
454 cleanup_urbs(&line6pcm->in); in line6_cleanup_pcm()
455 kfree(line6pcm); in line6_cleanup_pcm()
487 void line6_pcm_disconnect(struct snd_line6_pcm *line6pcm) in line6_pcm_disconnect() argument
489 line6_unlink_audio_urbs(line6pcm, &line6pcm->out); in line6_pcm_disconnect()
490 line6_unlink_audio_urbs(line6pcm, &line6pcm->in); in line6_pcm_disconnect()
491 line6_wait_clear_audio_urbs(line6pcm, &line6pcm->out); in line6_pcm_disconnect()
492 line6_wait_clear_audio_urbs(line6pcm, &line6pcm->in); in line6_pcm_disconnect()
506 struct snd_line6_pcm *line6pcm; in line6_init_pcm() local
515 line6pcm = kzalloc(sizeof(*line6pcm), GFP_KERNEL); in line6_init_pcm()
516 if (!line6pcm) in line6_init_pcm()
519 mutex_init(&line6pcm->state_mutex); in line6_init_pcm()
520 line6pcm->pcm = pcm; in line6_init_pcm()
521 line6pcm->properties = properties; in line6_init_pcm()
522 line6pcm->volume_playback[0] = line6pcm->volume_playback[1] = 255; in line6_init_pcm()
523 line6pcm->volume_monitor = 255; in line6_init_pcm()
524 line6pcm->line6 = line6; in line6_init_pcm()
526 spin_lock_init(&line6pcm->out.lock); in line6_init_pcm()
527 spin_lock_init(&line6pcm->in.lock); in line6_init_pcm()
528 line6pcm->impulse_period = LINE6_IMPULSE_DEFAULT_PERIOD; in line6_init_pcm()
530 line6->line6pcm = line6pcm; in line6_init_pcm()
532 pcm->private_data = line6pcm; in line6_init_pcm()
536 line6pcm->max_packet_size = min( in line6_init_pcm()
541 if (!line6pcm->max_packet_size) { in line6_init_pcm()
542 dev_err(line6pcm->line6->ifcdev, in line6_init_pcm()
547 err = line6_create_audio_out_urbs(line6pcm); in line6_init_pcm()
551 err = line6_create_audio_in_urbs(line6pcm); in line6_init_pcm()
558 snd_ctl_new1(&line6_controls[i], line6pcm)); in line6_init_pcm()
570 struct snd_line6_pcm *line6pcm = snd_pcm_substream_chip(substream); in snd_line6_prepare() local
571 struct line6_pcm_stream *pstr = get_stream(line6pcm, substream->stream); in snd_line6_prepare()
573 mutex_lock(&line6pcm->state_mutex); in snd_line6_prepare()
575 line6_wait_clear_audio_urbs(line6pcm, pstr); in snd_line6_prepare()
577 if (!test_and_set_bit(LINE6_FLAG_PREPARED, &line6pcm->flags)) { in snd_line6_prepare()
578 line6pcm->out.count = 0; in snd_line6_prepare()
579 line6pcm->out.pos = 0; in snd_line6_prepare()
580 line6pcm->out.pos_done = 0; in snd_line6_prepare()
581 line6pcm->out.bytes = 0; in snd_line6_prepare()
582 line6pcm->in.count = 0; in snd_line6_prepare()
583 line6pcm->in.pos_done = 0; in snd_line6_prepare()
584 line6pcm->in.bytes = 0; in snd_line6_prepare()
587 mutex_unlock(&line6pcm->state_mutex); in snd_line6_prepare()