At UDS I ran into Chase Douglas, one of Ubuntu’s multitouch developers, and asked him about getting multitouch working on a Lenovo X201 tablet, while he didn’t have a specific answer he gave me enough pieces of the puzzle (wacom_w8001 and inputattach) to sort it out.

In addition to the Wacom kernel driver for USB devices (wacom) there is a separate one for serial devices (wacom_w8001). While you could load the driver with ‘modprobe wacom_w8001′. I wanted to load it automatically so I used a udev rule. First, I needed to find the serial port the device is attached to by looking at dmesg:

[ 27.584535] input: Wacom Serial Penabled 2FG Touchscreen as /devices/pnp0/00:0b/tty/ttyS4/serio2/input/input6

Then I wanted to find the id of the serial device:

cat /sys/class/tty/ttyS4/device/id

Just in case it happens to change ports! The udev rule then looks like:

SUBSYSTEM==”tty”, KERNEL==”ttyS[0-9]*”, ATTRS{id}==”WACf00c”, RUN+=”/sbin/modprobe wacom_w8001″

To actually communicate with the serial device it seems that you need a program called inputattach. Unfortunately, the version of inputattach in Natty doesn’t have support for Wacom serial devices. Luckily, I found a patch in a Fedora bug adding support for it though. I built a new version of inputattach with that patch and the device showed up in the output of ‘sudo lsinput’! I then added running inputattach to the udev rule:

ACTION==”add|change”, SUBSYSTEM==”tty”, KERNEL==”ttyS[0-9]*”, ATTRS{id}==”WACf00c”, RUN+=”/usr/bin/inputattach –daemon –w8001 /dev/%k”

There was still a bit more work to do though. Chase had also mentioned that I’d want to use the evdev X driver instead of the wacom one. Looking in /usr/share/X11/xorg.conf.d/ there are various conf files for loading drivers for devices. I wrote one for my specific device:

Section "InputClass"
Identifier "Wacom serial class"
MatchProduct "Wacom Serial Penabled 2FG Touchscreen"
Driver "evdev"

I then used geistest in a terminal to confirm that it was working by watching its output. Granted its only two finger touch but its twice as good as one! Woohoo!

My friend Kees also has a Lenovo X200 laptop with a serial Wacom touchscreen and while the id of the serial device is different the same steps worked for him. When we were testing inputattach we noticed that would it die during a suspend resume cycle. Kees found the source of the bug and has submitted a patch to upstream and added an Ubuntu patch to Oneiric’s version of inputattach. He also threw it in his PPA.

I’m now busy configuring ginn for moving forward and backward between pages when reading comic books in tablet mode.