aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBrett T. Warden <brett.warden@gmail.com>2008-01-10 02:33:31 -0500
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:04:51 -0500
commitd685a483b8c92e3d0580b6c28e2ed531391c8c46 (patch)
tree65781891f244654f884cf18cdcd077b28f93bbac /drivers
parenta19602f26a24c32e491108b49790b106a6351f24 (diff)
V4L/DVB (7013): bw-qcam: add module parameter 'force_init' to skip polite auto-detection prior to direct initialization
Setting force_init=1 bypasses the friendly auto-detection by polling the status register, and instead attempts to initialize the qcam directly. Not friendly to other parallel devices, but much more reliable than the auto-detection. Signed-off-by: Brett T. Warden <brett.warden@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers')
-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}