There are no users of the old interface left. Remove it. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> --- drivers/usb/gadget/f_uvc.c | 129 -------------------------------------------- 1 files changed, 0 insertions(+), 129 deletions(-) diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c index cadc248..fcf398a 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c @@ -439,16 +439,12 @@ static const struct usb_descriptor_header * const uvc_ss_streaming[] = { NULL, }; -#ifndef USBF_UVC_INCLUDED - void uvc_set_trace_param(unsigned int uvc_gadget_trace_param_webcam) { uvc_gadget_trace_param = uvc_gadget_trace_param_webcam; } EXPORT_SYMBOL(uvc_set_trace_param); -#endif - /* -------------------------------------------------------------------------- * Control requests */ @@ -808,44 +804,6 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) INFO(cdev, "uvc_function_bind\n"); -#ifdef USBF_UVC_INCLUDED - /* Sanity check the streaming endpoint module parameters. - */ - streaming_interval = clamp(streaming_interval, 1U, 16U); - streaming_maxpacket = clamp(streaming_maxpacket, 1U, 3072U); - streaming_maxburst = min(streaming_maxburst, 15U); - - /* Fill in the FS/HS/SS Video Streaming specific descriptors from the - * module parameters. - * - * NOTE: We assume that the user knows what they are doing and won't - * give parameters that their UDC doesn't support. - */ - if (streaming_maxpacket <= 1024) { - max_packet_mult = 1; - max_packet_size = streaming_maxpacket; - } else if (streaming_maxpacket <= 2048) { - max_packet_mult = 2; - max_packet_size = streaming_maxpacket / 2; - } else { - max_packet_mult = 3; - max_packet_size = streaming_maxpacket / 3; - } - - uvc_fs_streaming_ep.wMaxPacketSize = min(streaming_maxpacket, 1023U); - uvc_fs_streaming_ep.bInterval = streaming_interval; - - uvc_hs_streaming_ep.wMaxPacketSize = max_packet_size; - uvc_hs_streaming_ep.wMaxPacketSize |= ((max_packet_mult - 1) << 11); - uvc_hs_streaming_ep.bInterval = streaming_interval; - - uvc_ss_streaming_ep.wMaxPacketSize = max_packet_size; - uvc_ss_streaming_ep.bInterval = streaming_interval; - uvc_ss_streaming_comp.bmAttributes = max_packet_mult - 1; - uvc_ss_streaming_comp.bMaxBurst = streaming_maxburst; - uvc_ss_streaming_comp.wBytesPerInterval = - max_packet_size * max_packet_mult * streaming_maxburst; -#else opts = container_of(f->fi, struct f_uvc_opts, func_inst); /* Sanity check the streaming endpoint module parameters. */ @@ -884,7 +842,6 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f) uvc_ss_streaming_comp.bMaxBurst = opts->streaming_maxburst; uvc_ss_streaming_comp.wBytesPerInterval = max_packet_size * max_packet_mult * opts->streaming_maxburst; -#endif /* Allocate endpoints. */ ep = usb_ep_autoconfig(cdev->gadget, &uvc_control_ep); @@ -1011,88 +968,6 @@ error: * USB gadget function */ -#ifdef USBF_UVC_INCLUDED - -static void -uvc_old_function_unbind(struct usb_configuration *c, struct usb_function *f) -{ - struct usb_composite_dev *cdev = c->cdev; - struct uvc_device *uvc = to_uvc(f); - - INFO(cdev, "uvc_function_unbind\n"); - - video_unregister_device(uvc->vdev); - v4l2_device_unregister(&uvc->v4l2_dev); - uvc->control_ep->driver_data = NULL; - uvc->video.ep->driver_data = NULL; - - uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id = 0; - usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); - kfree(uvc->control_buf); - - usb_free_all_descriptors(f); - - kfree(uvc); -} - -/** - * uvc_bind_config - add a UVC function to a configuration - * @c: the configuration to support the UVC instance - * Context: single threaded during gadget setup - * - * Returns zero on success, else negative errno. - * - * Caller must have called @uvc_setup(). Caller is also responsible for - * calling @uvc_cleanup() before module unload. - */ -int __init -uvc_bind_config(struct usb_configuration *c, - unsigned int streaming_interval_webcam, - unsigned int streaming_maxpacket_webcam, - unsigned int streaming_maxburst_webcam, - unsigned int uvc_gadget_trace_webcam) -{ - struct uvc_device *uvc; - int ret = 0; - - /* TODO Check if the USB device controller supports the required - * features. - */ - if (!gadget_is_dualspeed(c->cdev->gadget)) - return -EINVAL; - - uvc = kzalloc(sizeof(*uvc), GFP_KERNEL); - if (uvc == NULL) - return -ENOMEM; - - uvc->state = UVC_STATE_DISCONNECTED; - - - uvc->desc.fs_control = uvc_fs_control_cls; - uvc->desc.ss_control = uvc_ss_control_cls; - uvc->desc.fs_streaming = uvc_fs_streaming_cls; - uvc->desc.hs_streaming = uvc_hs_streaming_cls; - uvc->desc.ss_streaming = uvc_ss_streaming_cls; - - /* Register the function. */ - uvc->func.name = "uvc"; - uvc->func.strings = uvc_function_strings; - uvc->func.bind = uvc_function_bind; - uvc->func.unbind = uvc_old_function_unbind; - uvc->func.get_alt = uvc_function_get_alt; - uvc->func.set_alt = uvc_function_set_alt; - uvc->func.disable = uvc_function_disable; - uvc->func.setup = uvc_function_setup; - - ret = usb_add_function(c, &uvc->func); - if (ret) - kfree(uvc); - - return ret; -} - -#else - static void uvc_free_inst(struct usb_function_instance *f) { struct f_uvc_opts *opts; @@ -1174,7 +1049,3 @@ struct usb_function *uvc_alloc(struct usb_function_instance *fi) DECLARE_USB_FUNCTION_INIT(uvc, uvc_alloc_inst, uvc_alloc); MODULE_LICENSE("GPL"); MODULE_AUTHOR("Laurent Pinchart"); - -#endif - - -- 1.7.0.4 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html