Lines Matching refs:opts

652 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
657 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
659 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
660 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
661 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
664 if (opts->streaming_maxburst && in uvc_function_bind()
665 (opts->streaming_maxpacket % 1024) != 0) { in uvc_function_bind()
666 opts->streaming_maxpacket = roundup(opts->streaming_maxpacket, 1024); in uvc_function_bind()
668 opts->streaming_maxpacket); in uvc_function_bind()
678 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
680 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
681 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
683 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
686 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
690 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
691 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
700 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
703 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
705 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
708 (opts->streaming_maxburst + 1)); in uvc_function_bind()
711 if (opts->enable_interrupt_ep) { in uvc_function_bind()
720 uvc->enable_interrupt_ep = opts->enable_interrupt_ep; in uvc_function_bind()
752 list_for_each_entry(xu, &opts->extension_units, list) in uvc_function_bind()
760 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->function_name; in uvc_function_bind()
768 uvc_iad.iFunction = opts->iad_index ? cdev->usb_strings[opts->iad_index].id : in uvc_function_bind()
770 uvc_streaming_intf_alt0.iInterface = opts->vs0_index ? in uvc_function_bind()
771 cdev->usb_strings[opts->vs0_index].id : in uvc_function_bind()
773 uvc_streaming_intf_alt1.iInterface = opts->vs1_index ? in uvc_function_bind()
774 cdev->usb_strings[opts->vs1_index].id : in uvc_function_bind()
783 opts->control_interface = ret; in uvc_function_bind()
790 opts->streaming_interface = ret; in uvc_function_bind()
862 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
864 mutex_destroy(&opts->lock); in uvc_free_inst()
865 kfree(opts); in uvc_free_inst()
870 struct f_uvc_opts *opts; in uvc_alloc_inst() local
877 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
878 if (!opts) in uvc_alloc_inst()
880 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
881 mutex_init(&opts->lock); in uvc_alloc_inst()
883 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
899 pd = &opts->uvc_processing; in uvc_alloc_inst()
912 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
927 opts->last_unit_id = 3; in uvc_alloc_inst()
930 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
936 opts->fs_control = in uvc_alloc_inst()
940 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
946 opts->ss_control = in uvc_alloc_inst()
949 INIT_LIST_HEAD(&opts->extension_units); in uvc_alloc_inst()
951 opts->streaming_interval = 1; in uvc_alloc_inst()
952 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
953 snprintf(opts->function_name, sizeof(opts->function_name), "UVC Camera"); in uvc_alloc_inst()
955 ret = uvcg_attach_configfs(opts); in uvc_alloc_inst()
957 kfree(opts); in uvc_alloc_inst()
961 return &opts->func_inst; in uvc_alloc_inst()
967 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
969 if (!opts->header) in uvc_free()
971 --opts->refcnt; in uvc_free()
1026 struct f_uvc_opts *opts; in uvc_alloc() local
1037 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
1039 mutex_lock(&opts->lock); in uvc_alloc()
1040 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
1041 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
1042 opts->fs_streaming = in uvc_alloc()
1045 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
1046 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
1047 opts->hs_streaming = in uvc_alloc()
1050 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
1051 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
1052 opts->ss_streaming = in uvc_alloc()
1056 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
1057 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
1058 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
1059 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
1060 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
1062 if (opts->header) { in uvc_alloc()
1063 uvc->header = opts->header; in uvc_alloc()
1065 streaming = config_group_find_item(&opts->func_inst.group, "streaming"); in uvc_alloc()
1081 mutex_unlock(&opts->lock); in uvc_alloc()
1087 uvc->desc.extension_units = &opts->extension_units; in uvc_alloc()
1089 ++opts->refcnt; in uvc_alloc()
1090 mutex_unlock(&opts->lock); in uvc_alloc()
1106 mutex_unlock(&opts->lock); in uvc_alloc()