Repository navigation
HID: K116s trackpad: clamp the oversized report size, parse the Trackpad26 frames - #1830
Conversation
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
left a comment
There was a problem hiding this comment.
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 = 6exactly as before unlessmsc->mtp_tp26. - Set
mtp_tp26from 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>
|
@DjDeveloperr thanks, agreed on both points. Pushed a68b432 (commit 1 unchanged):
The keyboard interface carries the same product but is not 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. |
8b65e15 to
a68b432
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks. Both points from the last review are addressed in a68b432:
- The Trackpad26 gate:
mtp_tp26is 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.
948f871
into
aurora-silicon:integration/aurora
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.
Two commits:
HID: dockchannel-hid: clamp a report size the HID core rejectsThe multi-touch firmware declares its one vendor report with a Report Size of 0x80000 bits. Clamp it to the core's limit before parsing.
HID: magicmouse: support the K116s Trackpad26 frame formatWith 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:
git diff -wshows nothing else. I have not rebuilt or booted this exact tip.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.