[clue-tech] XFree86 device driver documentation?

marcus hall marcus at tuells.org
Mon Apr 2 16:13:51 MDT 2007


On Mon, Apr 02, 2007 at 03:07:16PM -0600, Jim Ockers wrote:
> We have to write an XFree86 input device driver for a touchscreen that
> needs a nice normal XFree86 driver.
 
> The only documentation we've been able to find for this sort of thing
> is the actual XFree86 source code.  Does anyone out there know what
> documentation we could refer to, such as API documentation, besides the
> XFree86 source code?
...
> Obviously there are some examples of other touchscreen drivers that we
> can use but I was hoping someone knew of a book or useful website
> that documented the API spec for XFree86 InputDevice drivers.
> 
> We have the hardware touchscreen controller's protocol document so
> right now the working plan is to use some other touchscreen driver for
> which we have the source as an example.  It's on a serial port /dev/ttyS1
> so we don't have any goofy hardware interfaces to worry about.

> Jim Ockers, P.Eng. (ockers at ockers.net)
> Contact info: please see http://www.ockers.net/

When I've needed to do such things, I've just gone by the existing
touch drivers and changed the protocol decoding as needed.  Thankfully,
the touch drivers are all just a single .c file, and not very long at
that.  It all boils down to calling xf86PostMotionEvent() and
xf86PostButtonEvent() after parsing the input packet format.

Most touch screens use either the microtouch (3M) or ELO interface
standards, both of which are in stock distributions, along with many
less common protocols, so it's a little surprising to come across
an unsupported controller, but it really isn't too much work to change
one of the existing drivers to understand a different protocol.

As far as documentation, I've never found anything documenting XFree86's
internal interfaces, and have just looked at what similar drivers do
in similar circumstances.  For this case, I expect that the existing drivers 
would need to do the same sort of things that you need, so all the calls
are most likely there, you may just have to tweak a few buffer sizes
and such (and of course re-work the logic to send queries to the screen
if needed, and parse the incoming data stream).

But, if you do come across any XFree86 docs, please give a yell to the
list.  I would be most interested!

-- 
Marcus Hall
marcus at tuells.org



More information about the clue-tech mailing list