Skip to content

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
integration/aurorafrom
dtfill-power/hpm5-t8142
Draft

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dtfill-power/hpm5-t8142

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

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 of t8142-j813-usb.dtsi (J813, J815) and t8142-j704-usb.dtsi (J704), after nub_spmi_a0 is 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

Still to run

  • J813 (sithglan): plug in MagSafe, then a new /sys/class/typec/portN appears with a partner, and tps6598x-source-psy-1-08 shows online = 1. Unplug it and online goes to 0. Then echo s2idle > /sys/power/mem_sleep; rtcwake -m mem -s 20 three times with MagSafe plugged in: no tipd or 1-08 errors in dmesg, and online is still 1 after each wake.
  • J704 (no owner yet): the same rows.
  • J815: tested in arm64: dts: apple: t8142-j815: MagSafe 3 PD controller #1907. The DTB is unchanged.
Per-board values and DTB diffs

Values from each board's ADT (hpm5):

Board Bus SID port-type features-supported interrupts (ADT)
J704 nub-spmi-a0 8 0x11 3 63, 69, 71
J813 nub-spmi-a0 8 0x11 3 63, 69, 71
J815 nub-spmi-a0 8 0x11 3 63, 69, 71

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):

 		spmi@388908000 {
 			...
+			usb-pd@8 {
+				apple,no-liquid-detection;
+				compatible = "apple,sn201202x";
+				reg = <0x08 0x00>;
+			};
+
 			usb-pd@a {

Driver notes (no change in this PR):

  • Nothing in drivers/usb/typec/tipd/ gates hpm5 by board. apple,no-liquid-detection is read in spmi.c.
  • tipd_sleep_ssps_rules() in core.c lists J714s, J716c, J813 and J815, but not J704. It only matters with apple,sleep-ssps, which this node does not set. On the J813 only hpm0 and hpm1 have it, in t8142-j813-j815-sleep.dtsi.

Assisted-by: LLM (Claude:Opus 5.5)

m0d16l14n1 and others added 2 commits November 19, 2026 14:26
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>
@gig3m

gig3m commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

J813 (MacBook Air 13" M5), macOS 27.2 stub, with #2401 on #2135's merged head:

  • Port and supply: usb-pd@8 registers as typec port0 (device 1-08) with tps6598x-source-psy-1-08. The two USB-C controllers are 1-0a and 1-0c, ports 2 and 1.
  • Plugged into MagSafe: port0-partner appears and tps6598x-source-psy-1-08 reads online = 1, usb_type PD. macsmc-ac reads 1 and the battery Charging.
  • Unplugged: the partner goes away, online goes to 0 and the battery reads Discharging.
  • Sleep: two deep cycles with a 30 s alarm on this kernel were clean, on battery.
  • s2idle: not run.

🤖 Generated with Claude Code

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.

3 participants