Repository navigation
HID: magicmouse: report the force click as KEY_INFO by default - #3039
RyanTheTide wants to merge 2 commits into
Conversation
The host already tells a deep click (the second, firmer stage of a Force Touch click) from an ordinary one and plays its haptic, but reports it to userspace only if haptic_deep_keycode names a key, and nothing names one. So a force click does nothing on the desktop, where macOS opens Quick Look on the item under the pointer. Default the key to KEY_INFO. Linux has no force-click key; KEY_INFO (keysym XF86Info) has no default binding on the desktops we ship, so the key is inert until the desktop binds it to what a force click does there (in GNOME Files: the preview of the item clicked). It stays on the separate "<trackpad> Force Click" input device, held for as long as the deep stage lasts; haptic_deep_keycode=0 still turns it off. This applies to every trackpad with host-derived clicks (the MTP pads with an actuator); the SPI pads have no deep-click detection yet. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal adversarial §1–§6 pre-PR review at live head 3c9f4c80e609197a28170b0be6ab5b37759c0f84 (checked against live integration/aurora 5746ef8a5afd).
Checklist Audit (§1–§4, §6)
- §1 No model gating: Pass. Uses existing driver capability/path without chip/board/firmware gates.
- §2 Production-ready / Code review (
drivers/hid/hid-magicmouse.c):- Changing
haptic_deep_keycodefrom0toKEY_INFOactivatesmagicmouse_setup_force_input()andmagicmouse_force_key()by default on every internal Apple trackpad with haptics. - Factual discrepancy in commit message / PR body (SPI trackpads): Both state "the SPI pads have no deep-click detection yet", but in live
drivers/hid/hid-magicmouse.c,magicmouse_init_haptics()runs for bothBUS_HOSTandBUS_SPI(lines 2785–2786), registers"<name> Force Click"withKEY_INFOon SPI trackpads too (line 2732), andmagicmouse_raw_event_spi()(line 1494) delegates directly tomagicmouse_raw_event_mtp()->magicmouse_haptic_click()->magicmouse_force_key()(withhaptic_deep_thresholdcomments even calibrated from J313 atline 119). Please correct the scope description (or clarify/test SPI behavior). - Non-blocking error-path note (
apple_taptic_init_mtp, lines 2731–2751):magicmouse_setup_force_input(msc)runs beforeinput_ff_create(). Ifinput_ff_create()fails,msc->hapticsremainsNULL, leaving an orphaned devm-managed"Force Click"input device registered until unbind. Callingmagicmouse_setup_force_input(msc)afterinput_ff_create()succeeds avoids that.
- Changing
- §3 Safety: Pass.
- §4 Clean-room & Attribution: Pass. Single commit
3c9f4c80e609has human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only; zero AI commit trailers;Assisted-by:disclosed in PR body. - §6 Naming & CI: Pass. Clean naming; CI
host-testsisSUCCESS.
Blockers (§5)
- No full boot on exact head
3c9f4c80e609and no default-cmdline regression tuple: Testing only live-swapped the module onto an unrelatedfleet85kernel and reverted it, without reporting kernel/build ID, 0 AVC denials, 0 failed units, and 0 new kernel errors on a clean default-cmdline boot of3c9f4c80e609. - Feature event not exercised on hardware: Only capability-mask exposure was checked; an actual deep-click press/release emitting
KEY_INFO(and verifying no stuck key across release / suspend-resume) has not yet been run on this kernel (listed underStill to run). - No regression Mac for shared driver:
hid-magicmouse.cis shared across all internal MTP (M2–M5) and SPI (M1) trackpads plus external Magic Mouse/Trackpad devices. Please include at least a second Mac regression row (e.g., J713/J413 MTP and/or an M1 SPI trackpad, since SPI also registers the newForce Clickinput device).
Assisted-by: LLM (Gemini 4 Neon)
magicmouse_setup_force_input() ran before input_ff_create(). When input_ff_create() failed, the trackpad was left without haptics but with a registered "<trackpad> Force Click" input device that could never send anything, until the driver was unbound. Set the Force Click device up only once the FF device exists. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Thanks. At 1f03387: (1) the PR body now has the scope right: the SPI pads (M1) take the same deep-click path and get the Force Click device too. The first commit's message is wrong on that point and stays as is, since we do not force push. (2) The non-blocking error path is fixed in 1f03387: the Force Click device is created only after |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 re-review at live head 1f033871260a9878d42903b1e6674495d85a2aee (against integration/aurora 5746ef8a5afd, MERGEABLE/CLEAN, CI 1/1 SUCCESS: Host tests / host-tests), following up on #6033464171.
Resolution of Earlier Findings
- SPI trackpad scope discrepancy: Resolved in the PR body (
<details><summary>Scope</summary>) and PR comment, which now accurately document that M1 SPI trackpads share the deep-click path and also register the"Force Click"device. (Acknowledged that commit3c9f4c80e6's message retains the earlier wording to avoid force-pushing.) - Error-path ordering in
apple_taptic_init_mtp(): Cleanly fixed in1f03387126—magicmouse_setup_force_input(msc)now runs strictly afterinput_ff_create()succeeds, avoiding an orphaned"Force Click"input device on FF init failure.
Current §1–§6 Status
- §1–§4, §6 & CI: All pass cleanly. Both commits (
3c9f4c80e609,1f033871260a) have human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and humanSigned-off-by:only, zero AI commit trailers,Assisted-by:in PR body, and green CI (Host tests / host-tests: SUCCESS). - §5 Evidence (still owed before
APPROVE): Keeping priorCHANGES_REQUESTEDin place and postingCOMMENThere since code/CI/policy are now 100% clean and only the queued exact-head (1f033871260a) hardware rows remain:- Clean default-cmdline boot at exact head
1f033871260awith full §5 regression tuple (0 SELinux denials, 0 failed units, 0 new kernel errors). - Real physical deep-click press/release emitting
KEY_INFO(verifying no stuck key across release and suspend/resume). - Cross-Mac regression rows on a second MTP pad (J713/J413) and an M1 SPI pad (J316s).
- Clean default-cmdline boot at exact head
Once those rows are posted, this is ready to convert to APPROVE.
Assisted-by: LLM (Gemini 4 Neon)
|
Exact-head rows at
This also confirms the SPI scope: the M1 SPI pad registers its Force Click device the same way. Still owed: a real deep click by a person. Press and release on a real finger needs Ryan; the stuck-key check above is the key state before and after suspend, with no press. Details
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 review at live head 1f033871260a9878d42903b1e6674495d85a2aee, after the exact-head rows posted at 06:04Z. Nothing has been pushed since my 04:21Z COMMENT.
Verdict: COMMENT. Code, CI and policy are clean. Two of the three §5 items I asked for are now covered. One is still owed, so this doesn't approve yet.
§5 rows at 1f033871260a (kernel 7.3.0-aurora-fc3039)
- Accepted: default-cmdline boot and the regression tuple. J713 (M4 Air, MTP), J615 (M3 Air, MTP) and J316s (M1 Pro, SPI) each booted the head once on their production cmdline. Each shows Enforcing, 0 AVC, 0 failed units and 0 Oops.
haptic_deep_keycodereads 358 with nothing set on the cmdline. - Accepted: cross-Mac rows. A second MTP Mac (J713) and an M1 SPI Mac (J316s) both register their
Force Clickdevice with KEY_INFO (358). This also confirms the SPI scope in the PR body. On all three Macs, a 15 ss2idleshows KEY_INFO released before and after suspend (EVIOCGKEY), with 0 Oops. - Note (not blocking): J713 kernel errors, 9 vs 2. The extra lines come from apple-dcp
no IOMMU domain, dwc3-appleUSB3 PHY setup failed, err=-95, sn201202x cable revalidation and thermal_zone1. None of these ishid-magicmouse, so I accept that they don't come from this PR. Still, the baseline is the fleet85 kernel, notintegration/aurorawithout this PR. That makes these errors a possibleintegration/auroraregression on J713, which should be followed up on its own (for example, against the #2962 DCP DART work).
Still owed
- A real deep click by a person on this kernel. Press and release on the pad, with KEY_INFO going down on the deep stage and up on release, and no stuck key after release. The PR body and your 06:04Z comment both list this as owed. It is the one event this default change turns on for every Mac with a haptic trackpad, and the rows so far only check the device, its capabilities and the idle key state.
§1–§6
- §1 Pass: no chip/board/firmware gates, and it runs on the existing haptic path for MTP and SPI.
- §2 Pass: no new parameters are needed.
haptic_deep_keycode=0still turns the key off. The Force Click device is now set up only afterinput_ff_create()succeeds. - §3 Pass.
- §4 Pass: both commits have a human author and committer (Ryan Murray) and a human
Signed-off-by:only.Assisted-by:is in the PR body. - §5 Open: only item 1 above.
- §6 Pass.
- CI: 1/1
Host tests / host-testsSUCCESS.MERGEABLE/CLEANagainstintegration/aurora.
Once the real-press row is posted, this converts to APPROVE.
Assisted-by: LLM (Claude Opus 5.5)
Problem. A force click (the second, firmer stage of a Force Touch click) does nothing on the desktop. On macOS it opens Quick Look on the item under the pointer. The driver already detects the deep stage and plays its haptic (Ryan: both click levels work on the J615), and it can hold a key on a separate " Force Click" input device. It only does so if
haptic_deep_keycodenames a key, and nothing names one, so userspace never sees a force click.Change. Default
haptic_deep_keycodetoKEY_INFO. Linux has no force-click key.KEY_INFO(keysymXF86Info) has no default binding on our desktops, so the key is inert until the desktop binds it. The GNOME side, which opens the Files previewer for the clicked item, is a separate userspace change (linked from the lane).haptic_deep_keycode=0still turns it off.Testing. J615 (MacBook Air M3), fleet85 plus this change, module swapped live:
Apple MTP multi-touch Force Clickappears with key 358 (KEY_INFO) in its capability mask, libinput lists it on seat0, andhaptic_pressis re-applied by the udev rule. The stock module was restored afterwards. The userspace binding was proven separately on the same Mac withKEY_INFOinjected through uinput: with the extension the previewer opens on the selected file, without it nothing happens.Still to run. A real force click by a person on this kernel with the extension installed. A J713 or J413 device row (any MTP pad) and an M1 SPI pad row (the J316s), both at the PR head.
Scope
The key comes from the existing host-derived deep click. That covers every internal trackpad with an actuator: the MTP pads (M2 and later) and the SPI pads (M1 generation), whose raw events go through the same MTP click path. (The first commit's message says the SPI pads have no deep-click detection yet. That is wrong, and it stays in history because we do not force push.)
A second commit creates the Force Click device only after the FF device exists, so a failed
input_ff_create()leaves no orphaned Force Click device.