Lines Matching refs:opts

585 	struct f_uvc_opts *opts;  in uvc_function_bind()  local
590 opts = fi_to_f_uvc_opts(f->fi); in uvc_function_bind()
593 opts->streaming_interval = clamp(opts->streaming_interval, 1U, 16U); in uvc_function_bind()
594 opts->streaming_maxpacket = clamp(opts->streaming_maxpacket, 1U, 3072U); in uvc_function_bind()
595 opts->streaming_maxburst = min(opts->streaming_maxburst, 15U); in uvc_function_bind()
603 if (opts->streaming_maxpacket <= 1024) { in uvc_function_bind()
605 max_packet_size = opts->streaming_maxpacket; in uvc_function_bind()
606 } else if (opts->streaming_maxpacket <= 2048) { in uvc_function_bind()
608 max_packet_size = opts->streaming_maxpacket / 2; in uvc_function_bind()
611 max_packet_size = opts->streaming_maxpacket / 3; in uvc_function_bind()
615 cpu_to_le16(min(opts->streaming_maxpacket, 1023U)); in uvc_function_bind()
616 uvc_fs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
620 uvc_hs_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
623 uvc_ss_streaming_ep.bInterval = opts->streaming_interval; in uvc_function_bind()
625 uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; in uvc_function_bind()
628 opts->streaming_maxburst); in uvc_function_bind()
753 struct f_uvc_opts *opts = fi_to_f_uvc_opts(f); in uvc_free_inst() local
755 mutex_destroy(&opts->lock); in uvc_free_inst()
756 kfree(opts); in uvc_free_inst()
761 struct f_uvc_opts *opts; in uvc_alloc_inst() local
768 opts = kzalloc(sizeof(*opts), GFP_KERNEL); in uvc_alloc_inst()
769 if (!opts) in uvc_alloc_inst()
771 opts->func_inst.free_func_inst = uvc_free_inst; in uvc_alloc_inst()
772 mutex_init(&opts->lock); in uvc_alloc_inst()
774 cd = &opts->uvc_camera_terminal; in uvc_alloc_inst()
790 pd = &opts->uvc_processing; in uvc_alloc_inst()
802 od = &opts->uvc_output_terminal; in uvc_alloc_inst()
812 md = &opts->uvc_color_matching; in uvc_alloc_inst()
821 ctl_cls = opts->uvc_fs_control_cls; in uvc_alloc_inst()
827 opts->fs_control = in uvc_alloc_inst()
831 ctl_cls = opts->uvc_ss_control_cls; in uvc_alloc_inst()
837 opts->ss_control = in uvc_alloc_inst()
840 opts->streaming_interval = 1; in uvc_alloc_inst()
841 opts->streaming_maxpacket = 1024; in uvc_alloc_inst()
843 uvcg_attach_configfs(opts); in uvc_alloc_inst()
844 return &opts->func_inst; in uvc_alloc_inst()
850 struct f_uvc_opts *opts = container_of(f->fi, struct f_uvc_opts, in uvc_free() local
852 --opts->refcnt; in uvc_free()
875 struct f_uvc_opts *opts; in uvc_alloc() local
884 opts = fi_to_f_uvc_opts(fi); in uvc_alloc()
886 mutex_lock(&opts->lock); in uvc_alloc()
887 if (opts->uvc_fs_streaming_cls) { in uvc_alloc()
888 strm_cls = opts->uvc_fs_streaming_cls; in uvc_alloc()
889 opts->fs_streaming = in uvc_alloc()
892 if (opts->uvc_hs_streaming_cls) { in uvc_alloc()
893 strm_cls = opts->uvc_hs_streaming_cls; in uvc_alloc()
894 opts->hs_streaming = in uvc_alloc()
897 if (opts->uvc_ss_streaming_cls) { in uvc_alloc()
898 strm_cls = opts->uvc_ss_streaming_cls; in uvc_alloc()
899 opts->ss_streaming = in uvc_alloc()
903 uvc->desc.fs_control = opts->fs_control; in uvc_alloc()
904 uvc->desc.ss_control = opts->ss_control; in uvc_alloc()
905 uvc->desc.fs_streaming = opts->fs_streaming; in uvc_alloc()
906 uvc->desc.hs_streaming = opts->hs_streaming; in uvc_alloc()
907 uvc->desc.ss_streaming = opts->ss_streaming; in uvc_alloc()
908 ++opts->refcnt; in uvc_alloc()
909 mutex_unlock(&opts->lock); in uvc_alloc()