From de97c9ae3348e4a8be580f313fd464d7bc587fad Mon Sep 17 00:00:00 2001 From: Brett Warden Date: Fri, 28 Sep 2007 03:19:04 -0300 Subject: [PATCH] --- yaml --- r: 65907 b: refs/heads/master c: 9e19db5b6dda251b8d76c3a0069e63faca6be3f0 h: refs/heads/master i: 65905: dd0b39ab297d38940b319b8097d79bcf86c90e31 65903: 400b4a6e0f7e690af5c199607f79fa9cce116ec1 v: v3 --- [refs] | 2 +- trunk/drivers/media/video/bw-qcam.c | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bd310bd7eae5..0e2686e38143 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0b67f5c568c545cb36f88e9f418af2df1cc58589 +refs/heads/master: 9e19db5b6dda251b8d76c3a0069e63faca6be3f0 diff --git a/trunk/drivers/media/video/bw-qcam.c b/trunk/drivers/media/video/bw-qcam.c index 7d47cbe6ad25..0edd05ebcc3f 100644 --- a/trunk/drivers/media/video/bw-qcam.c +++ b/trunk/drivers/media/video/bw-qcam.c @@ -104,6 +104,17 @@ static inline void write_lpdata(struct qcam_device *q, int d) static inline void write_lpcontrol(struct qcam_device *q, int d) { + if(0x20 & d) { + /* Set bidirectional mode to reverse (data in) */ + parport_data_reverse(q->pport); + } else { + /* Set bidirectional mode to forward (data out) */ + parport_data_forward(q->pport); + } + + /* Now issue the regular port command, but strip out the + * direction flag */ + d &= ~0x20; parport_write_control(q->pport, d); } @@ -344,10 +355,13 @@ 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 < 300) + if (count > 20 && count < 400) + { return 1; /* found */ - else + } else { + printk(KERN_ERR "No Quickcam found on port %s\n", q->pport->name); return 0; /* not found */ + } }