Lines Matching refs:opts

658 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
663 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
665 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
666 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
667 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
670 if (opts->streaming_maxburst && in uvc_function_bind()
671 (opts->streaming_maxpacket % 1024) != 0) { in uvc_function_bind()
672 opts->streaming_maxpacket = roundup(opts->streaming_maxpacket, 1024); in uvc_function_bind()
674 opts->streaming_maxpacket); in uvc_function_bind()
684 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
686 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
687 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
689 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
692 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
696 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
697 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
706 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
709 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
711 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
714 (opts->streaming_maxburst + 1)); in uvc_function_bind()
717 if (opts->enable_interrupt_ep) { in uvc_function_bind()
726 uvc->enable_interrupt_ep = opts->enable_interrupt_ep; in uvc_function_bind()
758 list_for_each_entry(xu, &opts->extension_units, list) in uvc_function_bind()
766 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->function_name; in uvc_function_bind()
774 uvc_iad.iFunction = opts->iad_index ? cdev->usb_strings[opts->iad_index].id : in uvc_function_bind()
776 uvc_streaming_intf_alt0.iInterface = opts->vs0_index ? in uvc_function_bind()
777 cdev->usb_strings[opts->vs0_index].id : in uvc_function_bind()
779 uvc_streaming_intf_alt1.iInterface = opts->vs1_index ? in uvc_function_bind()
780 cdev->usb_strings[opts->vs1_index].id : in uvc_function_bind()
789 opts->control_interface = ret; in uvc_function_bind()
796 opts->streaming_interface = ret; in uvc_function_bind()
875 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
877 mutex_destroy(&opts->lock); in uvc_free_inst()
878 kfree(opts); in uvc_free_inst()
883 struct f_uvc_opts *opts; in uvc_alloc_inst() local
890 opts = kzalloc_obj(*opts); in uvc_alloc_inst()
891 if (!opts) in uvc_alloc_inst()
893 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
894 mutex_init(&opts->lock); in uvc_alloc_inst()
896 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
912 pd = &opts->uvc_processing; in uvc_alloc_inst()
925 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
940 opts->last_unit_id = 3; in uvc_alloc_inst()
943 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
949 opts->fs_control = in uvc_alloc_inst()
953 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
959 opts->ss_control = in uvc_alloc_inst()
962 INIT_LIST_HEAD(&opts->extension_units); in uvc_alloc_inst()
964 opts->streaming_interval = 1; in uvc_alloc_inst()
965 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
966 snprintf(opts->function_name, sizeof(opts->function_name), "UVC Camera"); in uvc_alloc_inst()
968 ret = uvcg_attach_configfs(opts); in uvc_alloc_inst()
970 kfree(opts); in uvc_alloc_inst()
974 return &opts->func_inst; in uvc_alloc_inst()
980 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
982 if (!opts->header) in uvc_free()
984 --opts->refcnt; in uvc_free()
1041 struct f_uvc_opts *opts; in uvc_alloc() local
1052 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
1054 mutex_lock(&opts->lock); in uvc_alloc()
1055 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
1056 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
1057 opts->fs_streaming = in uvc_alloc()
1060 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
1061 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
1062 opts->hs_streaming = in uvc_alloc()
1065 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
1066 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
1067 opts->ss_streaming = in uvc_alloc()
1071 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
1072 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
1073 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
1074 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
1075 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
1077 if (opts->header) { in uvc_alloc()
1078 uvc->header = opts->header; in uvc_alloc()
1080 streaming = config_group_find_item(&opts->func_inst.group, "streaming"); in uvc_alloc()
1096 mutex_unlock(&opts->lock); in uvc_alloc()
1102 uvc->desc.extension_units = &opts->extension_units; in uvc_alloc()
1104 ++opts->refcnt; in uvc_alloc()
1105 mutex_unlock(&opts->lock); in uvc_alloc()
1121 mutex_unlock(&opts->lock); in uvc_alloc()