When configfs support is integrated the future uvc function module must not take any parameters. Move parameters to webcam. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx> --- drivers/usb/gadget/f_uvc.c | 27 +++++++++++++-------------- drivers/usb/gadget/f_uvc.h | 6 +++++- drivers/usb/gadget/webcam.c | 27 ++++++++++++++++++++++++++- 3 files changed, 44 insertions(+), 16 deletions(-) diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c index ac0ac82..aecd2db 100644 --- a/drivers/usb/gadget/f_uvc.c +++ b/drivers/usb/gadget/f_uvc.c @@ -29,6 +29,10 @@ #include "uvc.h" unsigned int uvc_gadget_trace_param; +unsigned int streaming_interval; +unsigned int streaming_maxpacket; +unsigned int streaming_maxburst; + DECLARE_UVC_HEADER_DESCRIPTOR(1); static const struct UVC_HEADER_DESCRIPTOR(1) uvc_control_header = { @@ -170,7 +174,6 @@ static const struct uvc_format_mjpeg uvc_format_mjpg = { .bCopyProtect = 0, }; -/*-------------------------------------------------------------------------*/ DECLARE_UVC_FRAME_MJPEG(1); DECLARE_UVC_FRAME_MJPEG(3); @@ -192,10 +195,6 @@ static const struct UVC_FRAME_MJPEG(3) uvc_frame_mjpg_360p = { .dwFrameInterval[2] = cpu_to_le32(5000000), }; -/* module parameters specific to the Video streaming endpoint */ -static unsigned int streaming_interval = 1; -module_param(streaming_interval, uint, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(streaming_interval, "1 - 16"); static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = { .bLength = UVC_DT_FRAME_MJPEG_SIZE(1), .bDescriptorType = USB_DT_CS_INTERFACE, @@ -212,9 +211,6 @@ static const struct UVC_FRAME_MJPEG(1) uvc_frame_mjpg_720p = { .dwFrameInterval[0] = cpu_to_le32(5000000), }; -static unsigned int streaming_maxpacket = 1024; -module_param(streaming_maxpacket, uint, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(streaming_maxpacket, "1 - 1023 (FS), 1 - 3072 (hs/ss)"); static const struct uvc_color_matching_descriptor uvc_color_matching = { .bLength = UVC_DT_COLOR_MATCHING_SIZE, .bDescriptorType = USB_DT_CS_INTERFACE, @@ -240,9 +236,6 @@ static const struct uvc_descriptor_header * const uvc_ss_control_cls[] = { NULL, }; -static unsigned int streaming_maxburst; -module_param(streaming_maxburst, uint, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)"); static const struct uvc_descriptor_header * const uvc_fs_streaming_cls[] = { (const struct uvc_descriptor_header *) &uvc_input_header, (const struct uvc_descriptor_header *) &uvc_format_yuv, @@ -978,7 +971,11 @@ error: * calling @uvc_cleanup() before module unload. */ int __init -uvc_bind_config(struct usb_configuration *c) +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; @@ -1016,6 +1013,10 @@ uvc_bind_config(struct usb_configuration *c) uvc_ss_streaming_cls[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER) goto error; + streaming_interval = streaming_interval_webcam; + streaming_maxpacket = streaming_maxpacket_webcam; + streaming_maxburst = streaming_maxburst_webcam; + uvc_gadget_trace_param = uvc_gadget_trace_webcam; uvc->desc.fs_control = uvc_fs_control_cls; uvc->desc.ss_control = uvc_ss_control_cls; uvc->desc.fs_streaming = uvc_fs_streaming_cls; @@ -1060,6 +1061,4 @@ error: return ret; } -module_param_named(trace, uvc_gadget_trace_param, uint, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(trace, "Trace level bitmask"); diff --git a/drivers/usb/gadget/f_uvc.h b/drivers/usb/gadget/f_uvc.h index edfe772..6732c0d 100644 --- a/drivers/usb/gadget/f_uvc.h +++ b/drivers/usb/gadget/f_uvc.h @@ -16,7 +16,11 @@ #include <linux/usb/composite.h> #include <linux/usb/video.h> -int uvc_bind_config(struct usb_configuration *c); +int 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); #endif /* _F_UVC_H_ */ diff --git a/drivers/usb/gadget/webcam.c b/drivers/usb/gadget/webcam.c index df809e7..6809dc2 100644 --- a/drivers/usb/gadget/webcam.c +++ b/drivers/usb/gadget/webcam.c @@ -29,6 +29,28 @@ #include "f_uvc.c" USB_GADGET_COMPOSITE_OPTIONS(); + +/*-------------------------------------------------------------------------*/ + +/* module parameters specific to the Video streaming endpoint */ +static unsigned int streaming_interval_webcam = 1; +module_param_named(streaming_interval, streaming_interval_webcam, uint, + S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(streaming_interval, "1 - 16"); + +static unsigned int streaming_maxpacket_webcam = 1024; +module_param_named(streaming_maxpacket, streaming_maxpacket_webcam, uint, + S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(streaming_maxpacket, "1 - 1023 (FS), 1 - 3072 (hs/ss)"); + +static unsigned int streaming_maxburst_webcam; +module_param_named(streaming_maxburst, streaming_maxburst_webcam, uint, + S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)"); + +unsigned int uvc_gadget_trace_param_webcam; +module_param_named(trace, uvc_gadget_trace_param_webcam, uint, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(trace, "Trace level bitmask"); /* -------------------------------------------------------------------------- * Device descriptor */ @@ -87,7 +109,10 @@ static struct usb_device_descriptor webcam_device_descriptor = { static int __init webcam_config_bind(struct usb_configuration *c) { - return uvc_bind_config(c); + return uvc_bind_config(c, streaming_interval_webcam, + streaming_maxpacket_webcam, + streaming_maxburst_webcam, + uvc_gadget_trace_param_webcam); } static struct usb_configuration webcam_config_driver = { -- 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