aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/bw-qcam.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c
index 58423525591f..032265383df2 100644
--- a/drivers/media/video/bw-qcam.c
+++ b/drivers/media/video/bw-qcam.c
@@ -82,11 +82,16 @@ OTHER DEALINGS IN THE SOFTWARE.
82static unsigned int maxpoll=250; /* Maximum busy-loop count for qcam I/O */ 82static unsigned int maxpoll=250; /* Maximum busy-loop count for qcam I/O */
83static unsigned int yieldlines=4; /* Yield after this many during capture */ 83static unsigned int yieldlines=4; /* Yield after this many during capture */
84static int video_nr = -1; 84static int video_nr = -1;
85static unsigned int force_init; /* Whether to probe aggressively */
85 86
86module_param(maxpoll, int, 0); 87module_param(maxpoll, int, 0);
87module_param(yieldlines, int, 0); 88module_param(yieldlines, int, 0);
88module_param(video_nr, int, 0); 89module_param(video_nr, int, 0);
89 90
91/* Set force_init=1 to avoid detection by polling status register and
92 * immediately attempt to initialize qcam */
93module_param(force_init, int, 0);
94
90static inline int read_lpstatus(struct qcam_device *q) 95static inline int read_lpstatus(struct qcam_device *q)
91{ 96{
92 return parport_read_status(q->pport); 97 return parport_read_status(q->pport);
@@ -331,6 +336,9 @@ static int qc_detect(struct qcam_device *q)
331 int count = 0; 336 int count = 0;
332 int i; 337 int i;
333 338
339 if (force_init)
340 return 1;
341
334 lastreg = reg = read_lpstatus(q) & 0xf0; 342 lastreg = reg = read_lpstatus(q) & 0xf0;
335 343
336 for (i = 0; i < 500; i++) 344 for (i = 0; i < 500; i++)
@@ -354,12 +362,12 @@ static int qc_detect(struct qcam_device *q)
354 362
355 /* Be (even more) liberal in what you accept... */ 363 /* Be (even more) liberal in what you accept... */
356 364
357/* if (count > 30 && count < 200) */
358 if (count > 20 && count < 400) { 365 if (count > 20 && count < 400) {
359 return 1; /* found */ 366 return 1; /* found */
360 } else { 367 } else {
361 printk(KERN_ERR "No Quickcam found on port %s\n", 368 printk(KERN_ERR "No Quickcam found on port %s\n",
362 q->pport->name); 369 q->pport->name);
370 printk(KERN_DEBUG "Quickcam detection counter: %u\n", count);
363 return 0; /* not found */ 371 return 0; /* not found */
364 } 372 }
365} 373}