Elantech touchpad driver for Linux
Introduction
Version 3
Version 3 of the Elantech touchpad driver for Linux based on the feedback of testers and users out there is available for download. Changes include:
- Fixed an issue on some models where using the physical buttons did not work and only tapping the touchpad produced mouse clicks.
- Absolute mode reporting also has an "older" and "newer" packet format where the finger tap and parity bits are placed differently. The driver makes an educated guess based on the Synaptics Capabilities query which layout to expect.
- Implemented a
reconnecthandler to make suspend and resume work without the touchpad and the driver getting out of sync.
The driver programs the touchpad to a known state by using values that I snooped from the Windows driver for my laptop. It seems however that these values may not be suitable for all types of Elantech touchpads out there. A tester with a Clevo m540n laptop informed me that using this driver turned off the pad part of his touchpad and only left the physical buttons working. It is very well possible that a future version of this driver should use different sets of values to program the touchpad that get selected based on the different capability and mode queries.
Using it with the Xorg synaptics driver
The driver still defaults to relative mode reporting as the safest choice and should work with the "mouse" Xorg driver. If you want to try compatibility with the Xorg "synaptics" driver you should make sure the driver is using absolute mode reporting.
The easiest way is to do a
echo -n 0x16 > /sys/bus/serio/drivers/psmouse/serio?/reg_10
or automate it with a boottime script. E.g. add it to something like
/etc/rc.local.
For a longer term solution change the source code line that reads
etd->reg_10 = 0x12;into
etd->reg_10 = 0x16;
and recompile, reinstall etc.
Hopefully given enough feedback on whether this works for everyone we can change the driver default in the future to absolute mode reporting and have standard interoperability with the Xorg "synaptics" driver.
Version 2
Version 2 of the driver included the following changes:- Absolute mode reporting is working on my laptop. The driver can now interoperate with the Xorg "synaptics" driver. Test if it works on your laptop too!
- Fixed the Synaptics Identify query the driver tries. Was using the wrong constant in the code.
- Added Synaptics Modes query as a newer version of the Windows Elantech driver tries that query too. Don't know yet what is used for tough.
- The driver makes an educated guess based on the Synaptics Capabilities query to determine whether the touchpad supports middle mouse button reporting or uses another set of bits to report fingers taps. This will hopefully fix the "stuck" middle mouse button problem.
- Discovered and documented some more bits of the configuration registers.
- Added a debug option to make it easier for testers to get protocol traces for feedback
Download
Version 3
Below are three patches. One that adds the driver to vanilla kernel 2.6.24, one that adds the driver to Ubuntu kernel 2.6.22 and one that updates the driver already in 2.6.24-rc8-mm1 to the newest version.
Patch for vanilla kernel 2.6.24: elantech-v3-2.6.24.patch
(should also apply to all 2.6.23.x kernels)
Patch for Ubuntu kernel 2.6.22: elantech-v3-2.6.22.ubuntu.patch
(probably applies to vanilla 2.6.22.y kernels as well)
Update for kernel 2.6.24-rc8-mm1: elantech-v3-2.6.24-rc8-mm1.patch
Version 2
Not recommended. For historical purposes only!
Patch for kernel 2.6.23.1: elantech-2.6.23.1.patch
Update for kernel 2.6.23-mm1: elantech-2.6.23-mm1.patch
Feedback
This driver can only improve with the feedback of users and testers out there. So if anything isn't working as expected don't hesitate to contact me. When contacting me could you please include the output of
dmesg | grep elantech
in your email so I know what kind of touchpad you have?
Email me at: arjan AT opmeer DOT net.