Lines Matching refs:opts

654 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
659 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
661 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
662 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
663 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
666 if (opts->streaming_maxburst && in uvc_function_bind()
667 (opts->streaming_maxpacket % 1024) != 0) { in uvc_function_bind()
668 opts->streaming_maxpacket = roundup(opts->streaming_maxpacket, 1024); in uvc_function_bind()
670 opts->streaming_maxpacket); in uvc_function_bind()
680 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
682 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
683 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
685 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
688 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
692 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
693 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
702 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
705 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
707 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
710 (opts->streaming_maxburst + 1)); in uvc_function_bind()
713 if (opts->enable_interrupt_ep) { in uvc_function_bind()
722 uvc->enable_interrupt_ep = opts->enable_interrupt_ep; in uvc_function_bind()
754 list_for_each_entry(xu, &opts->extension_units, list) in uvc_function_bind()
762 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->function_name; in uvc_function_bind()
770 uvc_iad.iFunction = opts->iad_index ? cdev->usb_strings[opts->iad_index].id : in uvc_function_bind()
772 uvc_streaming_intf_alt0.iInterface = opts->vs0_index ? in uvc_function_bind()
773 cdev->usb_strings[opts->vs0_index].id : in uvc_function_bind()
775 uvc_streaming_intf_alt1.iInterface = opts->vs1_index ? in uvc_function_bind()
776 cdev->usb_strings[opts->vs1_index].id : in uvc_function_bind()
785 opts->control_interface = ret; in uvc_function_bind()
792 opts->streaming_interface = ret; in uvc_function_bind()
871 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
873 mutex_destroy(&opts->lock); in uvc_free_inst()
874 kfree(opts); in uvc_free_inst()
879 struct f_uvc_opts *opts; in uvc_alloc_inst() local
886 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
887 if (!opts) in uvc_alloc_inst()
889 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
890 mutex_init(&opts->lock); in uvc_alloc_inst()
892 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
908 pd = &opts->uvc_processing; in uvc_alloc_inst()
921 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
936 opts->last_unit_id = 3; in uvc_alloc_inst()
939 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
945 opts->fs_control = in uvc_alloc_inst()
949 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
955 opts->ss_control = in uvc_alloc_inst()
958 INIT_LIST_HEAD(&opts->extension_units); in uvc_alloc_inst()
960 opts->streaming_interval = 1; in uvc_alloc_inst()
961 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
962 snprintf(opts->function_name, sizeof(opts->function_name), "UVC Camera"); in uvc_alloc_inst()
964 ret = uvcg_attach_configfs(opts); in uvc_alloc_inst()
966 kfree(opts); in uvc_alloc_inst()
970 return &opts->func_inst; in uvc_alloc_inst()
976 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
978 if (!opts->header) in uvc_free()
980 --opts->refcnt; in uvc_free()
1037 struct f_uvc_opts *opts; in uvc_alloc() local
1048 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
1050 mutex_lock(&opts->lock); in uvc_alloc()
1051 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
1052 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
1053 opts->fs_streaming = in uvc_alloc()
1056 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
1057 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
1058 opts->hs_streaming = in uvc_alloc()
1061 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
1062 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
1063 opts->ss_streaming = in uvc_alloc()
1067 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
1068 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
1069 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
1070 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
1071 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
1073 if (opts->header) { in uvc_alloc()
1074 uvc->header = opts->header; in uvc_alloc()
1076 streaming = config_group_find_item(&opts->func_inst.group, "streaming"); in uvc_alloc()
1092 mutex_unlock(&opts->lock); in uvc_alloc()
1098 uvc->desc.extension_units = &opts->extension_units; in uvc_alloc()
1100 ++opts->refcnt; in uvc_alloc()
1101 mutex_unlock(&opts->lock); in uvc_alloc()
1117 mutex_unlock(&opts->lock); in uvc_alloc()