Lines Matching refs:opts

602 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
607 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
610 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
611 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
612 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
620 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
622 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
623 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
625 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
628 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
632 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
633 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
637 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
640 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
642 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
645 opts->streaming_maxburst); in uvc_function_bind()
783 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
785 mutex_destroy(&opts->lock); in uvc_free_inst()
786 kfree(opts); in uvc_free_inst()
791 struct f_uvc_opts *opts; in uvc_alloc_inst() local
798 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
799 if (!opts) in uvc_alloc_inst()
801 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
802 mutex_init(&opts->lock); in uvc_alloc_inst()
804 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
820 pd = &opts->uvc_processing; in uvc_alloc_inst()
832 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
842 md = &opts->uvc_color_matching; in uvc_alloc_inst()
851 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
857 opts->fs_control = in uvc_alloc_inst()
861 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
867 opts->ss_control = in uvc_alloc_inst()
870 opts->streaming_interval = 1; in uvc_alloc_inst()
871 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
873 uvcg_attach_configfs(opts); in uvc_alloc_inst()
874 return &opts->func_inst; in uvc_alloc_inst()
880 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
882 --opts->refcnt; in uvc_free()
907 struct f_uvc_opts *opts; in uvc_alloc() local
916 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
918 mutex_lock(&opts->lock); in uvc_alloc()
919 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
920 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
921 opts->fs_streaming = in uvc_alloc()
924 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
925 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
926 opts->hs_streaming = in uvc_alloc()
929 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
930 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
931 opts->ss_streaming = in uvc_alloc()
935 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
936 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
937 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
938 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
939 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
940 ++opts->refcnt; in uvc_alloc()
941 mutex_unlock(&opts->lock); in uvc_alloc()