Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76731
b: refs/heads/master
c: d685a48
h: refs/heads/master
i:
  76729: bc68d65
  76727: 2ca502d
v: v3
  • Loading branch information
Brett T. Warden authored and Mauro Carvalho Chehab committed Jan 25, 2008
1 parent d4bfab5 commit 5c09130
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a19602f26a24c32e491108b49790b106a6351f24
refs/heads/master: d685a483b8c92e3d0580b6c28e2ed531391c8c46
10 changes: 9 additions & 1 deletion trunk/drivers/media/video/bw-qcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,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);
Expand Down Expand Up @@ -331,6 +336,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++)
Expand All @@ -354,12 +362,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 */
}
}
Expand Down

0 comments on commit 5c09130

Please sign in to comment.