Skip to content

arm64: dts: apple: t6041-j616c: enable MTP touch states - #4072

Draft
allanclempe wants to merge 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-j616c-mtp-touch-states
Draft

allanclempe wants to merge 1 commit into
aurora-silicon:mainfrom
allanclempe:fix/t6041-j616c-mtp-touch-states

Conversation

@allanclempe

Copy link
Copy Markdown
Contributor

What: Add apple,touch-states; to &mtp_hid's multi-touch node in t6041-j616c.dts so hid-magicmouse uses firmware touch states and path IDs (matching t8142-j813.dts and t8142-j815.dts) instead of unbounded slot reassignment that triggers libinput Touch jump detected and discarded..
Tested: J616c DTB at 5ccc09add: scripts/checkpatch.pl --strict --no-tree (0 errors, 0 warnings, 0 checks) and cpp + dtc compilation of t6041-j616c.dtb pass with +apple,touch-states; in multi-touch as the sole DTB diff (draft pending live boot test).
Risk: two-way door · J616c (apple,j616c MTP trackpad node only).
Not yet: Live boot and multi-touch/palm-rejection trackpad test on J616c hardware (keeping as draft until boot-verified).

Details

On J616c (MacBook Pro 16" M4 Max), the MTP trackpad uses the 6310.85.7 firmware family (matching J813 in #2613), whose standard 38-byte contact records encode contact touch state in the high byte and firmware path ID in the low byte of the first word (unknown1).

Without apple,touch-states; in t6041-j616c.dts, hid-magicmouse leaves msc->mtp_states false:

  • Off-surface approaching/leaving contacts (states 1, 2, 5, 6) leak into evdev as active touches.
  • magicmouse_raw_event_mtp() falls back to input_mt_assign_slots(..., dmax = 0) instead of input_mt_get_slot_by_key(), handing an active MT slot to another contact when one lifts and another lands in the same 8 ms frame (logged by libinput under Hyprland as kernel bug: Touch jump detected and discarded.).
  • Out-of-range state 7 does not clear msc->mtp_palm_ids before path-ID reuse.
Evidence
  • git format-patch -1 --stdout | perl scripts/checkpatch.pl --strict --no-tree -: 0 errors, 0 warnings, 0 checks, 11 lines checked
  • cpp + dtc on arch/arm64/boot/dts/apple/t6041-j616c.dts: clean compile; dtc -I dtb -O dts diff against cff875630 adds only apple,touch-states; inside &mtp_hid's multi-touch node.
  • Baseline J616c (7.3.0-1-2.3-ARCH / 7.3.0-1-3.1-ARCH): hyprland.log records repeated kernel bug: Touch jump detected and discarded. events while apple,touch-states is absent from /proc/device-tree.

On the MacBook Pro 16-inch M4 Max (J616c), the MTP trackpad runs the
AppleMTPFirmwareMac-6310.85.7 firmware family whose standard 38-byte
header contact records carry the contact touch state in the high byte
and the firmware path ID in the low byte of the first word (the same
format verified on J813 with firmware 6310.85.7 and J815 with 6300.85.6,
and already used by hid-magicmouse for T6041 palm contact IDs).

Without apple,touch-states on the multi-touch node, hid-magicmouse leaves
msc->mtp_states false:
- off-surface approaching/leaving contacts (states 1, 2, 5, 6) with
  non-zero touch_major are reported as active evdev touches;
- magicmouse_raw_event_mtp() falls back to input_mt_assign_slots() with
  dmax = 0 instead of input_mt_get_slot_by_key(), handing an active slot
  over to another contact whenever one lifts as another lands in the same
  8 ms frame, which libinput logs as "kernel bug: Touch jump detected and
  discarded.";
- out-of-range (state 7) records do not clear msc->mtp_palm_ids before
  path-ID reuse.

Add apple,touch-states to the J616c multi-touch node alongside its
firmware-name, matching t8142-j813.dts and t8142-j815.dts.

Signed-off-by: Allan Clempe <allan.clempe@gmail.com>

This branch has not been deployed

No deployments
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.

1 participant