Skip to content
Merged
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@

#include "t6050-max-atc2.dtsi"

#include "t6050-magsafe.dtsi"

/* The I2C power states have no described parent (SIO), as for i2c1 and i2c2 */
&ps_i2c3 {
/delete-property/ power-domains;
Expand Down
32 changes: 3 additions & 29 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -212,30 +212,14 @@
status = "okay";
};

/* The keyboard backlight: ADT pwm0/kbd-backlight, channel 0 at 25 kHz */
/ {
aliases {
/* The loader fills the keyboard layout from the ADT's keyboard node */
keyboard = &keyboard;
};

led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

&fpwm0 {
status = "okay";
};
#include "t6050-kbd-backlight.dtsi"

/* The MTP and its DockChannel FIFO, which carry the keyboard and trackpad */
&mtp_mbox {
Expand Down Expand Up @@ -374,20 +358,10 @@
};
};
};

/*
* The MagSafe 3 port's PD controller (ADT hpm5, 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 J616s. Its ADT features-supported is <3>, "Power In" only: no liquid
* detection (LDCM, feature 2 of the USB-C ports' <1 2 3>).
*/
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};

#include "t6050-magsafe.dtsi"

&usb_drd1 {
port {
usb_drd1_hs: endpoint {
Expand Down
14 changes: 6 additions & 8 deletions arch/arm64/boot/dts/apple/t6050-j716c-sleep.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,12 @@
};
};

/* MagSafe's controller is separate from all three USB-C data ports. */
&nub_spmi_a0 {
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
status = "disabled";
};
/*
* MagSafe's PD controller (t6050-magsafe.dtsi) is separate from all three USB-C data ports.
* It stays off until t6050-j716c-sleep-devices.dtsi enables it with the sleep.
*/
&hpm5 {
status = "disabled";
};

/* Split the two ASC mailboxes from their coprocessor banks for later use. */
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
};
};

#include "t6050-kbd-backlight.dtsi"

/*
* The shared T6050 inventory sits in die 0's soc node on this board (the unit-less /soc
* is not created here), so die 0's bus also needs the die's second MMIO window, which
Expand Down Expand Up @@ -320,6 +322,7 @@

#include "t6050-j716c-display.dtsi"
#include "t6050-j716c-left-usb4.dtsi"
#include "t6050-magsafe.dtsi"

#include "t6050-j716c-sleep.dtsi"
#include "t6050-j716c-sleep-full.dtsi"
Expand Down
23 changes: 4 additions & 19 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -48,26 +48,9 @@
status = "disabled";
};
};

/* Keyboard backlight: ADT pwm0/kbd-backlight, channel 0 at 25 kHz */
led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

/* The keyboard backlight PWM (ADT pwm0) */
&fpwm0 {
status = "okay";
};
#include "t6050-kbd-backlight.dtsi"

/* A block t6050-die0.dtsi does not describe yet: the third HPM bus */
&die0 {
Expand Down Expand Up @@ -282,7 +265,7 @@
* ATC0 usb-drd0 left-back hpm0 nub-spmi-a0 0x0c (the debug port; t6050-atc0-enable.dtsi, end of file)
* ATC1 usb-drd1 left-front hpm1 nub-spmi-a0 0x0a
* ATC2 usb-drd2 right hpm2 nub-spmi-a1 0x0c
* MagSafe hpm5 nub-spmi-a0 0x08 (not a USB-C connector)
* MagSafe hpm5 nub-spmi-a0 0x08 (t6050-magsafe.dtsi, no connector node)
* There is no usb-drd3 and no nub-spmi-a2, so ATC3's USB chain and that bus
* stay off.
*/
Expand Down Expand Up @@ -348,6 +331,8 @@
};
};

#include "t6050-magsafe.dtsi"

&usb_drd1 {
port {
usb_drd1_hs: endpoint {
Expand Down
38 changes: 38 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j775-hwmon.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* SMC hwmon keys of the T6050 Mac Studio: the DC input power and the two fans.
* The J775d includes this file; the J775c's board tree carries the same keys
* itself.
*
* Copyright The Asahi Linux Contributors
*/

/*
* The Studio's DC input. PSTR and PDTR read 0 on the Studio; PD0R is its DC input (36.5 W at an
* idle desktop).
*/
&smc_hwmon {
power-PD0R {
apple,key-id = "PD0R";
label = "DC Input Power";
};
};

#include "hwmon-fan-dual.dtsi"

/*
* The Studio's SMC has F0Ac/F0Mn/F0Mx/F0Tg and F1*, but its mode keys are F0md/F1md (ui8, flags 0xd0:
* readable, writable, a function key), not the F0Md/F1Md the dtsi names. With the dtsi's names
* each fan loses its mode key, and with it kernel control. With the real keys the fans can be set by the kernel's
* thermal policy (the M5 GPU governor, through macsmc_hwmon_fans_request()). No
* apple,fan-manual-control: userspace still only reads them.
*/
&smc_hwmon {
fan-F0Ac {
apple,fan-mode = "F0md";
};

fan-F1Ac {
apple,fan-mode = "F1md";
};
};
30 changes: 1 addition & 29 deletions arch/arm64/boot/dts/apple/t6050-j775d.dts
Original file line number Diff line number Diff line change
Expand Up @@ -228,35 +228,7 @@
status = "okay";
};

/*
* The Studio's DC input. PSTR and PDTR read 0 on the Studio; PD0R is its DC input (36.5 W at an
* idle desktop).
*/
&smc_hwmon {
power-PD0R {
apple,key-id = "PD0R";
label = "DC Input Power";
};
};

#include "hwmon-fan-dual.dtsi"

/*
* The Studio's SMC has F0Ac/F0Mn/F0Mx/F0Tg and F1*, but its mode keys are F0md/F1md (ui8, flags 0xd0:
* readable, writable, a function key), not the F0Md/F1Md the dtsi names; with the dtsi's names fan
* creation failed on the missing key. With the real keys the fans can be set by the kernel's
* thermal policy (the M5 GPU governor, through macsmc_hwmon_fans_request()). No
* apple,fan-manual-control: userspace still only reads them.
*/
&smc_hwmon {
fan-F0Ac {
apple,fan-mode = "F0md";
};

fan-F1Ac {
apple,fan-mode = "F1md";
};
};
#include "t6050-j775-hwmon.dtsi"

/*
* The boot NOR's NVRAM: the loader fills the partition from ADT /arm-io/qspi/spinor/anvram reg
Expand Down
28 changes: 27 additions & 1 deletion arch/arm64/boot/dts/apple/t6050-j873s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* yet. Beyond the SoC this file adds the board's hardware inventory
* (t6050-peripherals.dtsi, all of it disabled), the onboard Ethernet and
* the N1 (Wi-Fi and Bluetooth) on PCIe, and rear USB-C ports 1-3, from
* the board's ADT.
* the board's ADT. The SMC hwmon keys (one fan) follow the other Mac
* minis.
*
* Copyright The Asahi Linux Contributors
*/
Expand Down Expand Up @@ -137,6 +138,31 @@
* an HPM never gets.
*/

/*
* SMC sensors, as on the other Mac minis: the shared power, voltage and current
* keys and the single fan, plus every readable float T* key through
* apple,discover-temperatures in t6050-die0.dtsi. A key this SMC lacks only
* drops its channel.
*
* Discovery refuses to run once any temperature channel exists, so the shared
* temperature nodes go (their keys are discovered anyway), as on J714s/J716s.
*/
#include "hwmon-common.dtsi"
#include "hwmon-mini.dtsi"

&smc_hwmon {
/delete-node/ temperature-TH0x;
/delete-node/ temperature-TW0P;

/*
* The T6050 SMC spells the fan mode key F0md, as on J714s, J716s, K116s
* and J775d. No apple,fan-manual-control: the SMC drives the fan.
*/
fan-F0Ac {
apple,fan-mode = "F0md";
};
};

#define T6050_J873S
/* ADT /arm-io/acio0 and acio1: rear ports 1 and 2's USB4/Thunderbolt routers (end of file) */
#define T6050_ATC0_USB4_ROUTER
Expand Down
17 changes: 6 additions & 11 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,16 @@
status = "disabled";
};
};
};

led-controller {
compatible = "pwm-leds";
#include "t6050-kbd-backlight.dtsi"

/* ADT /arm-io/pwm0/kbd-backlight: default-hz 25000 */
/ {
led-controller {
/* Here the keyboard light keeps its "apple::" name and no boot state */
led-0 {
pwms = <&fpwm0 0 40000>;
label = "apple::kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
/delete-property/ default-state;
};

/*
Expand Down Expand Up @@ -354,10 +353,6 @@
status = "okay";
};

&fpwm0 {
status = "okay";
};

&ps_fpwm1 {
status = "okay";
};
Expand Down
28 changes: 28 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-kbd-backlight.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The keyboard backlight of the T6050 MacBook Pros. Each board's ADT has it
* as pwm0/kbd-backlight: channel 0 of fpwm0 at 25 kHz, a 40000 ns period.
*
* Copyright The Asahi Linux Contributors
*/

#include <dt-bindings/leds/common.h>

/ {
led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

&fpwm0 {
status = "okay";
};
19 changes: 19 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-magsafe.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The M5 Pro/Max MacBook Pros' MagSafe 3 port: its PD controller, an SN201202x at SPMI address
* 0x8 on nub-spmi-a0 (ADT hpm5, port-type 0x11). Every 14" and 16" board's ADT has the same
* node. 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 J616s. Its ADT features-supported is <3>, "Power In" only:
* no liquid detection (LDCM, feature 2 of the USB-C ports' <1 2 3>).
*
* The bus status is the board's. The boards that described the node before include this
* after their left-front port's PD controller (hpm1), where the node was.
*/

&nub_spmi_a0 {
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};
Loading