diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2014-09-08 04:18:16 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-09-08 09:49:37 -0400 |
commit | efb540c895d2cb77b1472edda6ca45d40719a041 (patch) | |
tree | 554142752ddc10422994afd045b9680c260d3a2f /drivers/usb/gadget | |
parent | a1d27a4bf5bb4144c593358cbd7261c6c6f0a023 (diff) |
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: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/function/f_uvc.c | 26 | ||||
-rw-r--r-- | drivers/usb/gadget/function/f_uvc.h | 6 | ||||
-rw-r--r-- | drivers/usb/gadget/legacy/webcam.c | 27 |
3 files changed, 38 insertions, 21 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c index b347530d1dfe..187c3a04cf70 100644 --- a/drivers/usb/gadget/function/f_uvc.c +++ b/drivers/usb/gadget/function/f_uvc.c | |||
@@ -29,21 +29,9 @@ | |||
29 | #include "uvc.h" | 29 | #include "uvc.h" |
30 | 30 | ||
31 | unsigned int uvc_gadget_trace_param; | 31 | unsigned int uvc_gadget_trace_param; |
32 | 32 | static unsigned int streaming_interval; | |
33 | /*-------------------------------------------------------------------------*/ | 33 | static unsigned int streaming_maxpacket; |
34 | |||
35 | /* module parameters specific to the Video streaming endpoint */ | ||
36 | static unsigned int streaming_interval = 1; | ||
37 | module_param(streaming_interval, uint, S_IRUGO|S_IWUSR); | ||
38 | MODULE_PARM_DESC(streaming_interval, "1 - 16"); | ||
39 | |||
40 | static unsigned int streaming_maxpacket = 1024; | ||
41 | module_param(streaming_maxpacket, uint, S_IRUGO|S_IWUSR); | ||
42 | MODULE_PARM_DESC(streaming_maxpacket, "1 - 1023 (FS), 1 - 3072 (hs/ss)"); | ||
43 | |||
44 | static unsigned int streaming_maxburst; | 34 | static unsigned int streaming_maxburst; |
45 | module_param(streaming_maxburst, uint, S_IRUGO|S_IWUSR); | ||
46 | MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)"); | ||
47 | 35 | ||
48 | /* -------------------------------------------------------------------------- | 36 | /* -------------------------------------------------------------------------- |
49 | * Function descriptors | 37 | * Function descriptors |
@@ -756,7 +744,9 @@ uvc_bind_config(struct usb_configuration *c, | |||
756 | const struct uvc_descriptor_header * const *ss_control, | 744 | const struct uvc_descriptor_header * const *ss_control, |
757 | const struct uvc_descriptor_header * const *fs_streaming, | 745 | const struct uvc_descriptor_header * const *fs_streaming, |
758 | const struct uvc_descriptor_header * const *hs_streaming, | 746 | const struct uvc_descriptor_header * const *hs_streaming, |
759 | const struct uvc_descriptor_header * const *ss_streaming) | 747 | const struct uvc_descriptor_header * const *ss_streaming, |
748 | unsigned int stream_interv, unsigned int stream_maxpkt, | ||
749 | unsigned int stream_maxburst, unsigned int trace) | ||
760 | { | 750 | { |
761 | struct uvc_device *uvc; | 751 | struct uvc_device *uvc; |
762 | int ret = 0; | 752 | int ret = 0; |
@@ -794,6 +784,10 @@ uvc_bind_config(struct usb_configuration *c, | |||
794 | ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER) | 784 | ss_streaming[0]->bDescriptorSubType != UVC_VS_INPUT_HEADER) |
795 | goto error; | 785 | goto error; |
796 | 786 | ||
787 | streaming_interval = stream_interv; | ||
788 | streaming_maxpacket = stream_maxpkt; | ||
789 | streaming_maxburst = stream_maxburst; | ||
790 | uvc_gadget_trace_param = trace; | ||
797 | uvc->desc.fs_control = fs_control; | 791 | uvc->desc.fs_control = fs_control; |
798 | uvc->desc.ss_control = ss_control; | 792 | uvc->desc.ss_control = ss_control; |
799 | uvc->desc.fs_streaming = fs_streaming; | 793 | uvc->desc.fs_streaming = fs_streaming; |
@@ -838,6 +832,4 @@ error: | |||
838 | return ret; | 832 | return ret; |
839 | } | 833 | } |
840 | 834 | ||
841 | module_param_named(trace, uvc_gadget_trace_param, uint, S_IRUGO|S_IWUSR); | ||
842 | MODULE_PARM_DESC(trace, "Trace level bitmask"); | ||
843 | 835 | ||
diff --git a/drivers/usb/gadget/function/f_uvc.h b/drivers/usb/gadget/function/f_uvc.h index ec52752f7326..74b9602ef2d8 100644 --- a/drivers/usb/gadget/function/f_uvc.h +++ b/drivers/usb/gadget/function/f_uvc.h | |||
@@ -21,7 +21,11 @@ int uvc_bind_config(struct usb_configuration *c, | |||
21 | const struct uvc_descriptor_header * const *hs_control, | 21 | const struct uvc_descriptor_header * const *hs_control, |
22 | const struct uvc_descriptor_header * const *fs_streaming, | 22 | const struct uvc_descriptor_header * const *fs_streaming, |
23 | const struct uvc_descriptor_header * const *hs_streaming, | 23 | const struct uvc_descriptor_header * const *hs_streaming, |
24 | const struct uvc_descriptor_header * const *ss_streaming); | 24 | const struct uvc_descriptor_header * const *ss_streaming, |
25 | unsigned int streaming_interval_webcam, | ||
26 | unsigned int streaming_maxpacket_webcam, | ||
27 | unsigned int streaming_maxburst_webcam, | ||
28 | unsigned int uvc_gadget_trace_webcam); | ||
25 | 29 | ||
26 | #endif /* _F_UVC_H_ */ | 30 | #endif /* _F_UVC_H_ */ |
27 | 31 | ||
diff --git a/drivers/usb/gadget/legacy/webcam.c b/drivers/usb/gadget/legacy/webcam.c index a11d8e420bfe..f826622d1dc2 100644 --- a/drivers/usb/gadget/legacy/webcam.c +++ b/drivers/usb/gadget/legacy/webcam.c | |||
@@ -29,6 +29,25 @@ | |||
29 | #include "f_uvc.c" | 29 | #include "f_uvc.c" |
30 | 30 | ||
31 | USB_GADGET_COMPOSITE_OPTIONS(); | 31 | USB_GADGET_COMPOSITE_OPTIONS(); |
32 | |||
33 | /*-------------------------------------------------------------------------*/ | ||
34 | |||
35 | /* module parameters specific to the Video streaming endpoint */ | ||
36 | static unsigned int streaming_interval = 1; | ||
37 | module_param(streaming_interval, uint, S_IRUGO|S_IWUSR); | ||
38 | MODULE_PARM_DESC(streaming_interval, "1 - 16"); | ||
39 | |||
40 | static unsigned int streaming_maxpacket = 1024; | ||
41 | module_param(streaming_maxpacket, uint, S_IRUGO|S_IWUSR); | ||
42 | MODULE_PARM_DESC(streaming_maxpacket, "1 - 1023 (FS), 1 - 3072 (hs/ss)"); | ||
43 | |||
44 | static unsigned int streaming_maxburst; | ||
45 | module_param(streaming_maxburst, uint, S_IRUGO|S_IWUSR); | ||
46 | MODULE_PARM_DESC(streaming_maxburst, "0 - 15 (ss only)"); | ||
47 | |||
48 | static unsigned int trace; | ||
49 | module_param(trace, uint, S_IRUGO|S_IWUSR); | ||
50 | MODULE_PARM_DESC(trace, "Trace level bitmask"); | ||
32 | /* -------------------------------------------------------------------------- | 51 | /* -------------------------------------------------------------------------- |
33 | * Device descriptor | 52 | * Device descriptor |
34 | */ | 53 | */ |
@@ -326,9 +345,11 @@ static const struct uvc_descriptor_header * const uvc_ss_streaming_cls[] = { | |||
326 | static int __init | 345 | static int __init |
327 | webcam_config_bind(struct usb_configuration *c) | 346 | webcam_config_bind(struct usb_configuration *c) |
328 | { | 347 | { |
329 | return uvc_bind_config(c, uvc_fs_control_cls, uvc_ss_control_cls, | 348 | return uvc_bind_config(c, uvc_fs_control_cls, |
330 | uvc_fs_streaming_cls, uvc_hs_streaming_cls, | 349 | uvc_ss_control_cls, uvc_fs_streaming_cls, |
331 | uvc_ss_streaming_cls); | 350 | uvc_hs_streaming_cls, uvc_ss_streaming_cls, |
351 | streaming_interval, streaming_maxpacket, | ||
352 | streaming_maxburst, trace); | ||
332 | } | 353 | } |
333 | 354 | ||
334 | static struct usb_configuration webcam_config_driver = { | 355 | static struct usb_configuration webcam_config_driver = { |