Lines Matching refs:uac1

404 	struct f_uac1 *uac1 = func_to_uac1(fn);  in uac_cs_attr_sample_rate()  local
414 if (uac1->ctl_id == (USB_DIR_IN | 2)) { in uac_cs_attr_sample_rate()
415 uac1->p_srate = val; in uac_cs_attr_sample_rate()
416 u_audio_set_playback_srate(agdev, uac1->p_srate); in uac_cs_attr_sample_rate()
417 } else if (uac1->ctl_id == (USB_DIR_OUT | 1)) { in uac_cs_attr_sample_rate()
418 uac1->c_srate = val; in uac_cs_attr_sample_rate()
419 u_audio_set_capture_srate(agdev, uac1->c_srate); in uac_cs_attr_sample_rate()
426 struct f_uac1 *uac1 = func_to_uac1(&audio->func); in audio_notify_complete() local
428 atomic_dec(&uac1->int_count); in audio_notify_complete()
435 struct f_uac1 *uac1 = func_to_uac1(&audio->func); in audio_notify() local
440 if (!uac1->int_ep->enabled) in audio_notify()
443 if (atomic_inc_return(&uac1->int_count) > UAC1_DEF_INT_REQ_NUM) { in audio_notify()
444 atomic_dec(&uac1->int_count); in audio_notify()
448 req = usb_ep_alloc_request(uac1->int_ep, GFP_ATOMIC); in audio_notify()
469 ret = usb_ep_queue(uac1->int_ep, req, GFP_ATOMIC); in audio_notify()
479 usb_ep_free_request(uac1->int_ep, req); in audio_notify()
481 atomic_dec(&uac1->int_count); in audio_notify()
684 struct f_uac1 *uac1 = func_to_uac1(&audio->func); in out_rq_cur_complete() local
685 struct usb_ctrlrequest *cr = &uac1->setup_cr; in out_rq_cur_complete()
738 struct f_uac1 *uac1 = func_to_uac1(&audio->func); in out_rq_cur() local
747 memcpy(&uac1->setup_cr, cr, sizeof(*cr)); in out_rq_cur()
798 struct f_uac1 *uac1 = func_to_uac1(f); in audio_set_endpoint_req() local
812 uac1->ctl_id = ep; in audio_set_endpoint_req()
843 struct f_uac1 *uac1 = func_to_uac1(f); in audio_get_endpoint_req() local
859 val = uac1->p_srate; in audio_get_endpoint_req()
861 val = uac1->c_srate; in audio_get_endpoint_req()
939 struct f_uac1 *uac1 = func_to_uac1(f); in f_audio_set_alt() local
948 if (intf == uac1->ac_intf) { in f_audio_set_alt()
956 if (uac1->int_ep) { in f_audio_set_alt()
957 usb_ep_disable(uac1->int_ep); in f_audio_set_alt()
958 config_ep_by_speed(gadget, &audio->func, uac1->int_ep); in f_audio_set_alt()
959 usb_ep_enable(uac1->int_ep); in f_audio_set_alt()
965 if (intf == uac1->as_out_intf) { in f_audio_set_alt()
966 uac1->as_out_alt = alt; in f_audio_set_alt()
969 ret = u_audio_start_capture(&uac1->g_audio); in f_audio_set_alt()
971 u_audio_stop_capture(&uac1->g_audio); in f_audio_set_alt()
972 } else if (intf == uac1->as_in_intf) { in f_audio_set_alt()
973 uac1->as_in_alt = alt; in f_audio_set_alt()
976 ret = u_audio_start_playback(&uac1->g_audio); in f_audio_set_alt()
978 u_audio_stop_playback(&uac1->g_audio); in f_audio_set_alt()
992 struct f_uac1 *uac1 = func_to_uac1(f); in f_audio_get_alt() local
994 if (intf == uac1->ac_intf) in f_audio_get_alt()
995 return uac1->ac_alt; in f_audio_get_alt()
996 else if (intf == uac1->as_out_intf) in f_audio_get_alt()
997 return uac1->as_out_alt; in f_audio_get_alt()
998 else if (intf == uac1->as_in_intf) in f_audio_get_alt()
999 return uac1->as_in_alt; in f_audio_get_alt()
1010 struct f_uac1 *uac1 = func_to_uac1(f); in f_audio_disable() local
1012 uac1->as_out_alt = 0; in f_audio_disable()
1013 uac1->as_in_alt = 0; in f_audio_disable()
1015 u_audio_stop_playback(&uac1->g_audio); in f_audio_disable()
1016 u_audio_stop_capture(&uac1->g_audio); in f_audio_disable()
1017 if (uac1->int_ep) in f_audio_disable()
1018 usb_ep_disable(uac1->int_ep); in f_audio_disable()
1024 struct f_uac1 *uac1 = func_to_uac1(f); in f_audio_suspend() local
1026 u_audio_suspend(&uac1->g_audio); in f_audio_suspend()
1237 struct f_uac1 *uac1 = func_to_uac1(f); in f_audio_bind() local
1369 uac1->p_srate = audio_opts->p_srates[0]; in f_audio_bind()
1370 uac1->c_srate = audio_opts->c_srates[0]; in f_audio_bind()
1377 uac1->ac_intf = status; in f_audio_bind()
1378 uac1->ac_alt = 0; in f_audio_bind()
1389 uac1->as_out_intf = status; in f_audio_bind()
1390 uac1->as_out_alt = 0; in f_audio_bind()
1400 uac1->as_in_intf = status; in f_audio_bind()
1401 uac1->as_in_alt = 0; in f_audio_bind()
1415 uac1->int_ep = ep; in f_audio_bind()
1416 uac1->int_ep->desc = &ac_int_ep_desc; in f_audio_bind()
1830 struct f_uac1 *uac1; in f_audio_alloc() local
1834 uac1 = kzalloc(sizeof(*uac1), GFP_KERNEL); in f_audio_alloc()
1835 if (!uac1) in f_audio_alloc()
1843 uac1->g_audio.func.name = "uac1_func"; in f_audio_alloc()
1844 uac1->g_audio.func.bind = f_audio_bind; in f_audio_alloc()
1845 uac1->g_audio.func.unbind = f_audio_unbind; in f_audio_alloc()
1846 uac1->g_audio.func.set_alt = f_audio_set_alt; in f_audio_alloc()
1847 uac1->g_audio.func.get_alt = f_audio_get_alt; in f_audio_alloc()
1848 uac1->g_audio.func.setup = f_audio_setup; in f_audio_alloc()
1849 uac1->g_audio.func.disable = f_audio_disable; in f_audio_alloc()
1850 uac1->g_audio.func.suspend = f_audio_suspend; in f_audio_alloc()
1851 uac1->g_audio.func.free_func = f_audio_free; in f_audio_alloc()
1853 return &uac1->g_audio.func; in f_audio_alloc()
1856 DECLARE_USB_FUNCTION_INIT(uac1, f_audio_alloc_inst, f_audio_alloc);