Lines Matching refs:uac2
1035 struct f_uac2 *uac2 = func_to_uac2(fn); in afunc_bind() local
1134 uac2->ac_intf = ret; in afunc_bind()
1135 uac2->ac_alt = 0; in afunc_bind()
1146 uac2->as_out_intf = ret; in afunc_bind()
1147 uac2->as_out_alt = 0; in afunc_bind()
1175 uac2->as_in_intf = ret; in afunc_bind()
1176 uac2->as_in_alt = 0; in afunc_bind()
1180 uac2->int_ep = usb_ep_autoconfig(gadget, &fs_ep_int_desc); in afunc_bind()
1181 if (!uac2->int_ep) { in afunc_bind()
1351 struct f_uac2 *uac2 = func_to_uac2(&agdev->func); in afunc_notify_complete() local
1353 atomic_dec(&uac2->int_count); in afunc_notify_complete()
1361 struct f_uac2 *uac2 = func_to_uac2(&agdev->func); in afunc_notify() local
1367 if (!uac2->int_ep->enabled) in afunc_notify()
1370 if (atomic_inc_return(&uac2->int_count) > UAC2_DEF_INT_REQ_NUM) { in afunc_notify()
1371 atomic_dec(&uac2->int_count); in afunc_notify()
1375 req = usb_ep_alloc_request(uac2->int_ep, GFP_ATOMIC); in afunc_notify()
1387 w_index = unit_id << 8 | uac2->ac_intf; in afunc_notify()
1400 ret = usb_ep_queue(uac2->int_ep, req, GFP_ATOMIC); in afunc_notify()
1410 usb_ep_free_request(uac2->int_ep, req); in afunc_notify()
1412 atomic_dec(&uac2->int_count); in afunc_notify()
1421 struct f_uac2 *uac2 = func_to_uac2(fn); in afunc_set_alt() local
1433 if (intf == uac2->ac_intf) { in afunc_set_alt()
1441 if (uac2->int_ep) { in afunc_set_alt()
1442 usb_ep_disable(uac2->int_ep); in afunc_set_alt()
1443 config_ep_by_speed(gadget, &agdev->func, uac2->int_ep); in afunc_set_alt()
1444 usb_ep_enable(uac2->int_ep); in afunc_set_alt()
1450 if (intf == uac2->as_out_intf) { in afunc_set_alt()
1451 uac2->as_out_alt = alt; in afunc_set_alt()
1454 ret = u_audio_start_capture(&uac2->g_audio); in afunc_set_alt()
1456 u_audio_stop_capture(&uac2->g_audio); in afunc_set_alt()
1457 } else if (intf == uac2->as_in_intf) { in afunc_set_alt()
1458 uac2->as_in_alt = alt; in afunc_set_alt()
1461 ret = u_audio_start_playback(&uac2->g_audio); in afunc_set_alt()
1463 u_audio_stop_playback(&uac2->g_audio); in afunc_set_alt()
1475 struct f_uac2 *uac2 = func_to_uac2(fn); in afunc_get_alt() local
1478 if (intf == uac2->ac_intf) in afunc_get_alt()
1479 return uac2->ac_alt; in afunc_get_alt()
1480 else if (intf == uac2->as_out_intf) in afunc_get_alt()
1481 return uac2->as_out_alt; in afunc_get_alt()
1482 else if (intf == uac2->as_in_intf) in afunc_get_alt()
1483 return uac2->as_in_alt; in afunc_get_alt()
1495 struct f_uac2 *uac2 = func_to_uac2(fn); in afunc_disable() local
1497 uac2->as_in_alt = 0; in afunc_disable()
1498 uac2->as_out_alt = 0; in afunc_disable()
1499 u_audio_stop_capture(&uac2->g_audio); in afunc_disable()
1500 u_audio_stop_playback(&uac2->g_audio); in afunc_disable()
1501 if (uac2->int_ep) in afunc_disable()
1502 usb_ep_disable(uac2->int_ep); in afunc_disable()
1508 struct f_uac2 *uac2 = func_to_uac2(fn); in afunc_suspend() local
1510 u_audio_suspend(&uac2->g_audio); in afunc_suspend()
1697 struct f_uac2 *uac2 = func_to_uac2(fn); in uac2_cs_control_sam_freq() local
1705 if (uac2->clock_id == USB_IN_CLK_ID) { in uac2_cs_control_sam_freq()
1707 } else if (uac2->clock_id == USB_OUT_CLK_ID) { in uac2_cs_control_sam_freq()
1718 struct f_uac2 *uac2 = func_to_uac2(&agdev->func); in out_rq_cur_complete() local
1719 struct usb_ctrlrequest *cr = &uac2->setup_cr; in out_rq_cur_complete()
1767 struct f_uac2 *uac2 = func_to_uac2(fn); in out_rq_cur() local
1780 uac2->clock_id = clock_id; in out_rq_cur()
1786 memcpy(&uac2->setup_cr, cr, sizeof(*cr)); in out_rq_cur()
1802 struct f_uac2 *uac2 = func_to_uac2(fn); in setup_rq_inf() local
1807 if (intf != uac2->ac_intf) { in setup_rq_inf()
2216 struct f_uac2 *uac2; in afunc_alloc() local
2219 uac2 = kzalloc(sizeof(*uac2), GFP_KERNEL); in afunc_alloc()
2220 if (uac2 == NULL) in afunc_alloc()
2228 uac2->g_audio.func.name = "uac2_func"; in afunc_alloc()
2229 uac2->g_audio.func.bind = afunc_bind; in afunc_alloc()
2230 uac2->g_audio.func.unbind = afunc_unbind; in afunc_alloc()
2231 uac2->g_audio.func.set_alt = afunc_set_alt; in afunc_alloc()
2232 uac2->g_audio.func.get_alt = afunc_get_alt; in afunc_alloc()
2233 uac2->g_audio.func.disable = afunc_disable; in afunc_alloc()
2234 uac2->g_audio.func.suspend = afunc_suspend; in afunc_alloc()
2235 uac2->g_audio.func.setup = afunc_setup; in afunc_alloc()
2236 uac2->g_audio.func.free_func = afunc_free; in afunc_alloc()
2238 return &uac2->g_audio.func; in afunc_alloc()
2241 DECLARE_USB_FUNCTION_INIT(uac2, afunc_alloc_inst, afunc_alloc);