I2C Touchpads on FreeBSD 13.0-CURRENT
Why is my touchpad not working?Since I got my laptop I couldn't get the touchpad working on FreeBSD current, no matter what I tried. It happened at first that the intel I2C was not supported, after that, the HID interface for I2C was not working. It is frustrating.
How to solve it?The idea came during the FreeBSD's DevSummit before FOSDEM in 2020 when I talked to another FreeBSD developer, Kamila Souckova, to get it fixed (or try it). We knew about a patch under review and, after trying to apply the patch, it failed to compile under FreeBSD 13-CURRENT.
We looked for another solution and she found a project in github that seemed promising. So she tried and worked, so I gave it a change and the results are positive: the touchpad is working.
Fixing itThe solution is easy: clone the repository, build it, install it and configure Xorg to use it.
Cloning the repositoryJust run git clone https://github.com/wulf7/iichid and you'll get the sources locally. Easy, right?
Building the sourcesYou would need the sources of the running operating system under /usr/src and run make inside the directory where the sources where cloned.
Installing the sourcesRun make install and you will get the sources installed in /boot/modules. To load the module at boot time, add the module iichid to kld_list in rc.conf or add the line iichid_load="YES" in /boot/loader.conf
Configure XorgThe configuration for Xorg is the following:
Section "InputDevice" Identifier "Touchpad" Driver "libinput" Option "Device" "/dev/input/event6" Option "AutoServerLayout" "true" EndSection
Add it to a file under /usr/local/etc/X11/xorg.conf.d/ and that would be it :)