Repository navigation
arm64: dts: apple: t8142: Share the MagSafe 3 PD controller with J704 and J813 (on #1907) - #2401
Draft
RyanTheTide wants to merge 2 commits into
Draft
RyanTheTide wants to merge 2 commits into
RyanTheTide wants to merge 2 commits into
Conversation
hpm5 on nub-spmi-a0 (SID 8) is the MagSafe 3 port's PD controller (ADT
port-type 0x11). It has no USB data path, so it gets no connector node;
tipd registers a Type-C port and a power supply for it, as on J714s. The
bus is polled on T8142, so like hpm0 and hpm1 it has no interrupts. Its
ADT features-supported is <3> ("Power In" only), so it is marked
apple,no-liquid-detection.
Assisted-by: Claude Opus 5.5
Signed-off-by: Nick <nekreshen@yandex.ru>
… and J813 The J704 (MacBook Pro 14-inch, M5) and J813 (MacBook Air 13-inch, M5) have the same MagSafe 3 PD controller as the J815: each board's ADT has hpm5 on nub-spmi-a0, SID 8, port-type 0x11, features-supported <3>, with the same values on all three boards. Move the J815's hpm5 node into a new t8142-magsafe.dtsi and include it at the end of t8142-j813-usb.dtsi (J813, J815) and t8142-j704-usb.dtsi (J704), after nub_spmi_a0 is defined. The node itself is unchanged. The J815 DTB is byte-identical to the one before this change. The J704 and J813 DTBs gain only the usb-pd@8 node under nub-spmi-a0. The node was written by Nick for the J815. Suggested-by: Nick <nekreshen@yandex.ru> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Contributor
|
J813 (MacBook Air 13" M5), macOS 27.2 stub, with #2401 on #2135's merged head:
🤖 Generated with Claude Code |
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.
Problem
The J813 (MacBook Air 13-inch, M5) and J704 (MacBook Pro 14-inch, M5) have no node for the MagSafe 3 PD controller, so tipd registers no Type-C port and no power supply for MagSafe on them. #1907 adds this node for the J815 only.
Change
This branch is based on #1907 and keeps its commit as is. On top of it, one commit moves the J815's hpm5 node, unchanged, into a new
t8142-magsafe.dtsi. That file is included at the end oft8142-j813-usb.dtsi(J813, J815) andt8142-j704-usb.dtsi(J704), afternub_spmi_a0is defined.Each board's ADT has hpm5 with the same values: nub-spmi-a0, SID 8, port-type 0x11, features-supported <3> (power in only), and the same interrupt numbers as on the J815. The bus is polled on T8142, so there are no interrupts in the node, as for hpm0 and hpm1. The public J813 ADT shows the same values.
The node was written by Nick (m0d16l14n1) in #1907. This should merge after #1907, or #1907 can be closed in favour of this one.
Testing
usb-pd@8underspmi@388908000. dtc warnings are the same as before.t8142-j813-usb.dtsiort8142-j704-usb.dtsi. The only edit tot8142-j815.dtsis removing the block that arm64: dts: apple: t8142-j815: MagSafe 3 PD controller #1907 added at the end of the file.Still to run
/sys/class/typec/portNappears with a partner, andtps6598x-source-psy-1-08showsonline= 1. Unplug it andonlinegoes to 0. Thenecho s2idle > /sys/power/mem_sleep; rtcwake -m mem -s 20three times with MagSafe plugged in: no tipd or1-08errors indmesg, andonlineis still 1 after each wake.Per-board values and DTB diffs
Values from each board's ADT (hpm5):
The J704 also has hpm3 on nub-spmi-a1 (a USB-C port, already described). It does not affect hpm5.
The decompiled DTB diff is the same on J704 and J813 (J815: none compared with #1907):
Driver notes (no change in this PR):
drivers/usb/typec/tipd/gates hpm5 by board.apple,no-liquid-detectionis read inspmi.c.tipd_sleep_ssps_rules()incore.clists J714s, J716c, J813 and J815, but not J704. It only matters withapple,sleep-ssps, which this node does not set. On the J813 only hpm0 and hpm1 have it, int8142-j813-j815-sleep.dtsi.Assisted-by: LLM (Claude:Opus 5.5)