Skip to content

Rebind hid-multitouch on resume to recover Razer Blade AMD trackpad click#5453

Open
arun9486 wants to merge 1 commit intobasecamp:devfrom
arun9486:fix-razer-amd-trackpad-resume
Open

Rebind hid-multitouch on resume to recover Razer Blade AMD trackpad click#5453
arun9486 wants to merge 1 commit intobasecamp:devfrom
arun9486:fix-razer-amd-trackpad-resume

Conversation

@arun9486
Copy link
Copy Markdown

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 AMDI0010 I2C controller. After S3/S4 the device returns with stale firmware state and the I2C HID driver doesn't re-initialize it. Reloading hid_multitouch forces 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 reloads hid_multitouch. Guarded by $1 == "post" so it only fires on resume.
  • install/config/hardware/fix-razer-amd-trackpad.sh — DMI-gated installer. Triple check (vendor Razer + AMDI0010 platform device + 06CB:CDA3 HID 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 to fix-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-*.sh hardware scripts, which also only run on fresh install. Happy to add a migration if preferred.

Test plan

  • On affected hardware (Razer Blade 14 RZ09-0370, AMD): sleep cycle without the hook → click broken on resume; with the hook → click works on every resume.
  • Detection guard verified: all three gates (DMI vendor, AMDI0010 device, 06CB:CDA3 HID) present on the affected machine.
  • Detection guard on non-affected hardware — script exits cleanly with no install (logically correct from the conditions, not separately reproduced).

Copilot AI review requested due to automatic review settings April 26, 2026 15:38
@arun9486 arun9486 force-pushed the fix-razer-amd-trackpad-resume branch from 12eed52 to 5b898b8 Compare April 26, 2026 15:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sleep post-resume hook that reloads hid_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.

Comment on lines +8 to +14
# 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
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@arun9486 arun9486 force-pushed the fix-razer-amd-trackpad-resume branch from 5b898b8 to d4ea812 Compare April 26, 2026 15:42
@arun9486 arun9486 changed the title Reload hid_multitouch on resume for Razer Blade AMD trackpad Reload hid_multitouch on resume to recover Razer Blade AMD trackpad click Apr 26, 2026
…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.
Copilot AI review requested due to automatic review settings April 26, 2026 18:35
@arun9486 arun9486 force-pushed the fix-razer-amd-trackpad-resume branch from d4ea812 to cc1db67 Compare April 26, 2026 18:35
@arun9486 arun9486 changed the title Reload hid_multitouch on resume to recover Razer Blade AMD trackpad click Rebind hid-multitouch on resume to recover Razer Blade AMD trackpad click Apr 26, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +26 to +27
echo "$name" > "$driver/unbind" 2>/dev/null
echo "$name" > "$driver/bind" 2>/dev/null
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +4
# 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.
Copy link

Copilot AI Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants