]> git.hungrycats.org Git - linux/commitdiff
V4L/DVB (13155): uvcvideo: Add a module parameter to set the streaming control timeout
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Fri, 9 Oct 2009 23:55:23 +0000 (20:55 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:55:47 +0000 (15:55 -0700)
commit b232a012adfea9f535702e8296ea6b76e691f436 upstream

The default streaming control timeout was found by Ondrej Zary to be too low
for some Logitech webcams. With kernel 2.6.22 and newer they would timeout
during initialization unles the audio function was initialized before the
video function.

Add a module parameter to set the streaming control timeout and increase the
default value from 1000ms to 3000ms to fix the above problem.

Thanks to Ondrej Zary for investigating the issue and providing an initial
patch.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Brandon Philips <bphilips@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/media/video/uvc/uvc_driver.c
drivers/media/video/uvc/uvc_video.c
drivers/media/video/uvc/uvcvideo.h

index 04b47832fa0a5d1d416cdf429cf9e320a69fc59f..5a8a8d1cc9c030dbff4cfc34bf5ce173db88a47f 100644 (file)
@@ -46,6 +46,7 @@
 unsigned int uvc_no_drop_param;
 static unsigned int uvc_quirks_param;
 unsigned int uvc_trace_param;
+unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT;
 
 /* ------------------------------------------------------------------------
  * Video formats
@@ -2034,6 +2035,8 @@ module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(quirks, "Forced device quirks");
 module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(trace, "Trace level bitmask");
+module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
+MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
index 01b633c734803ac3d4cf3b42a690cbedc51dc96f..f2480c35c2659775203bfce231bde7a6bf6b9be9 100644 (file)
@@ -130,7 +130,7 @@ static int uvc_get_video_ctrl(struct uvc_video_device *video,
 
        ret = __uvc_query_ctrl(video->dev, query, 0, video->streaming->intfnum,
                probe ? VS_PROBE_CONTROL : VS_COMMIT_CONTROL, data, size,
-               UVC_CTRL_STREAMING_TIMEOUT);
+               uvc_timeout_param);
 
        if ((query == GET_MIN || query == GET_MAX) && ret == 2) {
                /* Some cameras, mostly based on Bison Electronics chipsets,
@@ -235,7 +235,7 @@ static int uvc_set_video_ctrl(struct uvc_video_device *video,
        ret = __uvc_query_ctrl(video->dev, SET_CUR, 0,
                video->streaming->intfnum,
                probe ? VS_PROBE_CONTROL : VS_COMMIT_CONTROL, data, size,
-               UVC_CTRL_STREAMING_TIMEOUT);
+               uvc_timeout_param);
        if (ret != size) {
                uvc_printk(KERN_ERR, "Failed to set UVC %s control : "
                        "%d (exp. %u).\n", probe ? "probe" : "commit",
index 3c78d3c1e4c0f7482122d7ddff4ea2c0411fea2e..3265fbf3fc96950a16ee74aaa29f72d5dc852028 100644 (file)
@@ -304,7 +304,7 @@ struct uvc_xu_control {
 #define UVC_MAX_STATUS_SIZE    16
 
 #define UVC_CTRL_CONTROL_TIMEOUT       300
-#define UVC_CTRL_STREAMING_TIMEOUT     1000
+#define UVC_CTRL_STREAMING_TIMEOUT     3000
 
 /* Devices quirks */
 #define UVC_QUIRK_STATUS_INTERVAL      0x00000001
@@ -695,6 +695,7 @@ struct uvc_driver {
 
 extern unsigned int uvc_no_drop_param;
 extern unsigned int uvc_trace_param;
+extern unsigned int uvc_timeout_param;
 
 #define uvc_trace(flag, msg...) \
        do { \