Lines Matching refs:audio
303 struct f_audio *audio = container_of(data, struct f_audio, in f_audio_playback_work() local
307 spin_lock_irq(&audio->lock); in f_audio_playback_work()
308 if (list_empty(&audio->play_queue)) { in f_audio_playback_work()
309 spin_unlock_irq(&audio->lock); in f_audio_playback_work()
312 play_buf = list_first_entry(&audio->play_queue, in f_audio_playback_work()
315 spin_unlock_irq(&audio->lock); in f_audio_playback_work()
317 u_audio_playback(&audio->card, play_buf->buf, play_buf->actual); in f_audio_playback_work()
323 struct f_audio *audio = req->context; in f_audio_out_ep_complete() local
324 struct usb_composite_dev *cdev = audio->card.func.config->cdev; in f_audio_out_ep_complete()
325 struct f_audio_buf *copy_buf = audio->copy_buf; in f_audio_out_ep_complete()
330 opts = container_of(audio->card.func.fi, struct f_uac1_legacy_opts, in f_audio_out_ep_complete()
339 spin_lock_irq(&audio->lock); in f_audio_out_ep_complete()
340 list_add_tail(©_buf->list, &audio->play_queue); in f_audio_out_ep_complete()
341 spin_unlock_irq(&audio->lock); in f_audio_out_ep_complete()
342 schedule_work(&audio->playback_work); in f_audio_out_ep_complete()
350 audio->copy_buf = copy_buf; in f_audio_out_ep_complete()
362 struct f_audio *audio = req->context; in f_audio_complete() local
365 struct usb_ep *out_ep = audio->out_ep; in f_audio_complete()
372 else if (audio->set_con) { in f_audio_complete()
374 audio->set_con->set(audio->set_con, audio->set_cmd, in f_audio_complete()
376 audio->set_con = NULL; in f_audio_complete()
387 struct f_audio *audio = func_to_audio(f); in audio_set_intf_req() local
401 list_for_each_entry(cs, &audio->cs, list) { in audio_set_intf_req()
405 audio->set_con = con; in audio_set_intf_req()
413 audio->set_cmd = cmd; in audio_set_intf_req()
414 req->context = audio; in audio_set_intf_req()
423 struct f_audio *audio = func_to_audio(f); in audio_get_intf_req() local
438 list_for_each_entry(cs, &audio->cs, list) { in audio_get_intf_req()
450 req->context = audio; in audio_get_intf_req()
576 struct f_audio *audio = func_to_audio(f); in f_audio_set_alt() local
578 struct usb_ep *out_ep = audio->out_ep; in f_audio_set_alt()
597 if (intf == audio->ac_intf) { in f_audio_set_alt()
604 } else if (intf == audio->as_intf) { in f_audio_set_alt()
611 audio->copy_buf = f_audio_buffer_alloc(audio_buf_size); in f_audio_set_alt()
612 if (IS_ERR(audio->copy_buf)) in f_audio_set_alt()
626 req->context = audio; in f_audio_set_alt()
642 struct f_audio_buf *copy_buf = audio->copy_buf; in f_audio_set_alt()
645 &audio->play_queue); in f_audio_set_alt()
646 schedule_work(&audio->playback_work); in f_audio_set_alt()
649 audio->as_alt = alt; in f_audio_set_alt()
657 struct f_audio *audio = func_to_audio(f); in f_audio_get_alt() local
660 if (intf == audio->ac_intf) in f_audio_get_alt()
661 return audio->ac_alt; in f_audio_get_alt()
662 else if (intf == audio->as_intf) in f_audio_get_alt()
663 return audio->as_alt; in f_audio_get_alt()
678 static void f_audio_build_desc(struct f_audio *audio) in f_audio_build_desc() argument
680 struct gaudio *card = &audio->card; in f_audio_build_desc()
703 struct f_audio *audio = func_to_audio(f); in f_audio_bind() local
710 audio->card.gadget = c->cdev->gadget; in f_audio_bind()
713 status = gaudio_setup(&audio->card); in f_audio_bind()
730 f_audio_build_desc(audio); in f_audio_bind()
737 audio->ac_intf = status; in f_audio_bind()
738 audio->ac_alt = 0; in f_audio_bind()
745 audio->as_intf = status; in f_audio_bind()
746 audio->as_alt = 0; in f_audio_bind()
754 audio->out_ep = ep; in f_audio_bind()
755 audio->out_ep->desc = &as_out_ep_desc; in f_audio_bind()
765 gaudio_cleanup(&audio->card); in f_audio_bind()
784 static int control_selector_init(struct f_audio *audio) in control_selector_init() argument
786 INIT_LIST_HEAD(&audio->cs); in control_selector_init()
787 list_add(&feature_unit.list, &audio->cs); in control_selector_init()
966 struct f_audio *audio = func_to_audio(f); in f_audio_free() local
969 gaudio_cleanup(&audio->card); in f_audio_free()
971 kfree(audio); in f_audio_free()
984 struct f_audio *audio; in f_audio_alloc() local
988 audio = kzalloc(sizeof(*audio), GFP_KERNEL); in f_audio_alloc()
989 if (!audio) in f_audio_alloc()
992 audio->card.func.name = "g_audio"; in f_audio_alloc()
998 INIT_LIST_HEAD(&audio->play_queue); in f_audio_alloc()
999 spin_lock_init(&audio->lock); in f_audio_alloc()
1001 audio->card.func.bind = f_audio_bind; in f_audio_alloc()
1002 audio->card.func.unbind = f_audio_unbind; in f_audio_alloc()
1003 audio->card.func.set_alt = f_audio_set_alt; in f_audio_alloc()
1004 audio->card.func.get_alt = f_audio_get_alt; in f_audio_alloc()
1005 audio->card.func.setup = f_audio_setup; in f_audio_alloc()
1006 audio->card.func.disable = f_audio_disable; in f_audio_alloc()
1007 audio->card.func.free_func = f_audio_free; in f_audio_alloc()
1009 control_selector_init(audio); in f_audio_alloc()
1011 INIT_WORK(&audio->playback_work, f_audio_playback_work); in f_audio_alloc()
1013 return &audio->card.func; in f_audio_alloc()