Lines Matching refs:opts

340 	struct f_uvc_opts *opts;  in uvc_function_get_alt()  local
344 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_get_alt()
350 else if (!opts->streaming_bulk) in uvc_function_get_alt()
370 struct f_uvc_opts *opts; in uvc_function_set_alt() local
375 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_set_alt()
413 if (!opts->streaming_bulk) { in uvc_function_set_alt()
642 struct f_uvc_opts *opts; in uvc_copy_descriptors() local
649 opts = fi_to_f_uvc_opts(uvc->func.fi); in uvc_copy_descriptors()
655 if (!opts->streaming_bulk) in uvc_copy_descriptors()
664 if (!opts->streaming_bulk) in uvc_copy_descriptors()
674 if (!opts->streaming_bulk) in uvc_copy_descriptors()
697 if (!opts->streaming_bulk) in uvc_copy_descriptors()
780 struct f_uvc_opts *opts; in uvc_function_bind() local
786 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
789 if (!opts->streaming_bulk) { in uvc_function_bind()
790 opts->streaming_interval = clamp(opts->streaming_interval, in uvc_function_bind()
792 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, in uvc_function_bind()
794 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
796 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, in uvc_function_bind()
798 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
802 if (opts->streaming_maxburst && in uvc_function_bind()
803 (opts->streaming_maxpacket % 1024) != 0) { in uvc_function_bind()
804 opts->streaming_maxpacket = roundup(opts->streaming_maxpacket, 1024); in uvc_function_bind()
806 opts->streaming_maxpacket); in uvc_function_bind()
815 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
817 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
818 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
820 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
823 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
826 if (!opts->streaming_bulk) { in uvc_function_bind()
828 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
829 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
839 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
843 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
845 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
848 (opts->streaming_maxburst + 1)); in uvc_function_bind()
851 cpu_to_le16(min(opts->streaming_maxpacket, 64U)); in uvc_function_bind()
854 cpu_to_le16(min(opts->streaming_maxpacket, 512U)); in uvc_function_bind()
858 uvc_ss_bulk_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
876 if (!opts->streaming_bulk) in uvc_function_bind()
885 if (!opts->streaming_bulk) { in uvc_function_bind()
898 cpu_to_le16(min(opts->streaming_maxpacket, in uvc_function_bind()
902 if (!opts->streaming_bulk) in uvc_function_bind()
917 if (!opts->streaming_bulk) { in uvc_function_bind()
928 if (opts->device_name) in uvc_function_bind()
929 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->device_name; in uvc_function_bind()
932 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->function_name; in uvc_function_bind()
942 if (!opts->streaming_bulk) { in uvc_function_bind()
955 opts->control_interface = ret; in uvc_function_bind()
960 if (!opts->streaming_bulk) { in uvc_function_bind()
968 opts->streaming_interface = ret; in uvc_function_bind()
1016 if (opts->streaming_bulk) in uvc_function_bind()
1044 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
1046 mutex_destroy(&opts->lock); in uvc_free_inst()
1049 if (opts->device_name_allocated) { in uvc_free_inst()
1050 opts->device_name_allocated = false; in uvc_free_inst()
1051 kfree(opts->device_name); in uvc_free_inst()
1052 opts->device_name = NULL; in uvc_free_inst()
1056 kfree(opts); in uvc_free_inst()
1061 struct f_uvc_opts *opts; in uvc_alloc_inst() local
1070 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
1071 if (!opts) in uvc_alloc_inst()
1073 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
1074 mutex_init(&opts->lock); in uvc_alloc_inst()
1076 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
1092 pd = &opts->uvc_processing; in uvc_alloc_inst()
1105 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
1115 ed = &opts->uvc_extension; in uvc_alloc_inst()
1143 md = &opts->uvc_color_matching; in uvc_alloc_inst()
1152 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
1159 opts->fs_control = in uvc_alloc_inst()
1163 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
1170 opts->ss_control = in uvc_alloc_inst()
1173 opts->streaming_interval = 1; in uvc_alloc_inst()
1174 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
1175 opts->pm_qos_latency = 0; in uvc_alloc_inst()
1176 snprintf(opts->function_name, sizeof(opts->function_name), "UVC Camera"); in uvc_alloc_inst()
1178 ret = uvcg_attach_configfs(opts); in uvc_alloc_inst()
1180 kfree(opts); in uvc_alloc_inst()
1184 return &opts->func_inst; in uvc_alloc_inst()
1190 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
1192 --opts->refcnt; in uvc_free()
1241 struct f_uvc_opts *opts; in uvc_alloc() local
1251 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
1253 mutex_lock(&opts->lock); in uvc_alloc()
1254 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
1255 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
1256 opts->fs_streaming = in uvc_alloc()
1259 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
1260 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
1261 opts->hs_streaming = in uvc_alloc()
1264 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
1265 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
1266 opts->ss_streaming = in uvc_alloc()
1270 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
1271 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
1272 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
1273 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
1274 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
1275 ++opts->refcnt; in uvc_alloc()
1276 mutex_unlock(&opts->lock); in uvc_alloc()