Skip to content

HID: K116s trackpad: clamp the oversized report size, parse the Trackpad26 frames - #1830

Merged
DjDeveloperr merged 2 commits into
aurora-silicon:integration/aurorafrom
axboe:k116s-trackpad
Nov 14, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-silicon:integration/aurorafrom
axboe:k116s-trackpad

Conversation

@axboe

@axboe axboe commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

The K116s (16" M5 Pro OLED) trackpad does not bind on integration/aurora: the HID descriptor fails to parse, on hid-generic and on magicmouse.

hid-generic 0019:05AC:0362.0002: invalid report_size 524288
magicmouse 0019:05AC:0362.0002: item 0 4 1 7 parsing failed
magicmouse 0019:05AC:0362.0002: probe with driver magicmouse failed with error -22

Two commits:

  1. HID: dockchannel-hid: clamp a report size the HID core rejects
    The multi-touch firmware declares its one vendor report with a Report Size of 0x80000 bits. Clamp it to the core's limit before parsing.
  2. HID: magicmouse: support the K116s Trackpad26 frame format
    With the descriptor parsed the trackpad still gives no events: the firmware ("SensingAlgsTrackpad26C", product 0x0362) declares a single unnumbered report and sends "5a 01" frames with stream-keyed records, not MTP report 0x75. The commit keeps report 0x75 for descriptors that number their reports and adds a parser for the new frames (contacts with position, ellipse, orientation and force as floats, and the button word). Details are in the commit message.

Overlap with #1737: its first commit clamps the same Report Size for the 14" M5 Max. Either clamp works for the K116s; I'm happy to drop commit 1 here in favour of #1737 once it is boot-tested. On the K116s the clamp alone is not enough, which is what commit 2 is for. I don't know if the M5 Max trackpad sends the same frame format; if #1737's author can dump a few frames we can tell.

Testing, on a K116s on the 27.2 stub at EL2:

  • Both commits have been in my daily kernel since 11 Nov, most recently on integration/aurora aa68b3c: pointer, two-finger scroll and click work in a Plasma Wayland session. Palm contacts are reported as MT_TOOL_PALM; I have not tested palm rejection specifically.
  • Today's integration/aurora 10dca1d without them: the parse failure above, no trackpad.
  • This branch is those two commits cherry-picked onto 4277bdd. The only change from what I run is whitespace (two wrapped lines and an else body re-indented for checkpatch); git diff -w shows nothing else. I have not rebuilt or booted this exact tip.
  • checkpatch --strict: clean on both.

Not tested: the older MTP trackpads (T6000 to T6041). The change for them is that report 0x75 is registered only when the descriptor numbers its reports, which theirs do, but I have no such machine.

The K116s multi-touch firmware declares its single vendor report with a
Report Size of 0x80000 bits. The HID core refuses any field wider than
16384 bits, so the descriptor failed to parse and the trackpad never
registered. Clamp such a size to the core's limit before parsing; the
frames are a few hundred bytes and the driver handles them itself.

Signed-off-by: Jens Axboe <axboe@kernel.dk>

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Commit 1 (clamp a Report Size above 16384 bits) is fine: a descriptor that trips it never parsed before, so nothing that works today changes.

Commit 2 needs tighter gating. The report choice in magicmouse_probe() now depends on report_enum[HID_INPUT_REPORT].numbered for every BUS_HOST (MTP) trackpad. Today, hid_register_report(..., MTP_REPORT_ID) also makes an unnumbered descriptor numbered, and 0x75 frames are delivered either way. With this change, an MTP board whose descriptor declares no input Report ID would get report_id_hash[0] and its descriptor's size instead of report 0x75, and would stop producing events. mtp_tp26 excludes the J700 (C1FE), but this registration change does not. Nothing here shows which of the M1–M5 and A18 Pro MTP descriptors number their input reports.

Requested:

  • Register 0x75 and set report->size = 6 exactly as before unless msc->mtp_tp26.
  • Set mtp_tp26 from the Trackpad26 identity (product 0x0362, or a DT compatible for the K116s multitouch node), not from the descriptor's numbering alone.

That keeps every other MTP trackpad byte-for-byte on the old path.

The 16-inch M5 Pro's trackpad (HID product 0x0362, firmware
"SensingAlgsTrackpad26C") is not the MTP report 0x75 device the host bus
path expects. Its descriptor declares one unnumbered vendor report, and
registering report 0x75 on it switched the HID core to numbered lookups,
which then dropped every frame as the undefined report ID 0x5a. For this
product only, use the report the descriptor declares and keep its size;
every other MTP trackpad registers report 0x75 with size 6 as before.

Parse the frames the firmware sends instead: "5a 01", a frame type, a
microsecond timestamp, a sequence number and records keyed by 16-byte
stream ids. The contact stream carries a count, flags and 48-byte records
with the contact id, state and class and IEEE 754 floats: position in
micrometres (x from the centre, y from the bottom edge), velocity, the
touch ellipse, orientation in radians and force in grams. The button
stream is a word that is 1 while the pad is clicked; the firmware owns
the actuator. Report the touches on 10 um axes with the pad's 160x100 mm
size, palms as MT_TOOL_PALM, force as pressure, and stop the core from
processing the oversized report afterwards.

An MTP trackpad is also marked as a pointer and never a direct-touch
surface, which the K116s descriptor had made hid-input assume.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
@axboe

axboe commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

@DjDeveloperr thanks, agreed on both points. Pushed a68b432 (commit 1 unchanged):

  • mtp_tp26 is now set from the HID product (0x0362) in the BUS_HOST block, not from the descriptor's numbering.
  • Report registration is the old code unless mtp_tp26: every other MTP trackpad registers 0x75 and gets report->size = 6 as before. Only the Trackpad26 product uses the descriptor's own report and keeps its size.

The keyboard interface carries the same product but is not HID_TYPE_SPI_MOUSE, so it never gets here.

Retested on the K116s by swapping the module on a running kernel (integration adb5a7e plus the K116s commits): binds, haptics initialise, pointer, click and two-finger scroll work.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. Both points from the last review are addressed in a68b432:

  • The Trackpad26 gate: mtp_tp26 is now set from HID product 0x0362 inside the BUS_HOST block, and never on the C1FE controller.
  • Report registration: every other MTP trackpad registers report 0x75 with size 6, exactly as before. So the T6000-T6041 trackpads, the M5 Pro trackpad (product 0x0359) and the J700 (C1FE) stay on the old path, and only the Trackpad26 product uses the descriptor's own report and size.

The report-size clamp commit is unchanged from what I reviewed before. The INPUT_PROP_POINTER set and INPUT_PROP_DIRECT clear apply to every MTP trackpad, which matches what they are.

Approving.

@DjDeveloperr
DjDeveloperr merged commit 948f871 into aurora-silicon:integration/aurora Nov 14, 2026
1 check passed
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