Lines Matching refs:opts

600 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
605 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
607 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
608 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
609 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
612 if (opts->streaming_maxburst && in uvc_function_bind()
613 (opts->streaming_maxpacket % 1024) != 0) { in uvc_function_bind()
614 opts->streaming_maxpacket = roundup(opts->streaming_maxpacket, 1024); in uvc_function_bind()
616 opts->streaming_maxpacket); in uvc_function_bind()
626 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
628 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
629 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
631 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
634 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
638 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
639 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
648 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
651 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
653 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
656 (opts->streaming_maxburst + 1)); in uvc_function_bind()
684 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].s = opts->function_name; in uvc_function_bind()
703 opts->control_interface = ret; in uvc_function_bind()
710 opts->streaming_interface = ret; in uvc_function_bind()
784 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
786 mutex_destroy(&opts->lock); in uvc_free_inst()
787 kfree(opts); in uvc_free_inst()
792 struct f_uvc_opts *opts; in uvc_alloc_inst() local
800 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
801 if (!opts) in uvc_alloc_inst()
803 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
804 mutex_init(&opts->lock); in uvc_alloc_inst()
806 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
822 pd = &opts->uvc_processing; in uvc_alloc_inst()
835 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
845 md = &opts->uvc_color_matching; in uvc_alloc_inst()
854 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
860 opts->fs_control = in uvc_alloc_inst()
864 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
870 opts->ss_control = in uvc_alloc_inst()
873 opts->streaming_interval = 1; in uvc_alloc_inst()
874 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
875 snprintf(opts->function_name, sizeof(opts->function_name), "UVC Camera"); in uvc_alloc_inst()
877 ret = uvcg_attach_configfs(opts); in uvc_alloc_inst()
879 kfree(opts); in uvc_alloc_inst()
883 return &opts->func_inst; in uvc_alloc_inst()
889 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
892 --opts->refcnt; in uvc_free()
947 struct f_uvc_opts *opts; in uvc_alloc() local
958 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
960 mutex_lock(&opts->lock); in uvc_alloc()
961 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
962 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
963 opts->fs_streaming = in uvc_alloc()
966 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
967 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
968 opts->hs_streaming = in uvc_alloc()
971 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
972 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
973 opts->ss_streaming = in uvc_alloc()
977 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
978 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
979 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
980 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
981 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
983 streaming = config_group_find_item(&opts->func_inst.group, "streaming"); in uvc_alloc()
999 mutex_unlock(&opts->lock); in uvc_alloc()
1004 ++opts->refcnt; in uvc_alloc()
1005 mutex_unlock(&opts->lock); in uvc_alloc()
1021 mutex_unlock(&opts->lock); in uvc_alloc()