Touchscreen

Adding touchscreen support to the gumstix is pretty straight-forward. One thing to keep in mind is that the UCB1400 on the gumstix uses the PWM0 line as the interrupt gpio for interfacing back to the pxa. This means that you can't use it for any other purpose, like for lcd contrast, gpio, etc. Below are the basic steps to getting the touchscreen working on the gumstix. This was tested on a connex-xm, but should work for all basix/connex/verdex stix.

Patching 2.6.20 kernel
Changes were made in the 2.6.20 kernel to separate the ucb1400 touchscreen code from the ucb1x00 code, so we need to patch the kernel to get the touchscreen driver to build correctly. This patch has been included in the 2.6.21 kernel, so skip this step if you are on a kernel > 2.6.20

Copy ucb1400-touchscreen-name.patch to /target/device/Gumstix/basix-connex/kernel-patches and then edit the file /target/device/Gumstix/basix-connex/kernel-patches/series Add a line about the new patch to the bottom of the file ucb1400-touchscreen-name.patch and also comment out the old touchscreen patch a bit further up in the file
 * 1) ucb1400-touchscreen.patch

Now would be a good time to go ahead and rebuild the kernel with the patch - save your kernel config if you need to and then cd  rm -rf build_arm_nofpu/linux-2.6.20gum/ make

Enabling touchscreen support in the kernel
Once your patched kernel is done being built (if necessary)... cd /build_arm_nofpu/linux-2.6.20gum/ make ARCH=arm menuconfig Under "Device drivers"--> "Input device support" select [*] Generic input layer (needed for ...)  Event interface [*] Touchscreens -->  Phillips UCB1400 touchscreen and then save/exit. Remove the old kernel image so that the kernel gets rebuilt next time we run make rm /build_arm_nofpu/linux-2.6.20gum/arch/arm/boot/compressed/vmlinux

Enabling tslib in the buildroot
From your buildroot directory run "make menuconfig" and under the package selection menu select tslib

Building the rootfs image
Now we can build the new rootfs image to flash to the gumstix cd  make Reflash your gumstix with the new rootfs image and boot

Modprobing the touchscreen modules
modprobe snd-pxa2xx-ac97 modprobe ucb1400-ts modprobe evdev Note that the touchscreen is now "ucb1400-ts" and not "ucb1x00-ts" as in previous kernels. After the modules are loaded you should see the new device entry like "/dev/input/event0" and if you run "cat /proc/interrupts" you should see an entry for UCB1400 on IRQ 39 (if it shows IRQ 0 then you probably have the PWM0 pin in use by something else and the touchscreen will not be able to generate interrupts until it is fixed)

Calibrating and testing the touchscreen
First edit the /etc/ts.conf file and uncomment the line about using the input layer driver module_raw input tslib uses several environmental variables that we need to also set now export TSLIB_CONFFILE=/etc/ts.conf export TSLIB_PLUGINDIR=/usr/lib export TSLIB_TSDEVICE=/dev/input/event0 export TSLIB_FBDEVICE=/dev/fb0 export TSLIB_CONSOLEDEVICE=/dev/tty Now you can run /root/ts_calibrate to calibrate the touchscreen, and then run /root/ts_test to test that it all works properly
 * 1) Uncomment if you wish to use the linux input layer event interface