Re: /dev/psaux-Interface

From: Dmitry Torokhov
Date: Thu Apr 22 2004 - 02:39:33 EST


On Thursday 22 April 2004 02:06 am, Sau Dan Lee wrote:
> >>>>> "Dmitry" == Dmitry Torokhov <dtor_core@xxxxxxxxxxxxx> writes:
>
> Dmitry> OK, here you go. It is the first cut. The driver creates
> Dmitry> an absolute device for the touchscreen and a fake
> Dmitry> pass-through port to for the pointing device which works
> Dmitry> in relative mode. All fancy stuff can be done in userspace
> Dmitry> via evdev.
>
> I still haven't tried it. But upon first inspection, I found
> something undesirable already.
>
> +static void lbtouch_pass_pt_packet(struct serio *ptport, unsigned char *packet)
> +{
> + struct psmouse *child = ptport->private;
> +
> + if (child && child->state == PSMOUSE_ACTIVATED) {
> + serio_interrupt(ptport, packet[0], 0, NULL);
> + serio_interrupt(ptport, packet[1], 0, NULL);
> + serio_interrupt(ptport, packet[2], 0, NULL);
> + }
> +}
> +
>
> So, you're imposing the policy that the packets must as 3-byte
> packets?

Yes, this is my uderstanding of Lifebook protocol. It is incapable of anything
but bare PS/2 as far as the pointing device goes. If we ever get a spec we can
revisit it.

> My experiences in writing my XFree86 driver is that some
> bytes are sometimes dropped, for reasons I don't know. My driver
> would attempt to resync, although not reliably because the packet
> format in touch-screen mode does not provide a reliable
> synchronization mechanism (such as parity, a special bit to mark the
> end of a packet, etc.).
>

There is a timeout and synchronization attempt in psmosue_interrupt (parent
of this module) so you should be covered.

> I don't know whether the dropping of bytes is specific to my machine,
> or is common to all B142 models.
>
>
> +static psmouse_ret_t lbtouch_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
> +{
> + struct input_dev *dev = &psmouse->dev;
> + unsigned char *p = psmouse->packet;
> + int x, y, touch;
> +
> + input_regs(dev, regs);
> +
> + if (psmouse->pktcnt < 3)
> + return PSMOUSE_GOOD_DATA;
> +
>
> The same problem. You wait for a complete 3-byte packet before
> emitting an event. What happens to dropped bytes?
>

The packet is dropped when we wait for a byte for too long.

--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/