diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-10 07:33:31 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-10 07:33:31 +0000 |
commit | 25af523c4d1d4d91869b3d1caf4fe72a251d1e33 (patch) | |
tree | eebdf954f67e6fdc6e316b654046f449bc410abd /linux/drivers/media | |
parent | ad3ae53104ecf959f75a4737869697412fa7f2b1 (diff) | |
download | mediapointer-dvb-s2-25af523c4d1d4d91869b3d1caf4fe72a251d1e33.tar.gz mediapointer-dvb-s2-25af523c4d1d4d91869b3d1caf4fe72a251d1e33.tar.bz2 |
bw-qcam: add module parameter 'force_init' to skip polite auto-detection prior to direct initialization.
From: Brett T. Warden <brett.warden@gmail.com>
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 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/video/bw-qcam.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/linux/drivers/media/video/bw-qcam.c b/linux/drivers/media/video/bw-qcam.c index 42df7701a..7c165c7cf 100644 --- a/linux/drivers/media/video/bw-qcam.c +++ b/linux/drivers/media/video/bw-qcam.c @@ -85,11 +85,16 @@ OTHER DEALINGS IN THE SOFTWARE. static unsigned int maxpoll=250; /* Maximum busy-loop count for qcam I/O */ static unsigned int yieldlines=4; /* Yield after this many during capture */ static int video_nr = -1; +static unsigned int force_init; /* Whether to probe aggressively */ module_param(maxpoll, int, 0); module_param(yieldlines, int, 0); module_param(video_nr, int, 0); +/* Set force_init=1 to avoid detection by polling status register and + * immediately attempt to initialize qcam */ +module_param(force_init, int, 0); + static inline int read_lpstatus(struct qcam_device *q) { return parport_read_status(q->pport); @@ -334,6 +339,9 @@ static int qc_detect(struct qcam_device *q) int count = 0; int i; + if (force_init) + return 1; + lastreg = reg = read_lpstatus(q) & 0xf0; for (i = 0; i < 500; i++) @@ -357,12 +365,12 @@ static int qc_detect(struct qcam_device *q) /* Be (even more) liberal in what you accept... */ -/* if (count > 30 && count < 200) */ if (count > 20 && count < 400) { return 1; /* found */ } else { printk(KERN_ERR "No Quickcam found on port %s\n", q->pport->name); + printk(KERN_DEBUG "Quickcam detection counter: %u\n", count); return 0; /* not found */ } } |