New solution to haptic touchpad

This commit is contained in:
David Heiemeier Hansson
2026-03-26 11:08:44 +01:00
parent e7f8826dea
commit 15538c4f5a
2 changed files with 111 additions and 12 deletions
@@ -1,31 +1,35 @@
# Fix Dell XPS haptic touchpad losing haptic feedback after suspend/resume.
# The I2C controller's runtime power management aggressively suspends the touchpad,
# and on resume the haptic engine sometimes fails to reinitialize.
# This udev rule keeps the I2C controller always on to prevent that.
# Applies to any Dell XPS with the Synaptics haptic touchpad (06CB:D01A).
# Fix Dell XPS haptic touchpad.
# The Synaptics haptic touchpad (06CB:D01A) uses the HID Manual Trigger
# protocol, but the kernel's HID haptic subsystem only supports Auto Trigger.
# This sets up a lightweight daemon that monitors touchpad button events and
# sends haptic pulses via HID feature reports on the hidraw device.
# Also disables I2C runtime PM to prevent the haptic engine losing state
# across suspend/resume.
if omarchy-hw-match "XPS" \
&& ls /sys/bus/i2c/devices/i2c-VEN_06CB:00 2>/dev/null; then
# Disable runtime PM for I2C controller so haptic state isn't lost
# Keep I2C controller power on to prevent haptic engine losing state
sudo tee /etc/udev/rules.d/99-dell-xps-haptic-touchpad.rules << 'EOF'
ACTION=="add", SUBSYSTEM=="pci", KERNEL=="0000:00:19.0", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="platform", KERNEL=="i2c_designware.0", ATTR{power/control}="on"
EOF
sudo udevadm control --reload-rules
# Rebind the I2C HID touchpad on boot and resume to reinitialize haptic engine
sudo tee /etc/systemd/system/dell-xps-haptic-touchpad.service << 'SVC'
# Haptic feedback daemon as a systemd service
sudo tee /etc/systemd/system/dell-xps-haptic-touchpad.service << SVC
[Unit]
Description=Rebind Dell XPS haptic touchpad
Description=Dell XPS haptic touchpad feedback
After=systemd-udev-settle.service
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'if [[ -d /sys/bus/i2c/devices/i2c-VEN_06CB:00 ]]; then echo "i2c-VEN_06CB:00" | tee /sys/bus/i2c/drivers/i2c_hid_acpi/unbind > /dev/null 2>&1; sleep 1; echo "i2c-VEN_06CB:00" | tee /sys/bus/i2c/drivers/i2c_hid_acpi/bind > /dev/null 2>&1; fi'
Type=simple
ExecStart=$OMARCHY_PATH/bin/omarchy-haptic-touchpad
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target suspend.target hibernate.target
WantedBy=multi-user.target
SVC
sudo systemctl daemon-reload
sudo systemctl enable dell-xps-haptic-touchpad.service