2006-02-07 23:41:21

by Shaun Jackman

[permalink] [raw]
Subject: Re: Elo touch panel

On 2/7/06, Vojtech Pavlik <[email protected]> wrote:
> On Mon, Feb 06, 2006 at 07:30:26PM -0700, Shaun Jackman wrote:
...
> > I then run...
> > $ inputattach -elo /dev/ttyS3
> > .. at which point dmesg says...
> > serio: Serial port ttyS3
> > but it never gives a message indicating that the Elo driver has been
> > attached to ttyS3. Is there anything else I must configure?
>
> Try to look at /proc/bus/input/devices. The elo_connect() function
> should get called at the point the port is created. Unfortunately, I
> never could test this driver, because I don't have any touchscreens
> anymore (ever had one and it broke when I was moving). So there may be
> problems in the driver. But I believe others had some success running
> it.
>
> Looking at the driver, one will probably need to set the panel type in
> inputattach ...

There's a bug in inputattach. The SERIO_RS232 constant is completely
mucking the bits that specify the protocol.

--- inputattach.c- 2006-02-07 14:37:04.000000000 -0700
+++ inputattach.c 2006-02-07 16:22:07.000000000 -0700
@@ -455,7 +455,7 @@
return 1;
}

- devt = SERIO_RS232 | input_types[type].type | (id << 8) | (extra << 16);
+ devt = input_types[type].type | (id << 8) | (extra << 16);

if(ioctl(fd, SPIOCSTYPE, &devt)) {
fprintf(stderr, "inputattach: can't set device type\n");

Cheers,
Shaun

APPENDIX A

You probably know this better than I do, but the .type above is
misnamed. It should really be .proto. It's impossible, as far as I can
tell, to specify the type (like SERIO_RS232) with a SPIOCSTYPE call.


2006-02-08 08:51:33

by Vojtech Pavlik

[permalink] [raw]
Subject: Re: Elo touch panel

On Tue, Feb 07, 2006 at 04:41:16PM -0700, Shaun Jackman wrote:

> There's a bug in inputattach. The SERIO_RS232 constant is completely
> mucking the bits that specify the protocol.
>
> --- inputattach.c- 2006-02-07 14:37:04.000000000 -0700
> +++ inputattach.c 2006-02-07 16:22:07.000000000 -0700
> @@ -455,7 +455,7 @@
> return 1;
> }
>
> - devt = SERIO_RS232 | input_types[type].type | (id << 8) | (extra << 16);
> + devt = input_types[type].type | (id << 8) | (extra << 16);
>
> if(ioctl(fd, SPIOCSTYPE, &devt)) {
> fprintf(stderr, "inputattach: can't set device type\n");
>
> Cheers,
> Shaun
>
> APPENDIX A
>
> You probably know this better than I do, but the .type above is
> misnamed. It should really be .proto. It's impossible, as far as I can
> tell, to specify the type (like SERIO_RS232) with a SPIOCSTYPE call.

It's an incompatibility in a later rework of serio.h/serport.c.
SERIO_RS232 used to be 0x02000000, now the constant isn't shifted up
anymore, which messed up things. Also, the type used to be possible to
set, but I don't think that needs to be fixed, since there are so far no
ttys that'd need a different serio type.

I'll apply your fix to inpuatttach. Thanks for spotting the bug.

--
Vojtech Pavlik
SuSE Labs, SuSE CR