Skip to content

About

Surface Pro 5 (2017) on a stock Linux kernel: Type Cover palm-click fix and IPTS touchscreen driver as DKMS module

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Surface Pro 5 on a stock Linux kernel: Type Cover touchpad and touchscreen

Kurzfassung (Deutsch): Zwei Korrekturen für das Surface Pro 5 (2017) unter Linux, ohne linux-surface-Kernel. 1. Type-Cover-Touchpad: Der Handballen löst beim Tippen keine Klicks mehr aus, der Cursor springt nicht mehr. 2. Touchscreen: der IPTS-Treiber aus dem linux-surface-Projekt als DKMS-Modul für den normalen Distributionskernel. Getestet auf CachyOS mit KDE Plasma 6.8.

Two fixes for the Microsoft Surface Pro (5th gen, 2017) that work with the regular distribution kernel, no custom kernel needed:

Problem Fix Folder
Cursor jumps while typing: the palm on the touchpad triggers tap-clicks udev hwdb entry, marks the Type Cover touchpad as internal touchpad/
Touchscreen does not react at all IPTS driver from linux-surface, packaged as DKMS module ipts-dkms/

Tested on: Surface Pro (5th gen, model 1796), Type Cover 045E:09C2, CachyOS with linux-cachyos 7.3.1 (clang/LTO build) and linux-cachyos-lts 6.18, KDE Plasma 6.8 on Wayland. Other distributions and Surface models are untested.

1. Type Cover touchpad: palm clicks while typing

Symptom: While typing, the cursor or text position jumps somewhere else, as if something clicked. Typically the right palm rests on the right edge of the touchpad. Windows on the same device does not show it.

Cause: The Type Cover hangs off a USB port that the firmware reports as removable. udev therefore sets ID_INPUT_TOUCHPAD_INTEGRATION=external for its touchpad. For external touchpads libinput offers neither disable-while-typing nor palm detection, so with tap-to-click every brief palm contact becomes a click. systemd already ships the same fix for the 045E:09C0 cover (systemd#43262), but not for 045E:09C2.

Fix:

lsusb | grep 045e:09c2          # make sure this is your Type Cover
sudo cp touchpad/70-touchpad-surface-typecover.hwdb /etc/udev/hwdb.d/
sudo systemd-hwdb update
sudo udevadm trigger -s input

Then detach and reattach the Type Cover, or reboot.

Check:

ev=$(grep -l "Type Cover Touchpad" /sys/class/input/event*/device/name | cut -d/ -f5)
udevadm info /dev/input/$ev | grep INTEGRATION
# expected: E: ID_INPUT_TOUCHPAD_INTEGRATION=internal

In KDE the option Disable while typing now appears under System Settings → Touchpad and is on by default. The same page has natural (inverted) scrolling and the scroll speed, in case two-finger scrolling feels too fast.

Undo: delete the file, run sudo systemd-hwdb update, reattach the cover.

2. Touchscreen: IPTS driver as DKMS module

The Surface Pro 5 touchscreen is an Intel Precise Touch & Stylus (IPTS) device behind the Intel Management Engine (MEI). Its driver is not in the mainline kernel; the linux-surface project carries it as a kernel patch. This folder takes only the driver (drivers/hid/ipts/) from that patch and builds it as an out-of-tree module with DKMS, so it works with the kernel your distribution ships and is rebuilt automatically on kernel updates.

Install on Arch / CachyOS

sudo pacman -S --needed base-devel dkms linux-headers   # use the headers of your kernel,
                                                        # e.g. linux-cachyos-headers
cd ipts-dkms
makepkg -si

Install on other distributions (untested)

ver=7.3.1.fd65adb
sudo mkdir -p /usr/src/ipts-$ver
sudo cp ipts-dkms/src-ipts/* /usr/src/ipts-$ver/
sed "s/@PKGVER@/$ver/" ipts-dkms/dkms.conf | sudo tee /usr/src/ipts-$ver/dkms.conf >/dev/null
sudo dkms install ipts/$ver

Check

dkms status ipts                 # "installed" for each kernel
lsmod | grep ipts                # loads automatically via the MEI client alias
sudo dmesg | grep -i ipts

Touch the screen afterwards; a reboot is not required if the module loaded.

Notes and limits

  • Finger touch is tested; the stylus is not. Without iptsd the screen works as a plain HID multitouch device. iptsd adds touchscreen palm rejection and stylus processing.

  • Secure Boot: the module is unsigned and taints the kernel (OE). With Secure Boot enabled you have to sign it with your own MOK key, otherwise the kernel refuses to load it. The test device runs with Secure Boot off.

  • What is left out: the linux-surface patch also adds MEI PCI IDs for newer devices and an IOMMU tweak. Both are kernel changes a module cannot carry, and neither was needed on the Surface Pro 5 (its MEI device is already supported by mainline, the IOMMU was inactive). Newer Surface models may need them and therefore the linux-surface kernel.

  • Kernel updates: DKMS rebuilds the module for each new kernel. If a future kernel breaks the build, take the driver from the matching linux-surface series:

    git clone https://github.com/linux-surface/linux-surface
    ipts-dkms/update-from-linux-surface.sh ./linux-surface 7.4

    then bump pkgver in PKGBUILD and reinstall.

Credits and license

The IPTS driver is written by Dorian Stoll and maintained by the linux-surface project. This repository only repackages it; driver bugs belong upstream, packaging issues here.

Everything here is licensed under the GNU General Public License v2.0 or later, see LICENSE. Driver source: linux-surface patches/7.3/0005-ipts.patch at commit fd65adb.

About

Surface Pro 5 (2017) on a stock Linux kernel: Type Cover palm-click fix and IPTS touchscreen driver as DKMS module

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages