Subject: making tpcalib MI
To: None <>
From: Ty Sarna <>
List: tech-kern
Date: 05/25/2004 13:40:41
I've written a driver for a USB touchpanel controller, which needs
calibration support.  For the kernel part of this, there is some
nice-looking code in sys/dev/hpc that is almost MI. The only problem
area is the WSMOUSEIO_GETID ioctl implementation, which relies on hpc
"platid" stuff.

So, my idea is to move tpcalib from sys/dev/hpc to sys/dev/wscons,
remove the WSMOUSE_GETID support from tpcalib_ioctl(), and introducte a
new sys/dev/hpc/hpc_tpcalib.c with a hpc_tpcalib_ioctl() that wraps
tpcalib_ioctl() and adds back the hpc-specific WSMOUSE_GETID support.
Then, the various hpc tpanel drivers would be changed to call

Does this sound OK? Any better ideas? I could just ifdef out
WSMOUSE_GETID ifnot a hpcxxx platform, but that doesn't seem very

For the userland part, tpctl is a much bigger challenge, since it
depends on the hpcfb interface.  Possible solutions include a
limited-function non-calibrating version of tpctl on non-hpcfb
platforms, so that /etc/rc.d/tpctl can still be used once inital
calibration is done, or have it call out to an external (X-based)
program if hpcfb isn't supported, or just do a completely different
X-based program, or...