Multitouch Linux howto

We get a lot of questions on how to use our Linux drivers or how to help us with the development of the drivers for new multitouch displays. Here are a few hints, under the form of a general procedure for compiling/testing drivers and the HID subsystem in Linux, and a few specifics. See our multitouch devices page for more information on known devices and their support.
Note to Ubuntu 10.04 users: there is some support for multitouch in Lucid, but there still is work for you to do. See the dedicated section at the end of this page.



General procedure:

  • have a source tree of your Linux kernel, ready for recompiling modules in it. As we'll have to make changes in the hid subsystem, you might want to make sure that hid is compiled as a module and not a static part of the kernel. In the following, '/' means the root of your source tree and '//' the root of your file system.
  • in /include/linux/hid.h, change the end of the macro IS_INPUT_APPLICATION to (a >= 0xd0002 && a <= 0xd0006).
  • in a recent hid-core.c (see here), take the lines that refer to your hardware (check for MOSART, QUANTA, STANTUM or 3M) and put them in /drivers/hid/hid-core.c, replacing lines if necessary.
  • same in hid-ids.h
  • put the hid-{yourpanel}.c file in /drivers/hid/
  • in drivers/hid/Makefile add a line obj-m += hid-{yourpanel}.o
  • make sure that /Module.symvers exists. Otherwise, the only solution we found is to compile the whole kernel and have the file produced during the process.
  • in /drivers/hid, 'make -C ../.. SUBDIRS=`pwd` modules'
  • copy the files hid-{yourpanel}.ko and hid.ko into your OS modules, that is in //lib/modules/2.6.xxx/kernel/drivers/hid. If you don't have hid.ko, this means that hid is not configured as a module but as a static part of the kernel; you will need to change this or compile and install the whole kernel.
  • load the new module hid-{yourpanel}.ko for the first time: insmod /lib/modules/2.6.xxx/kernel/drivers/hid/hid-{yourpanel}.ko
  • re-load the modules each time you modify and compile them. For this, you need to unload them (rmmod hid-{yourpanel}, for instance) then reload them (modprobe hid-{yourpanel}). You need to do it at least once for hid; for this, you need to unload all modules that use it ('rmmod hid-{yourpanel} usbhid hid') then load them again ('modprobe hid', 'modprobe usbhid', 'modprobe hid-mosart').

    Broadcom 5974: There is already a driver with multitouch support in the Linux kernel, since 2.6.30. Therefore you do not need to apply the above procedure.

    N-Trig: There is already a driver with multitouch support in the Linux kernel, since 2.6.31. Therefore you do not need to apply the above procedure. There's a problem though: the N-Trig firmware had changed a lot in the last months (March, July, October) and the driver does not work with all versions. Rafi Rubin is working on this.

    Stantum, 3M, MosArt and Quanta: The drivers are included in the upstream kernel since version 2.6.34. If you are using an earlier version you have to download the drivers and apply the procedure.

    Cando and eGalax: The drivers are included in the upstream kernel since version 2.6.35-rc1. If you are using an earlier version you have to download the drivers and apply the procedure.

    Others: We are interested in being aware of all new multitouch panels on the market, and we might be able to help produce multitouch Linux drivers for them. The lab has access to NextWindow products, and that's in our plans for the near future. If you own a multitouch panel with no Linux support, we might be able to help you. If you make such panels, don't hesitate to contact us too!

    Ubuntu 10.04 procedure: The kernel in Ubuntu 10.04 is a 2.6.32 with some added suport for multitouch. Basically, what was added is the set of drivers that was available in 2.6.34-rc1; what is missing is the patch to the hid module and the more recent drivers (cando, egalax). Therefore you need to:
  • grab the sources of your kernel
  • modify hid.h and recompile/install the hid module as described in the general procedure at the top of this page,
  • if your device is cando-based or egalax-based, obtain the sources of the driver and compile/install it as described in the general procedure (modification in hid-core.c and hid-ids.h, etc)



    Contact: chatty at enac.fr
    Updated July 11, 2010.