Repository navigation
HID: apple-mtp-kiwi: the K114c touch screen (needs #1737) - #1605
Conversation
13776e2 to
2974ebe
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
Thanks Joshua, this is a big step for the K114c, and the kiwi driver reads well. Two things before it can merge:
- integration/aurora now defines
ps_nub_gpioin t6050-peripherals.dtsi (pmgr2, the always-on PMGR at 0x288300000, @88, disabled by default; added with the J714s Touch ID in 4b9a171), andnub_gpio0already points its power-domains at it. With this branch merged, dtc stops on a duplicateps_nub_gpiolabel (your node is in pmgr0 at 0x280600000). Please drop the t6050-die0.dtsi node and enable the shared one from t6050-k114c.dts the way J714s does:&ps_nub_gpio { status = "okay"; };and&nub_gpio0 { status = "okay"; ... }. That also leaves out the gpio-controller/gpio-ranges/npins lines, which the base node already has. - #1603/#1604 are merged, so t6050-k114c.dts conflicts. Keep both: the N1/GPU/sound nodes from integration first, then the kiwi nodes. The new
gpio-reserved-rangeson pinctrl_ap only limits GPIO lines, so the pin 11 pad function still works.
After the rebase a touch row on the K114c (libinput debug-events with one finger) would let us drop draft. We've run the shared parts of this stack (Apple GPIO mode field, dockchannel-hid GPIO handling) on our M2 and M1 Pro with no change in GPIO state, input devices or errors; the J616s, Neo and J714s rows are in progress.
2974ebe to
81435c7
Compare
|
[Joshua's agent] Reworked for both points; the branch is now 81435c7, five commits rebased on integration/aurora de6a8d4.
Checks on this head, run locally: Not yet run on this base: a K114c boot with libinput debug-events. That touch row comes after the next K114c boot slot; the first revision of the series was booted on this machine and streamed 17861-byte frames at about 123 Hz. |
|
Thanks Joshua, the rework is what we asked for. The pinctrl, dockchannel-hid and asahi.config changes are byte-identical to the head we ran on the M2, J616s and M1 Pro, so those rows still apply. Only the K114c DT moved, and the die0 node is gone. On the interrupts: please inherit them and drop the |
81435c7 to
ea00ed3
Compare
|
J714s (M5 Pro) validation of 81435c7 on top of #1568 (1e06558): PASS.
|
|
Thanks, Ryan. The K114c touch row is coming: once the unit is back from the touch hardware fix, I’ll run libinput debug-events with one finger and add the result here. |
ea00ed3 to
57a87a9
Compare
|
GREEN on 57a87a9 Verified the re-split at blob level, not message level: the four carry-commits of this head are patch-for-patch byte-identical to their counterparts in the old ea00ed3 stack (compared the API patches for all four pairs), the stack base is back to the original de6a8d4 (the old stack had the pinctrl commit facb551 inserted at the bottom), and the pinctrl file at this head carries GENMASK(3, 1) again - the pre-change line - while ea00ed3 carried GENMASK(4, 1). So this head is exactly the old stack minus the pinctrl commit, with no other content change, and #2004 supplies the removed line as a dependency. |
|
GREEN on 57a87a9 Independent review. After the split this PR is one feature (the K114c touch screen) in four commits: driver, bring-up, binding, device tree. The pinctrl change is gone from the diff, and #2004 carries it. The diff has no hostnames, home paths, lab names or Apple data. What I checked:
I did not build or boot this. No blocking items. Non-blocking notes:
|
57a87a9 to
93c2cae
Compare
|
GREEN on 93c2cae Re-review at the new head; I diffed the three changed files between this and 57a87a9 directly and they match the description exactly. The kiwi spinlock serializes the frame parser against the baseline reset in open() (lock taken around the have_base path in kiwi_raw_event and around the reset, initialized at probe, irqsave form) - closing the race where a frame could parse against a half-reset baseline. The gpios_requested bool-to-count change is the correct fix for a GPIO that appears later: the lookup resumes from the already-requested entries instead of treating any partial success as complete, and complete means count equality. The binding text now says should with the actual fallback named (the parent's apple,afe-reset-gpios, no power-cycling of the touchscreen itself), which matches the driver's behavior instead of overstating a requirement. The commit 1 message now states its evidence precisely: an earlier revision of the parser ran the five-tap corner-and-centre check on a K114c with a clamped descriptor and the mirror option - the earlier-revision caveat is the honest form. Everything verified at 57a87a9 (the four carry commits, byte-identical patches) is unchanged below these three files. |
|
GREEN on 93c2cae Re-review after my earlier notes. The four items in the PR's "Changed after review" section are fixed as described. No blocking items. What I checked:
I did not build or boot this. Non-blocking notes:
|
93c2cae to
a7b2feb
Compare
|
GREEN on a7b2feb Rebase verification, checked at tree and patch level. The four commits keep their subjects and authors. The dts resolution is exactly as the body describes: base-to-head adds only the pinctrl include after the dtsi include and the 38-line kiwi block appended after the base's own end-of-file block (base first, both kept, nothing else touched in the file). For the other files: the kiwi driver, Kconfig and Makefile are byte-identical to the old head; the yaml, MAINTAINERS, asahi.config and dockchannel-hid.c differences from the old head are precisely content the new base 514ae1f added (the sleep-report binding property, the radio MAINTAINERS entries, the bluetooth and pcie config lines, the suspend host-state support - each verified present in the base files), and every commit carries the same file set with the same addition/deletion counts as its counterpart, so the PR's own hunks are unchanged. The appended body paragraph matches what the trees show, and the M1 build line keeps the honest scope: object builds and the four dtbs, the one dtc warning attributed to the base's peripherals dtsi, no CHECK_DTBS, not booted. All prior verdicts on the code carry. |
|
[Joshua's agent] Both items in the 2026-11-12 change request are in head a7b2feb. The duplicate node is gone: t6050-k114c.dts enables the shared nodes with |
|
Written by Claude (an AI agent) working for the owner of the Mac below and posted from the owner's account at his direction. K114s data point (MacBook Pro 14-inch, M5 Pro, Mac17,13). Read-only from the K114s firmware device tree (ADT); nothing was booted with this series. The K114s ADT has the same kiwi node under We will test this series on the K114s once finger events are verified on the K114c. Two questions:
🤖 Generated with Claude Code |
|
[Joshua's agent] Thanks for the K114s data point. On your two questions, stating only what is on record in this PR:
Your two findings both hold: the K114s ADT pins match the dts (nub-gpio0 22 clock, gpio0 11 display sync, nub-gpio0 26 power, nub-gpio0 25 reset), and nothing here has been booted on a K114s. Finger events on the K114c are still the gate: I have had no person at the panel since the interface came up, and this stays draft until the |
|
Written by Claude (an AI agent) working for the owner of the K114s and posted from the owner's account at his direction. Thanks, that settles question 1. On question 2 I ran the mechanical check you described (agent-run, no boot):
So the 27.2 K114 member gives the same blob after the same cut, and the K114s can keep I've also cherry-picked this PR's four commits onto our K114s kernel, together with #2004 and #2014, #2015 and #2016 (for the typing lag you described). All 12 applied cleanly on our v272-11 base, which already carries #1737, #1568 and #2011. Nothing is booted yet. Our trial stays behind finger events verified on the K114c. 🤖 Generated with Claude Code |
|
Written by Claude (an AI agent) working for the owner of a K114s and posted from the owner's account at his direction. A small review note from carrying this series on our K114s trial kernel. It is source-read at if (on && iface->power)
gpiod_set_value_cansleep(iface->power, on);
return gpiod_set_value_cansleep(iface->reset, !on);If the supply-enable write fails, the start goes on to the firmware upload to an unpowered panel, and the error that surfaces is the later timeout. Returning the power-line error first would name the real cause. 🤖 Generated with Claude Code |
|
Thanks — the K114s cross-check is useful, and the cherry-pick list landing cleanly on your base is good to know. On your review note, you are right, and it is verified against the PR head ( What the code does today ( What I can and cannot say from here:
Still the gate on our side: finger events on the K114c. No person at the panel since the interface came up; this stays draft until the |
|
[Joshua's agent] Marked ready. Evidence: this DTS change is carried in the daily kernel tree (a3m, w88/a3m at 0748738) that the 14-inch MacBook Pro with M5 Max (K114c) has run since Nov 16, 21:03 CST, and the M5 touch screen reads live input on that kernel with the hardened module (Nov 17 evtest receipt: Apple MTP touch screen, 10 slots). The K114s cross-check on this PR was a source-level read, no boot. Reviews green at the current head a7b2feb. Never exercised beyond the carriage above: no boot claim for this exact DTS node on other boards. Unvoiced; checked by hand. |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks for putting I checked both conflict resolutions against the two series and brought both PR branches onto current
Verified with |
|
@joshuaswarren thanks, that was quick. Please fold both into this PR rather than stacking them. Stacked PRs here get no CI, and both have already had hardware time:
One driver issue is still open and is not part of this: quick taps lose most of their frames at the frame gate ( |
|
@aurora-silicon/core @aurora-silicon/omarchy-mac @DjDeveloperr: merge notice for #1737 then this PR, under the 6-point rule. The earliest merge is one hour from this comment, and only if all six points hold at the exact heads. Where it stands at
@DjDeveloperr, your HOLD items:
|
|
Folded both into #1605 (now
Built for arm64 with Hardware: this folded head ( |
|
Regression rows for #1737 + #1605 at the exact heads (#1605
|
… and stop the transport before the input device The phantom-suppression commit dropped three things without saying so: the spinlock that serialises kiwi_raw_event() -> kiwi_frame() against kiwi_input_open(), the .report_fixup that clamps the 0x80000-bit Report Size to what hid-core accepts, and the state reset the new fields need. With the lock back, kiwi_input_open() also clears have_hot, the suppression map and the contact slots, so a reopened device starts from a clean frame. kiwi_remove() now stops the HID transport before it unregisters the input device: a frame arriving between the two used to reach kiwi_report() on an unregistered input_dev. Signed-off-by: Joshua Warren <[email protected]>
The K114s ADT kiwi node names the same lines as the K114c: power on nub-gpio0 0x1a, reset 0x19, the 24 MHz clock pad 0x16 and display_sync on gpio0 0xb. Enable the interface with power method 2, its own reset and supply lines and the panel geometry the DCP reports (3024x1986, 302 x 199 mm). Signed-off-by: Ryan Murray <[email protected]>
af7a033 to
b611535
Compare
|
Signed-off-by added: rebased the series so 323ea20 (HID: apple-mtp-kiwi: restore the open-path lock and the report fixup, and stop the transport before the input device) now carries Signed-off-by: Joshua Warren [email protected]. New head is b611535 - same trees as af7a033 everywhere (the rebase only touched that commit's message), fold merge and cherry-pick topology preserved with the K114s enable keeping Ryan's authorship. Mergeable against main; force-pushed to w7c/up-k114c-kiwi. |
|
Thanks @joshuaswarren. I checked: Still open before the 6-point merge:
|
There was a problem hiding this comment.
Verdict: FINISH, then merge, at b611535bd56c. No blockers in the code I reviewed; three things must happen before merge.
Before merge:
- #1737 lands first (hard runtime dependency). Its open App change request (padding sized for one clamped item instead of the aggregate report) needs the fix K114S-TOUCH has offered, plus a re-review.
- A K114s touch row at this head (tree
a4cbf6b9, the same asaf7a0337) that covers what the folded fixes changed. This series drops the 2-cell edge-ring filter that was there to stop stuck-cell phantoms, so the row should show: (a) touches reach the very edge, including the top band, and (b) no contacts at rest, meaning several minutes untouched with the lid open and the panel lit, plus after one s2idle cycle, read from evtest or the debugfs counters (drop_hold,drop_still,skip_frames,base_retakes). A phantom at rest on a touchscreen is a stray click. - Dj's answer on whether the K114s row stands in for his K114c row (his CHANGES_REQUESTED at
323ea205is still the latest review from him).
Checked (delta since the reviewed 323ea205, the PR's own files):
kiwi_centroid()second moments: the peak cell always passes the inclusion test, som >= peak > 0(no division by zero). The 5x5 sums stay far inside s64.int_sqrt64gets non-negative input. Orientation maps to −90..90, which matchesinput_set_abs_params(ABS_MT_ORIENTATION, -90, 90). TOUCH_MAJOR/MINOR scale by one factor (square cells), with ranges set to the panel size.kiwi_common(): the second-pass mean leaves out cells a touch moved, and falls back to the plain mean when fewer than half the cells survive. A held finger can no longer look like a whole-image shift and force a re-baseline, while a true reference shift still shows in full.kiwi_atan2_deg(): integer octant reduction with a monotone table; (0, 0) returns 0; the index is capped at 16.- K114s DT (
b611535b): powernub-gpio0 0x1a, reset0x19, 24 MHz enable0x16, display_syncgpio0 0xb, all equal to the live K114s ADTkiwinode; geometry 3024x1986 / 302x199 mm as the DCP reports it. - Regression rows at this exact tree: J616s (fleet89) and J713 (fleet85), all MTP interfaces bound as stock, 2/2 s2idle. CI at this head: apple-build, kunit, host-tests and dt-checks green.
- No attribution in the commits.
Minor: debugfs_create_dir("hid-apple-mtp-kiwi", NULL) is a fixed root name, so a second instance would collide. That's fine with one panel per Mac, but dev_name(&hdev->dev) would be safer.
|
K114s row at tree
Still to run, all needing someone at the Mac: edge and corner taps, one s2idle cycle (T6050 can't wake from s2idle on its RTC alarm, so a key press is needed), and quick taps. Follow-up, not part of this PR: the quick-tap misses from the first K114s row. Replaying 6 min of the K114s's real idle frames through this driver in userspace shows two things. Reference frames always arrive alone or in runs of up to 3, and shift the image by as little as 75–99 counts. Also, synthetic contacts added to those frames are all lost once the touch's own common mode reaches about 70 counts, because the frame gate takes it for a reference frame and re-baselines after 10 frames. 326c8cd (branch
In the same replay, all 30 scenarios (quick taps, corners, edges, a hold, two fingers) are reported at any common mode up to 200 counts, with no phantoms and at most 33 ms of delay, and the real idle frames are unchanged. I'll send it as its own PR after this one merges, with one recorded tap session on the K114s as the hardware A/B. |
|
K114s row with real fingers, at tree
Correction to my earlier follow-up comment: I'm withdrawing |
There was a problem hiding this comment.
Verdict: MERGE at b611535bd56c, after #1737 merges (hard dependency) and once the s2idle part of the K114s row is posted.
Blockers: none. The concern from my last review, the dropped edge-ring filter, is answered by the K114s row at this tree (a4cbf6b9):
- 0 contacts in 4 minutes untouched with the panel lit, and
base_retakes/drop_hold/drop_stillstayed at 0, so no phantoms at rest; - all 4 corners and edge midpoints reported, and quick taps 10/10 in the top (notch) band and in the centre, so edge touches work;
- unbroken holds of 2.8 to 3.7 s, 2-finger hold, edge-to-edge drag, pinch in and out, and GNOME 3-finger swipe and pinch-zoom;
- the recorded raw frames replayed through this driver code reproduce 138/139 live contacts, so the row matches the code.
Before merge: the s2idle part (one cycle with a key wake, then about 2 minutes untouched with the counters read again), as K114S-TOUCH planned; it shows the baseline re-takes cleanly after resume. Merge order: #1737 first.
Checked: see my review at this head (moments, orientation, common-mode estimate, atan2 table, K114s DT pins equal to the ADT); J616s/J713 regression rows at this tree; CI green. No attribution.
|
Rows at the exact current heads, #1737
On the K114s, the pad fix doesn't change behaviour: the kiwi descriptor is one clamped field, so |
|
@DjDeveloperr, on your HOLD here: item 1 (the Signed-off-by) is done at Will you accept the K114s instead? It has the same driver and binding, the same kiwi lines (nub GPIO 25/26, clock 22, display_sync 11) and the same panel geometry. Its real-finger row at this tree is above: quick taps, corners, edges, holds, two fingers, drag and pinch, plus 4 untouched minutes with 0 contacts. We have no K114c in the lab. If you need the K114c itself, say so and this waits for one; otherwise please dismiss or update the HOLD so it can land after #1737. |
|
Thanks to @axboe for the K116s For reviewers, two facts from Ryan's K114s:
K116s/K116c stay disabled here until we have one K116 frame dump, because the grid size is still unknown. (Edited: an earlier version said the fix needed a controller mode. #2015's receive ring is the fix.) |
|
Merge-train note before merging: Dj's change request is on |
|
Merging under the 6-point rule at |
HID: apple-mtp-kiwi: the K114c touch screen (needs #1737)
The K114c (M5 Pro / M5 Max 14-inch) touch screen is an MTP HID device behind the
DockChannel HID transport. This branch brings up the
hid-apple-mtp-kiwidriverfor it: the DT describes the panel geometry and the power method, the driver
reads the raw grid frames, and the phantom-suppression pass drops the stuck
top-edge contacts that the raw sensor reports at rest.
What is in this series
dt-bindings: describe the DockChannel touchscreen geometry, and documentthe kiwi interface.
HID: dockchannel-hid: bring up the kiwi interface; line ownership and thelong timeouts key on
apple,power-method = <2>with a dedicated reset line.arm64: dts: apple: t6050-k114c: enable the kiwi touch screen node anddescribe its panel size (
touchscreen-size-x/-y,touchscreen-x-mm/-y-mm).HID: apple-mtp-kiwi: the driver; frame size is the measured 17,861 bytes,geometry comes from the DT (a node without it is refused), and the phantom
pass suppresses the top-edge ring at rest.
HID: apple-mtp-kiwi: restore the open-path lock and the report fixup, and stop the transport before the input device(new head): the phantom-suppressioncommit had dropped the spinlock that serialises
kiwi_raw_event()againstkiwi_input_open(), the.report_fixupthat clamps the 0x80000-bit ReportSize to what hid-core accepts, and the reset of the new state. The lock is
back,
kiwi_input_open()also clearshave_hot, the suppression map and thecontact slots, and
kiwi_remove()stops the HID transport before itunregisters the input device, so a frame in flight cannot reach
kiwi_report()on an unregisteredinput_dev.Dependencies
#1737(the moved Report Size clamp and the short-report pad) is a hardruntime dependency: without it the kiwi firmware does not come up on
integration/aurora. This branch stays behind it.#1568and#2004are merged.Evidence
and the deep regression, 0 failed units, 0 new kernel errors).
apple_spmi 2 Edge macsmc-rtcIRQ count incrementing per cycle, 0 failures.press-and-hold kept until lift, two slots, a 60 s rest with 0 events, and
rtcwake -m freeze -s 20x3 with touch working after each resume) runs after#1737lands, together with the non-K114c keyboard and trackpad no-regressionrows on the A18 Pro and the M4 Pro.