On 9/26/07, Ray Lee <ray-lk@madrabbit.org> wrote:Point taken, thanks for the feedback. --- diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index 7d47cbe..0ba92e3 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c @@ -107,6 +107,11 @@ static inline void write_lpcontrol(struct qcam_device *q, int d) parport_write_control(q->pport, d); } +static inline void reverse_port(struct qcam_device *q) +{ + parport_data_reverse(q->pport); +} + static int qc_waithand(struct qcam_device *q, int val); static int qc_command(struct qcam_device *q, int command); static int qc_readparam(struct qcam_device *q); @@ -369,7 +374,7 @@ static void qc_reset(struct qcam_device *q) break; case QC_ANY: - write_lpcontrol(q, 0x20); + reverse_port(q); write_lpdata(q, 0x75); if (read_lpdata(q) != 0x75) { @@ -512,10 +517,12 @@ static inline int qc_readbytes(struct qcam_device *q, char buffer[]) switch (q->port_mode & QC_MODE_MASK) { case QC_BIDIR: /* Bi-directional Port */ - write_lpcontrol(q, 0x26); + reverse_port(q); + write_lpcontrol(q, 0x6); lo = (qc_waithand2(q, 1) >> 1); hi = (read_lpstatus(q) >> 3) & 0x1f; - write_lpcontrol(q, 0x2e); + reverse_port(q); + write_lpcontrol(q, 0xe); lo2 = (qc_waithand2(q, 0) >> 1); hi2 = (read_lpstatus(q) >> 3) & 0x1f; switch (q->bpp) @@ -613,10 +620,13 @@ static long qc_capture(struct qcam_device * q, char __user *buf, unsigned long l if ((q->port_mode & QC_MODE_MASK) == QC_BIDIR) { - write_lpcontrol(q, 0x2e); /* turn port around */ - write_lpcontrol(q, 0x26); + reverse_port(q); /* turn port around */ + write_lpcontrol(q, 0xe); + reverse_port(q); + write_lpcontrol(q, 0x6); (void) qc_waithand(q, 1); - write_lpcontrol(q, 0x2e); + reverse_port(q); + write_lpcontrol(q, 0xe); (void) qc_waithand(q, 0); } -- Brett Warden -
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Linus Torvalds | Linux 2.6.27-rc5 |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| David Miller | Slow DOWN, please!!! |
git: | |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| David Miller | [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Natalie Protasevich | [BUG] New Kernel Bugs |
