Repository navigation
Conversation
The J813 (MacBook Air 13" M5) trackpad sends the standard MTP report and classes its contacts like the T6041 and J616s ones: low byte of a record's second word, 2 and 3 for fingers, 6 and above for palms. Most J813 palms stay below the classed tool area of 1400 that the T6041 rule needs: recorded in normal use and while typing, 221 of 370 palm-classed contacts never passed it, and fingers reached 1560, so lowering it would not separate them. The class flickers to a palm for single reports on fingers (4 of 868), so on the J813 a contact also counts as a palm once two consecutive reports class it as one. That caught all 370 palms by their second report, and one finger, classed a palm for its last reports while lifting. As on the J616s, the J813 trackpad now also advertises ABS_MT_TOOL_TYPE and the full 16-bit range of its touch and width areas. Other machines are unchanged. Signed-off-by: Kyle Arrington <kyle@arrington.co>
Contributor
|
J815 (MacBook Air 15", M5) follow-up for this PR: the J815's trackpad sends the same standard MTP report with the same contact classes, so the same rule works there. The patch below adds The J815 has a larger pad (ADT hid-merge-personality C1FD3,3 vs the J813's C1FD1,4; firmware tpmtfw-j815.bin), so I recorded contacts on a J815 before sending it. I used a local, test-only per-contact log at lift; it isn't part of the patch.
0001-HID-magicmouse-report-the-J815-trackpad-s-palms-too.patchFrom 53dafde6d10beacddcaa73fb4244071a0f84a6b7 Mon Sep 17 00:00:00 2001
From: Nick <nekreshen@yandex.ru>
Date: Tue, 17 Nov 2026 15:06:47 +0700
Subject: [PATCH] HID: magicmouse: report the J815 trackpad's palms too
The J815 (MacBook Air 15" M5) has the J813's T8142 and MTP transport, and
its trackpad sends the standard MTP report the previous commit reads on
the J813, with the same contact classes. Take the J813's rule there as
well: the controller's palm classes are trusted, and two consecutive palm
classes mark a palm whatever its tool area.
The pads differ: the J813 ADT's multi-touch hid-merge-personality is
C1FD1,4, the J815's C1FD3,3 (a larger pad, firmware tpmtfw-j815.bin), so
the rule was checked on a J815 recording (one contact line per lift):
30 s typing with both palms resting on the pad: 77 contacts the
controller classed as palms, all 77 marked (36 by their second report);
15 short contacts with fewer palm classes, 11 of them marked, all with
large tool areas (up to 5245) at the palms' edges.
30 s pointing, tapping and two-finger scrolling: 54 finger contacts,
none marked and none with a palm class; the largest finger tool area
was 1028, below the 1400 the area rule needs. (6 more contacts lifted
in the first second: palms still resting from the typing phase, all
classed as palms.)
Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
---
drivers/hid/hid-magicmouse.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index ea71bccd3896..b2ea417707bb 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -276,7 +276,7 @@ struct effect_job {
* @mtp_palm_size: Whether a tool area alone marks an MTP contact as a palm.
* @mtp_palm_ids: MTP contact IDs reported as palms until they lift.
* @mtp_palm_debounce: Whether two consecutive palm classes mark an MTP contact
- * as a palm whatever its tool area (J813).
+ * as a palm whatever its tool area (J813, J815).
* @mtp_palm_classed: MTP contact IDs the controller classed as palms in the
* previous report.
* @ntouches: Number of touches in most recent touch report.
@@ -2685,10 +2685,12 @@ static int magicmouse_probe(struct hid_device *hdev,
of_machine_is_compatible("apple,t6041");
/*
* The J813 controller classes contacts the same way, and two
- * consecutive palm classes mark its palms.
+ * consecutive palm classes mark its palms. The J815 (15-inch)
+ * sends the same standard report from its own, larger pad.
*/
msc->mtp_palm_debounce = !msc->mtp_c1fe &&
- of_machine_is_compatible("apple,j813");
+ (of_machine_is_compatible("apple,j813") ||
+ of_machine_is_compatible("apple,j815"));
/*
* The J616s controller classes contacts the same way, but its
* fingers reach a tool area of 2475, so only the class marks its
--
2.56.1
|
The J815 (MacBook Air 15" M5) has the J813's T8142 and MTP transport, and its trackpad sends the standard MTP report the previous commit reads on the J813, with the same contact classes. Take the J813's rule there as well: the controller's palm classes are trusted, and two consecutive palm classes mark a palm whatever its tool area. The pads differ: the J813 ADT's multi-touch hid-merge-personality is C1FD1,4, the J815's C1FD3,3 (a larger pad, firmware tpmtfw-j815.bin), so the rule was checked on a J815 recording (one contact line per lift): 30 s typing with both palms resting on the pad: 77 contacts the controller classed as palms, all 77 marked (36 by their second report); 15 short contacts with fewer palm classes, 11 of them marked, all with large tool areas (up to 5245) at the palms' edges. 30 s pointing, tapping and two-finger scrolling: 54 finger contacts, none marked and none with a palm class; the largest finger tool area was 1028, below the 1400 the area rule needs. (6 more contacts lifted in the first second: palms still resting from the typing phase, all classed as palms.) Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <nekreshen@yandex.ru> Signed-off-by: Kyle Arrington <kyle@arrington.co>
gig3m
force-pushed
the
j813/palm-debounce
branch
from
November 17, 2026 18:02
1202088 to
c3ef84c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The J813 (MacBook Air 13" M5) trackpad sends the standard MTP report and classes its contacts like the T6041 (#636) and J616s (#1510) ones: low byte of a record's second word, 2 and 3 for fingers, 6 and above for palms (7 most often, with 6, 10 and 12 mixed in while a hand lands).
The T6041 class rule needs a tool area above 1400, and most J813 palms never get there. Recorded from HID debugfs on a J813 during normal use and a minute of typing practice, 1,238 contacts:
Lowering the area doesn't separate them, since fingers reach 1560. The class flickers to a palm for single reports on fingers, so on the J813 a contact also counts as a palm once two consecutive reports class it as one. The one finger that rule catches had been class 3 for 11 reports and went 7/10 for its last 8 while lifting off. Three to five consecutive reports catch it as well, and miss more palms.
The new state is a second bitmap of the contact IDs classed as palms in the previous report. It is only consulted where the root is
apple,j813. As on the J616s, the J813 trackpad now also advertisesABS_MT_TOOL_TYPEand the full 16-bit range of its touch and width areas. T6041 and J616s behave as before.Userspace: libinput's Apple MTP entry treats a touch size above 1600 as a palm, and J813 palms rarely get there. As with the J700 and T6041, it should be paired with:
Testing:
j815/test-nextbase).ABS_MT_TOOL_TYPEevents showMT_TOOL_PALMon palm contacts.integration/aurora(67dd90873461); checkpatch clean.🤖 Generated with Claude Code