Rebind hid-multitouch on resume to recover Razer Blade AMD trackpad click#5453
Rebind hid-multitouch on resume to recover Razer Blade AMD trackpad click#5453arun9486 wants to merge 1 commit intobasecamp:devfrom
Conversation
12eed52 to
5b898b8
Compare
There was a problem hiding this comment.
Pull request overview
Adds a hardware-specific systemd sleep hook to restore Razer Blade (AMD) trackpad click functionality after suspend/hibernate by re-initializing the HID multitouch stack.
Changes:
- Add a
systemd/system-sleeppost-resume hook that reloadshid_multitouch. - Add a DMI + device-ID gated installer script to deploy the hook only on matching Razer/AMD/Cypress hardware.
- Wire the new hardware fix into the main install flow.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
install/config/hardware/fix-razer-amd-trackpad.sh |
Detects the target Razer AMD platform + HID device and installs the system-sleep hook. |
default/systemd/system-sleep/fix-razer-amd-trackpad |
Runs on resume (“post”) to recover click events by reinitializing hid_multitouch. |
install/config/all.sh |
Invokes the new hardware fix during installation alongside other hardware-specific scripts. |
Tip
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # nothing fails from its perspective. Reloading hid_multitouch forces | ||
| # the driver to detach and re-bind, which re-initializes the I2C HID | ||
| # protocol and recovers the click. | ||
|
|
||
| if [[ $1 == "post" ]]; then | ||
| modprobe -r hid_multitouch 2>/dev/null | ||
| modprobe hid_multitouch 2>/dev/null |
There was a problem hiding this comment.
Reloading the whole hid_multitouch module is a global operation: it can disrupt any other devices using that module, and modprobe -r hid_multitouch will fail if the module is in use (in which case the intended detach/rebind won’t happen and the click issue may remain). Consider re-binding only the affected HID device(s) (e.g., unbind/bind the *06CB:CDA3* entries under /sys/bus/hid/drivers/hid-multitouch/) or otherwise targeting the specific device instead of unloading the module.
| # nothing fails from its perspective. Reloading hid_multitouch forces | |
| # the driver to detach and re-bind, which re-initializes the I2C HID | |
| # protocol and recovers the click. | |
| if [[ $1 == "post" ]]; then | |
| modprobe -r hid_multitouch 2>/dev/null | |
| modprobe hid_multitouch 2>/dev/null | |
| # nothing fails from its perspective. Re-binding only the affected | |
| # hid_multitouch device forces the driver to detach and re-bind, which | |
| # re-initializes the I2C HID protocol and recovers the click without | |
| # disrupting other hid_multitouch devices. | |
| if [[ $1 == "post" ]]; then | |
| for device_path in /sys/bus/hid/drivers/hid-multitouch/*06CB:CDA3*; do | |
| [[ -d "$device_path" ]] || continue | |
| device_name=${device_path##*/} | |
| printf '%s' "$device_name" > /sys/bus/hid/drivers/hid-multitouch/unbind 2>/dev/null | |
| printf '%s' "$device_name" > /sys/bus/hid/drivers/hid-multitouch/bind 2>/dev/null | |
| done |
There was a problem hiding this comment.
Good catch — switched to per-device unbind/bind under /sys/bus/hid/drivers/hid-multitouch/ so it targets only the Cypress 06CB:CDA3 entry and is independent of module refcount. Verified on the affected hardware: rebind re-runs the I2C HID protocol negotiation and recovers the click. Updated in the latest force-push.
5b898b8 to
d4ea812
Compare
…lick After suspend or hibernate on Razer Blade laptops with AMD chipsets, the trackpad click stops working until reboot — motion still tracks, but no click button events arrive. The kernel logs nothing, so the driver doesn't notice the failure. Root cause: the Cypress 06CB:CDA3 I2C HID touchpad on AMD's AMDI0010 controller returns from S3/S4 with stale firmware state. The i2c-hid / hid-multitouch resume path doesn't re-initialize the device, so the input node stays live but emits no buttons. No in-kernel fix yet; this is a userspace workaround until a quirk lands upstream. Unbinding and re-binding the affected HID device under /sys/bus/hid/drivers/hid-multitouch/ forces the driver to re-run the I2C HID protocol negotiation and recovers the click. Targeting the specific device (not unloading the module) avoids disturbing any other multitouch device on the system and is independent of module refcount. Gated by DMI vendor "Razer" plus presence of both the AMDI0010 platform device and the 06CB:CDA3 HID device, so it's a no-op on Intel Razers or Razer models with a different touchpad.
d4ea812 to
cc1db67
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| echo "$name" > "$driver/unbind" 2>/dev/null | ||
| echo "$name" > "$driver/bind" 2>/dev/null |
There was a problem hiding this comment.
echo ... > "$driver/unbind" 2>/dev/null won’t reliably suppress errors from the > redirection itself (bash reports redirection failures before the 2>/dev/null takes effect). If the write fails during resume, this can still emit “Permission denied”/ENOENT messages to the journal. Consider redirecting stderr for the whole operation (e.g., grouping the command and redirecting) or using a tee-based write to ensure errors are intentionally handled/suppressed.
| echo "$name" > "$driver/unbind" 2>/dev/null | |
| echo "$name" > "$driver/bind" 2>/dev/null | |
| { echo "$name" > "$driver/unbind"; } 2>/dev/null | |
| { echo "$name" > "$driver/bind"; } 2>/dev/null |
| # Install resume sleep-hook for Razer Blade laptops with the Cypress | ||
| # 06CB:CDA3 I2C HID touchpad on AMD's AMDI0010 controller. After S3/S4 | ||
| # the touchpad returns with stale state and click stops working; the | ||
| # hook reloads hid_multitouch on every resume to recover it. |
There was a problem hiding this comment.
The header comment says the hook “reloads hid_multitouch”, but the installed system-sleep script actually unbinds/rebinds the specific HID device under the hid-multitouch driver. Please update this comment (and ideally the PR title/description) to match the implementation so future readers don’t go looking for a module reload that never happens.
Summary
On Razer Blade laptops with AMD chipsets, the trackpad click stops responding after resume from suspend or hibernate. Motion still works; only the click button events drop. The kernel logs nothing on resume — the driver doesn't notice anything is wrong, so users typically don't realize it's recoverable without a reboot.
The affected hardware is the Cypress 06CB:CDA3 I2C HID touchpad on AMD's
AMDI0010I2C controller. After S3/S4 the device returns with stale firmware state and the I2C HID driver doesn't re-initialize it. Reloadinghid_multitouchforces a clean detach + re-bind, which re-runs the protocol negotiation and recovers the click. There's no clean fix in 6.x kernels yet; this is a userspace workaround until that lands.Changes
default/systemd/system-sleep/fix-razer-amd-trackpad— post-resume hook that reloadshid_multitouch. Guarded by$1 == "post"so it only fires on resume.install/config/hardware/fix-razer-amd-trackpad.sh— DMI-gated installer. Triple check (vendorRazer+AMDI0010platform device +06CB:CDA3HID device) so it's a no-op on Intel Razers and on Razer models with a different touchpad.install/config/all.sh— wired into the hardware-fix block next tofix-tuxedo-backlight.sh, matching the existing vendor-fix pattern.Existing installs won't pick this up — there's no migration. Following the convention of the other
fix-*.shhardware scripts, which also only run on fresh install. Happy to add a migration if preferred.Test plan
AMDI0010device,06CB:CDA3HID) present on the affected machine.