Commit efb540c8 authored by Andrzej Pietrasiewicz's avatar Andrzej Pietrasiewicz Committed by Felipe Balbi

usb: gadget: uvc: move module parameters from f_uvc

When configfs support is integrated the future uvc function
module must not take any parameters. Move parameters to
webcam.
Signed-off-by: default avatarAndrzej Pietrasiewicz <andrzej.p@samsung.com>
Tested-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent a1d27a4b
...@@ -29,21 +29,9 @@ ...@@ -29,21 +29,9 @@
#include "uvc.h" #include "uvc.h"
unsigned int uvc_gadget_trace_param; unsigned int uvc_gadget_trace_param;
static unsigned int streaming_interval;
/*-------------------------------------------------------------------------*/ static unsigned int streaming_maxpacket;
/* 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 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 unsigned int streaming_maxburst; static unsigned int streaming_maxburst;
module_param(streaming_maxburst, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)");
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Function descriptors * Function descriptors
...@@ -756,7 +744,9 @@ uvc_bind_config(struct usb_configuration *c, ...@@ -756,7 +744,9 @@ uvc_bind_config(struct usb_configuration *c,
const struct uvc_descriptor_header * const *ss_control, const struct uvc_descriptor_header * const *ss_control,
const struct uvc_descriptor_header * const *fs_streaming, const struct uvc_descriptor_header * const *fs_streaming,
const struct uvc_descriptor_header * const *hs_streaming, const struct uvc_descriptor_header * const *hs_streaming,
const struct uvc_descriptor_header * const *ss_streaming) const struct uvc_descriptor_header * const *ss_streaming,
unsigned int stream_interv, unsigned int stream_maxpkt,
unsigned int stream_maxburst, unsigned int trace)
{ {
struct uvc_device *uvc; struct uvc_device *uvc;
int ret = 0; int ret = 0;
...@@ -794,6 +784,10 @@ uvc_bind_config(struct usb_configuration *c, ...@@ -794,6 +784,10 @@ uvc_bind_config(struct usb_configuration *c,
ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER) ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER)
goto error; goto error;
streaming_interval = stream_interv;
streaming_maxpacket = stream_maxpkt;
streaming_maxburst = stream_maxburst;
uvc_gadget_trace_param = trace;
uvc->desc.fs_control = fs_control; uvc->desc.fs_control = fs_control;
uvc->desc.ss_control = ss_control; uvc->desc.ss_control = ss_control;
uvc->desc.fs_streaming = fs_streaming; uvc->desc.fs_streaming = fs_streaming;
...@@ -838,6 +832,4 @@ uvc_bind_config(struct usb_configuration *c, ...@@ -838,6 +832,4 @@ uvc_bind_config(struct usb_configuration *c,
return ret; return ret;
} }
module_param_named(trace, uvc_gadget_trace_param, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(trace, "Trace level bitmask");
...@@ -21,7 +21,11 @@ int uvc_bind_config(struct usb_configuration *c, ...@@ -21,7 +21,11 @@ int uvc_bind_config(struct usb_configuration *c,
const struct uvc_descriptor_header * const *hs_control, const struct uvc_descriptor_header * const *hs_control,
const struct uvc_descriptor_header * const *fs_streaming, const struct uvc_descriptor_header * const *fs_streaming,
const struct uvc_descriptor_header * const *hs_streaming, const struct uvc_descriptor_header * const *hs_streaming,
const struct uvc_descriptor_header * const *ss_streaming); const struct uvc_descriptor_header * const *ss_streaming,
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_ */ #endif /* _F_UVC_H_ */
...@@ -29,6 +29,25 @@ ...@@ -29,6 +29,25 @@
#include "f_uvc.c" #include "f_uvc.c"
USB_GADGET_COMPOSITE_OPTIONS(); USB_GADGET_COMPOSITE_OPTIONS();
/*-------------------------------------------------------------------------*/
/* 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 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 unsigned int streaming_maxburst;
module_param(streaming_maxburst, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)");
static unsigned int trace;
module_param(trace, uint, S_IRUGO|S_IWUSR);
MODULE_PARM_DESC(trace, "Trace level bitmask");
/* -------------------------------------------------------------------------- /* --------------------------------------------------------------------------
* Device descriptor * Device descriptor
*/ */
...@@ -326,9 +345,11 @@ static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = { ...@@ -326,9 +345,11 @@ static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = {
static int __init static int __init
webcam_config_bind(struct usb_configuration *c) webcam_config_bind(struct usb_configuration *c)
{ {
return uvc_bind_config(c, uvc_fs_control_cls, uvc_ss_control_cls, return uvc_bind_config(c, uvc_fs_control_cls,
uvc_fs_streaming_cls, uvc_hs_streaming_cls, uvc_ss_control_cls, uvc_fs_streaming_cls,
uvc_ss_streaming_cls); uvc_hs_streaming_cls, uvc_ss_streaming_cls,
streaming_interval, streaming_maxpacket,
streaming_maxburst, trace);
} }
static struct usb_configuration webcam_config_driver = { static struct usb_configuration webcam_config_driver = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment