diff options
author | Brett Warden <brett.warden@gmail.com> | 2007-09-28 02:19:04 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:14:50 -0400 |
commit | 9e19db5b6dda251b8d76c3a0069e63faca6be3f0 (patch) | |
tree | 9fad0f372d62415867083168a24f709961de3d87 /drivers/media/video/bw-qcam.c | |
parent | 0b67f5c568c545cb36f88e9f418af2df1cc58589 (diff) |
V4L/DVB (6238): bw-qcam: use data_reverse instead of manually poking the control register
Fixes use of parport_write_control() to match the newer interface that
requires explicit parport_data_reverse() and parport_data_forward() calls.
This eliminates the following error message and restores the original
intended behavior:
parport0 (bw-qcam): use data_reverse for this!
Also increases threshold in qc_detect() from 300 to 400, as my camera often
results in a count of approx 330. Added a kernel error message to indicate
detection failure.
Thanks Ray and Randy for your comments, and for pointing out that I
needed to reset the port to forward mode!
Signed-off-by: Brett T. Warden <brett.warden@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/bw-qcam.c')
-rw-r--r-- | drivers/media/video/bw-qcam.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 7d47cbe6ad25..0edd05ebcc3f 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c | |||
@@ -104,6 +104,17 @@ static inline void write_lpdata(struct qcam_device *q, int d) | |||
104 | 104 | ||
105 | static inline void write_lpcontrol(struct qcam_device *q, int d) | 105 | static inline void write_lpcontrol(struct qcam_device *q, int d) |
106 | { | 106 | { |
107 | if(0x20 & d) { | ||
108 | /* Set bidirectional mode to reverse (data in) */ | ||
109 | parport_data_reverse(q->pport); | ||
110 | } else { | ||
111 | /* Set bidirectional mode to forward (data out) */ | ||
112 | parport_data_forward(q->pport); | ||
113 | } | ||
114 | |||
115 | /* Now issue the regular port command, but strip out the | ||
116 | * direction flag */ | ||
117 | d &= ~0x20; | ||
107 | parport_write_control(q->pport, d); | 118 | parport_write_control(q->pport, d); |
108 | } | 119 | } |
109 | 120 | ||
@@ -344,10 +355,13 @@ static int qc_detect(struct qcam_device *q) | |||
344 | /* Be (even more) liberal in what you accept... */ | 355 | /* Be (even more) liberal in what you accept... */ |
345 | 356 | ||
346 | /* if (count > 30 && count < 200) */ | 357 | /* if (count > 30 && count < 200) */ |
347 | if (count > 20 && count < 300) | 358 | if (count > 20 && count < 400) |
359 | { | ||
348 | return 1; /* found */ | 360 | return 1; /* found */ |
349 | else | 361 | } else { |
362 | printk(KERN_ERR "No Quickcam found on port %s\n", q->pport->name); | ||
350 | return 0; /* not found */ | 363 | return 0; /* not found */ |
364 | } | ||
351 | } | 365 | } |
352 | 366 | ||
353 | 367 | ||