aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-10-09 19:55:23 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:37 -0500
commitb232a012adfea9f535702e8296ea6b76e691f436 (patch)
treeda121594b0c5e6d95d399190266e8b2582b2f22a
parentc4ed8c66d79d707d89fe732ff5b97739edf1ba62 (diff)
V4L/DVB (13155): uvcvideo: Add a module parameter to set the streaming control timeout
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>
-rw-r--r--drivers/media/video/uvc/uvc_driver.c3
-rw-r--r--drivers/media/video/uvc/uvc_video.c4
-rw-r--r--drivers/media/video/uvc/uvcvideo.h3
3 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/video/uvc/uvc_driver.c b/drivers/media/video/uvc/uvc_driver.c
index 307d3a6b7395..ab4a60102d08 100644
--- a/drivers/media/video/uvc/uvc_driver.c
+++ b/drivers/media/video/uvc/uvc_driver.c
@@ -46,6 +46,7 @@
46unsigned int uvc_no_drop_param; 46unsigned int uvc_no_drop_param;
47static unsigned int uvc_quirks_param; 47static unsigned int uvc_quirks_param;
48unsigned int uvc_trace_param; 48unsigned int uvc_trace_param;
49unsigned int uvc_timeout_param = UVC_CTRL_STREAMING_TIMEOUT;
49 50
50/* ------------------------------------------------------------------------ 51/* ------------------------------------------------------------------------
51 * Video formats 52 * Video formats
@@ -2195,6 +2196,8 @@ module_param_named(quirks, uvc_quirks_param, uint, S_IRUGO|S_IWUSR);
2195MODULE_PARM_DESC(quirks, "Forced device quirks"); 2196MODULE_PARM_DESC(quirks, "Forced device quirks");
2196module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR); 2197module_param_named(trace, uvc_trace_param, uint, S_IRUGO|S_IWUSR);
2197MODULE_PARM_DESC(trace, "Trace level bitmask"); 2198MODULE_PARM_DESC(trace, "Trace level bitmask");
2199module_param_named(timeout, uvc_timeout_param, uint, S_IRUGO|S_IWUSR);
2200MODULE_PARM_DESC(timeout, "Streaming control requests timeout");
2198 2201
2199MODULE_AUTHOR(DRIVER_AUTHOR); 2202MODULE_AUTHOR(DRIVER_AUTHOR);
2200MODULE_DESCRIPTION(DRIVER_DESC); 2203MODULE_DESCRIPTION(DRIVER_DESC);
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index 3369200a91d7..05139a4f14f6 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -135,7 +135,7 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
135 135
136 ret = __uvc_query_ctrl(stream->dev, query, 0, stream->intfnum, 136 ret = __uvc_query_ctrl(stream->dev, query, 0, stream->intfnum,
137 probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data, 137 probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data,
138 size, UVC_CTRL_STREAMING_TIMEOUT); 138 size, uvc_timeout_param);
139 139
140 if ((query == UVC_GET_MIN || query == UVC_GET_MAX) && ret == 2) { 140 if ((query == UVC_GET_MIN || query == UVC_GET_MAX) && ret == 2) {
141 /* Some cameras, mostly based on Bison Electronics chipsets, 141 /* Some cameras, mostly based on Bison Electronics chipsets,
@@ -239,7 +239,7 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
239 239
240 ret = __uvc_query_ctrl(stream->dev, UVC_SET_CUR, 0, stream->intfnum, 240 ret = __uvc_query_ctrl(stream->dev, UVC_SET_CUR, 0, stream->intfnum,
241 probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data, 241 probe ? UVC_VS_PROBE_CONTROL : UVC_VS_COMMIT_CONTROL, data,
242 size, UVC_CTRL_STREAMING_TIMEOUT); 242 size, uvc_timeout_param);
243 if (ret != size) { 243 if (ret != size) {
244 uvc_printk(KERN_ERR, "Failed to set UVC %s control : " 244 uvc_printk(KERN_ERR, "Failed to set UVC %s control : "
245 "%d (exp. %u).\n", probe ? "probe" : "commit", 245 "%d (exp. %u).\n", probe ? "probe" : "commit",
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index dae5f57523db..fb3342ae6d7c 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -148,7 +148,7 @@ struct uvc_xu_control {
148#define UVC_MAX_STATUS_SIZE 16 148#define UVC_MAX_STATUS_SIZE 16
149 149
150#define UVC_CTRL_CONTROL_TIMEOUT 300 150#define UVC_CTRL_CONTROL_TIMEOUT 300
151#define UVC_CTRL_STREAMING_TIMEOUT 1000 151#define UVC_CTRL_STREAMING_TIMEOUT 3000
152 152
153/* Devices quirks */ 153/* Devices quirks */
154#define UVC_QUIRK_STATUS_INTERVAL 0x00000001 154#define UVC_QUIRK_STATUS_INTERVAL 0x00000001
@@ -538,6 +538,7 @@ struct uvc_driver {
538 538
539extern unsigned int uvc_no_drop_param; 539extern unsigned int uvc_no_drop_param;
540extern unsigned int uvc_trace_param; 540extern unsigned int uvc_trace_param;
541extern unsigned int uvc_timeout_param;
541 542
542#define uvc_trace(flag, msg...) \ 543#define uvc_trace(flag, msg...) \
543 do { \ 544 do { \