Lines Matching refs:uac2_opts
671 static int get_max_bw_for_bint(const struct f_uac2_opts *uac2_opts, in get_max_bw_for_bint() argument
678 chmask = uac2_opts->p_chmask; in get_max_bw_for_bint()
679 srate = get_max_srate(uac2_opts->p_srates); in get_max_bw_for_bint()
680 ssize = uac2_opts->p_ssize; in get_max_bw_for_bint()
682 chmask = uac2_opts->c_chmask; in get_max_bw_for_bint()
683 srate = get_max_srate(uac2_opts->c_srates); in get_max_bw_for_bint()
684 ssize = uac2_opts->c_ssize; in get_max_bw_for_bint()
687 if (is_playback || (uac2_opts->c_sync == USB_ENDPOINT_SYNC_ASYNC)) { in get_max_bw_for_bint()
690 srate = srate * (1000 + uac2_opts->fb_max) / 1000; in get_max_bw_for_bint()
702 static int set_ep_max_packet_size_bint(struct device *dev, const struct f_uac2_opts *uac2_opts, in set_ep_max_packet_size_bint() argument
715 max_size_bw = get_max_bw_for_bint(uac2_opts, bint, 1000, is_playback); in set_ep_max_packet_size_bint()
722 opts_bint = uac2_opts->p_hs_bint; in set_ep_max_packet_size_bint()
724 opts_bint = uac2_opts->c_hs_bint; in set_ep_max_packet_size_bint()
729 max_size_bw = get_max_bw_for_bint(uac2_opts, bint, 8000, is_playback); in set_ep_max_packet_size_bint()
734 uac2_opts, bint, 8000, is_playback); in set_ep_max_packet_size_bint()
1030 struct f_uac2_opts *uac2_opts = g_audio_to_uac2_opts(agdev); in afunc_bind() local
1038 strings_fn[STR_ASSOC].s = uac2_opts->function_name; in afunc_bind()
1039 strings_fn[STR_IF_CTRL].s = uac2_opts->if_ctrl_name; in afunc_bind()
1040 strings_fn[STR_CLKSRC_IN].s = uac2_opts->clksrc_in_name; in afunc_bind()
1041 strings_fn[STR_CLKSRC_OUT].s = uac2_opts->clksrc_out_name; in afunc_bind()
1043 strings_fn[STR_USB_IT].s = uac2_opts->c_it_name; in afunc_bind()
1044 strings_fn[STR_USB_IT_CH].s = uac2_opts->c_it_ch_name; in afunc_bind()
1045 strings_fn[STR_IO_OT].s = uac2_opts->c_ot_name; in afunc_bind()
1046 strings_fn[STR_FU_OUT].s = uac2_opts->c_fu_vol_name; in afunc_bind()
1050 strings_fn[STR_IO_IT].s = uac2_opts->p_it_name; in afunc_bind()
1051 strings_fn[STR_IO_IT_CH].s = uac2_opts->p_it_ch_name; in afunc_bind()
1052 strings_fn[STR_USB_OT].s = uac2_opts->p_ot_name; in afunc_bind()
1053 strings_fn[STR_FU_IN].s = uac2_opts->p_fu_vol_name; in afunc_bind()
1061 if (FUOUT_EN(uac2_opts)) { in afunc_bind()
1062 out_feature_unit_desc = build_fu_desc(uac2_opts->c_chmask); in afunc_bind()
1066 if (FUIN_EN(uac2_opts)) { in afunc_bind()
1067 in_feature_unit_desc = build_fu_desc(uac2_opts->p_chmask); in afunc_bind()
1089 if (FUOUT_EN(uac2_opts)) { in afunc_bind()
1094 if (FUIN_EN(uac2_opts)) { in afunc_bind()
1102 usb_out_it_desc.bNrChannels = num_channels(uac2_opts->c_chmask); in afunc_bind()
1103 usb_out_it_desc.bmChannelConfig = cpu_to_le32(uac2_opts->c_chmask); in afunc_bind()
1104 io_in_it_desc.bNrChannels = num_channels(uac2_opts->p_chmask); in afunc_bind()
1105 io_in_it_desc.bmChannelConfig = cpu_to_le32(uac2_opts->p_chmask); in afunc_bind()
1106 as_out_hdr_desc.bNrChannels = num_channels(uac2_opts->c_chmask); in afunc_bind()
1107 as_out_hdr_desc.bmChannelConfig = cpu_to_le32(uac2_opts->c_chmask); in afunc_bind()
1108 as_in_hdr_desc.bNrChannels = num_channels(uac2_opts->p_chmask); in afunc_bind()
1109 as_in_hdr_desc.bmChannelConfig = cpu_to_le32(uac2_opts->p_chmask); in afunc_bind()
1110 as_out_fmt1_desc.bSubslotSize = uac2_opts->c_ssize; in afunc_bind()
1111 as_out_fmt1_desc.bBitResolution = uac2_opts->c_ssize * 8; in afunc_bind()
1112 as_in_fmt1_desc.bSubslotSize = uac2_opts->p_ssize; in afunc_bind()
1113 as_in_fmt1_desc.bBitResolution = uac2_opts->p_ssize * 8; in afunc_bind()
1114 if (FUOUT_EN(uac2_opts)) { in afunc_bind()
1118 if (uac2_opts->c_mute_present) in afunc_bind()
1120 if (uac2_opts->c_volume_present) in afunc_bind()
1124 if (FUIN_EN(uac2_opts)) { in afunc_bind()
1128 if (uac2_opts->p_mute_present) in afunc_bind()
1130 if (uac2_opts->p_volume_present) in afunc_bind()
1146 if (EPOUT_EN(uac2_opts)) { in afunc_bind()
1158 if (EPOUT_FBACK_IN_EN(uac2_opts)) { in afunc_bind()
1176 if (EPIN_EN(uac2_opts)) { in afunc_bind()
1189 if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) { in afunc_bind()
1200 hs_epin_desc.bInterval = uac2_opts->p_hs_bint; in afunc_bind()
1201 ss_epin_desc.bInterval = uac2_opts->p_hs_bint; in afunc_bind()
1202 hs_epout_desc.bInterval = uac2_opts->c_hs_bint; in afunc_bind()
1203 ss_epout_desc.bInterval = uac2_opts->c_hs_bint; in afunc_bind()
1206 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &fs_epin_desc, in afunc_bind()
1213 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &fs_epout_desc, in afunc_bind()
1220 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &hs_epin_desc, in afunc_bind()
1227 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &hs_epout_desc, in afunc_bind()
1234 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &ss_epin_desc, in afunc_bind()
1241 ret = set_ep_max_packet_size_bint(dev, uac2_opts, &ss_epout_desc, in afunc_bind()
1248 if (EPOUT_EN(uac2_opts)) { in afunc_bind()
1255 if (EPOUT_FBACK_IN_EN(uac2_opts)) { in afunc_bind()
1267 if (EPIN_EN(uac2_opts)) { in afunc_bind()
1301 setup_descriptor(uac2_opts); in afunc_bind()
1310 agdev->params.p_chmask = uac2_opts->p_chmask; in afunc_bind()
1311 memcpy(agdev->params.p_srates, uac2_opts->p_srates, in afunc_bind()
1313 agdev->params.p_ssize = uac2_opts->p_ssize; in afunc_bind()
1314 if (FUIN_EN(uac2_opts)) { in afunc_bind()
1316 agdev->params.p_fu.mute_present = uac2_opts->p_mute_present; in afunc_bind()
1317 agdev->params.p_fu.volume_present = uac2_opts->p_volume_present; in afunc_bind()
1318 agdev->params.p_fu.volume_min = uac2_opts->p_volume_min; in afunc_bind()
1319 agdev->params.p_fu.volume_max = uac2_opts->p_volume_max; in afunc_bind()
1320 agdev->params.p_fu.volume_res = uac2_opts->p_volume_res; in afunc_bind()
1322 agdev->params.c_chmask = uac2_opts->c_chmask; in afunc_bind()
1323 memcpy(agdev->params.c_srates, uac2_opts->c_srates, in afunc_bind()
1325 agdev->params.c_ssize = uac2_opts->c_ssize; in afunc_bind()
1326 if (FUOUT_EN(uac2_opts)) { in afunc_bind()
1328 agdev->params.c_fu.mute_present = uac2_opts->c_mute_present; in afunc_bind()
1329 agdev->params.c_fu.volume_present = uac2_opts->c_volume_present; in afunc_bind()
1330 agdev->params.c_fu.volume_min = uac2_opts->c_volume_min; in afunc_bind()
1331 agdev->params.c_fu.volume_max = uac2_opts->c_volume_max; in afunc_bind()
1332 agdev->params.c_fu.volume_res = uac2_opts->c_volume_res; in afunc_bind()
1334 agdev->params.req_number = uac2_opts->req_number; in afunc_bind()
1335 agdev->params.fb_max = uac2_opts->fb_max; in afunc_bind()
1337 if (FUOUT_EN(uac2_opts) || FUIN_EN(uac2_opts)) in afunc_bind()