Re: [PATCH] bw-qcam: use data_reverse instead of manually poking the control register

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Brett Warden
Date: Wednesday, September 26, 2007 - 2:43 pm

On 9/26/07, Ray Lee <ray-lk@madrabbit.org> wrote:

In response to Randy's and your questions, here's what I understand:

The error message comes from parport_pc_write_control in
include/linux/parport_pc.h, which is called by bw-qcam's
write_lpcontrol():

static __inline__ void parport_pc_write_control (struct parport *p,
                         unsigned char d)
{
    const unsigned char wm = (PARPORT_CONTROL_STROBE |
                  PARPORT_CONTROL_AUTOFD |
                  PARPORT_CONTROL_INIT |
                  PARPORT_CONTROL_SELECT);

    /* Take this out when drivers have adapted to newer interface. */
    if (d & 0x20) {
        printk (KERN_DEBUG "%s (%s): use data_reverse for this!\n",
            p->name, p->cad->name);
        parport_pc_data_reverse (p);
    }

    __parport_pc_frob_control (p, wm, d & wm);
}

The mask wm works out to 0x0f, so first it calls
parport_pc_data_reverse(), then masks off the high nibble with the
reverse flag and makes the regular call.

Looking at that more carefully, I'm not sure whether I need to add the
write_lpcontrol(q, 0) after the first call. Other than that, I believe
I'm following the same procedure.

As for whether data_reverse is sticky, I don't know... I'll see what I
can find out.

-- 
Brett Warden
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] bw-qcam: use data_reverse instead of manually ..., Brett Warden, (Wed Sep 26, 2:43 pm)