diff --git a/Documentation/devicetree/bindings/arm/apple.yaml b/Documentation/devicetree/bindings/arm/apple.yaml index 87fe377edc9eb..718f06e767641 100644 --- a/Documentation/devicetree/bindings/arm/apple.yaml +++ b/Documentation/devicetree/bindings/arm/apple.yaml @@ -480,7 +480,10 @@ properties: - description: Apple M5 Pro SoC based platforms items: - - const: apple,j716s # MacBook Pro (16-inch, M5 Pro, 2026) + - enum: + - apple,j716s # MacBook Pro (16-inch, M5 Pro, 2026) + - apple,k114s # MacBook Pro (14-inch PROLED XDR, M5 Pro, 2026) + - apple,k116s # MacBook Pro (16-inch PROLED XDR, M5 Pro, 2026) - const: apple,t6050 - const: apple,arm-platform @@ -489,6 +492,8 @@ properties: - enum: - apple,j714c # MacBook Pro (14-inch, M5 Max, 2026) - apple,j716c # MacBook Pro (16-inch, M5 Max, 2026) + - apple,k114c # MacBook Pro (14-inch PROLED XDR, M5 Max, 2026) + - apple,k116c # MacBook Pro (16-inch PROLED XDR, M5 Max, 2026) - const: apple,t6050 - const: apple,arm-platform diff --git a/Documentation/devicetree/bindings/input/apple,dockchannel-hid.yaml b/Documentation/devicetree/bindings/input/apple,dockchannel-hid.yaml index 19e22d47a2db4..598ab3da81cd3 100644 --- a/Documentation/devicetree/bindings/input/apple,dockchannel-hid.yaml +++ b/Documentation/devicetree/bindings/input/apple,dockchannel-hid.yaml @@ -15,7 +15,7 @@ description: | as HID devices over a DockChannel FIFO pair. The coprocessor announces its interfaces by name when it boots. Each interface that the operating system should use has a child node of the same name; announced interfaces without - a node are ignored. + a node are ignored, and so are interfaces whose node is disabled. The multi-touch interface may need firmware that the host sends after the coprocessor has booted, followed by a power cycle of the trackpad. Two @@ -217,6 +217,20 @@ properties: The trackpad accelerometer, under the name that the T6041 coprocessor firmware announces. + kiwi: + type: object + additionalProperties: false + description: + The touchscreen of the MacBook Pros with a PROLED XDR display, an + interface of the same coprocessor as the trackpad. + + properties: + firmware-name: + maxItems: 1 + description: + Name of the touchscreen firmware that the host sends to the + coprocessor when the interface is first opened. + mtp: type: object additionalProperties: false diff --git a/arch/arm64/boot/dts/apple/Makefile b/arch/arm64/boot/dts/apple/Makefile index c3aeb4809899a..a8adc015407fb 100644 --- a/arch/arm64/boot/dts/apple/Makefile +++ b/arch/arm64/boot/dts/apple/Makefile @@ -105,6 +105,10 @@ dtb-$(CONFIG_ARCH_APPLE) += t6050-j714c.dtb dtb-$(CONFIG_ARCH_APPLE) += t6050-j716c.dtb dtb-$(CONFIG_ARCH_APPLE) += t6050-j716s.dtb dtb-$(CONFIG_ARCH_APPLE) += t6050-j775d.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-k114c.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-k114s.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-k116c.dtb +dtb-$(CONFIG_ARCH_APPLE) += t6050-k116s.dtb dtb-$(CONFIG_ARCH_APPLE) += t8112-j413.dtb dtb-$(CONFIG_ARCH_APPLE) += t8112-j415.dtb dtb-$(CONFIG_ARCH_APPLE) += t8112-j473.dtb diff --git a/arch/arm64/boot/dts/apple/t6050-die0.dtsi b/arch/arm64/boot/dts/apple/t6050-die0.dtsi index 3c136b3692f5d..5b140884a52a0 100644 --- a/arch/arm64/boot/dts/apple/t6050-die0.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-die0.dtsi @@ -695,6 +695,40 @@ power-domains = <&ps_i2c2>; }; + /* + * The three FPWM channels (ADT /arm-io/pwm0, pwm1, pwm2, "fpwm,s5l8920x") at + * 0x305040000, 0x305044000 and 0x305048000, clock gates FPWM0..FPWM2. The boards say + * what drives each one: on the MacBook Pros pwm0 is the keyboard backlight, and on the + * PROLED models pwm1 is the rear Apple logo. pwm1's power state is left off unless a + * board uses it, since J716c's ADT ties it to the indicator controller (eic). + */ + fpwm0: pwm@505040000 { + compatible = "apple,t6050-fpwm", "apple,s5l-fpwm"; + reg = <0x5 0x05040000 0x0 0x4000>; + clocks = <&clkref>; + power-domains = <&ps_fpwm0>; + #pwm-cells = <2>; + status = "disabled"; + }; + + fpwm1: pwm@505044000 { + compatible = "apple,t6050-fpwm", "apple,s5l-fpwm"; + reg = <0x5 0x05044000 0x0 0x4000>; + clocks = <&clkref>; + power-domains = <&ps_fpwm1>; + #pwm-cells = <2>; + status = "disabled"; + }; + + fpwm2: pwm@505048000 { + compatible = "apple,t6050-fpwm", "apple,s5l-fpwm"; + reg = <0x5 0x05048000 0x0 0x4000>; + clocks = <&clkref>; + power-domains = <&ps_fpwm2>; + #pwm-cells = <2>; + status = "disabled"; + }; + /* * The boot NOR (ADT /arm-io/qspi, "qspi,qspimc"): P at 0x305118000 and C at P + 0x800, * each 0x4000 in the ADT; one resource for their union. Interrupt 1373, clock id 440 @@ -872,6 +906,33 @@ }; &pmgr1 { + ps_fpwm0: power-controller@2a8 { + compatible = "apple,t6050-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x2a8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "fpwm0"; + }; + + ps_fpwm1: power-controller@2b0 { + compatible = "apple,t6050-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x2b0 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "fpwm1"; + /* On J716c the secure firmware's indicator controller names this state */ + status = "disabled"; + }; + + ps_fpwm2: power-controller@2b8 { + compatible = "apple,t6050-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; + reg = <0x2b8 4>; + #power-domain-cells = <0>; + #reset-cells = <0>; + label = "fpwm2"; + status = "disabled"; + }; + ps_i2c1: power-controller@2c8 { compatible = "apple,t6050-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; reg = <0x2c8 4>; diff --git a/arch/arm64/boot/dts/apple/t6050-j716s.dts b/arch/arm64/boot/dts/apple/t6050-j716s.dts index c4fb9bfa4aab6..1bafe4a2351f2 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716s.dts @@ -60,17 +60,13 @@ }; }; -/* Blocks t6050-die0.dtsi does not describe yet: the keyboard backlight PWM and the third HPM bus */ -&die0 { - /* ADT pwm0: 0x505040000, clock gate FPWM0 */ - fpwm0: pwm@505040000 { - compatible = "apple,t6050-fpwm", "apple,s5l-fpwm"; - reg = <0x5 0x05040000 0x0 0x4000>; - power-domains = <&ps_fpwm0>; - clocks = <&clkref>; - #pwm-cells = <2>; - }; +/* The keyboard backlight PWM (ADT pwm0) */ +&fpwm0 { + status = "okay"; +}; +/* A block t6050-die0.dtsi does not describe yet: the third HPM bus */ +&die0 { /* * ADT nub-spmi-a1, the right-hand port's HPM bus (hpm2). Polled like a0: * the generation 4 driver takes no interrupt. pmgr NUB_SPMI_A1 is @@ -84,17 +80,6 @@ }; }; -/* pmgr FPWM0, group 1 + 0x2a8; its SIO parent is left undescribed, as for ps_i2c1/2 */ -&pmgr1 { - ps_fpwm0: power-controller@2a8 { - compatible = "apple,t6050-pmgr-pwrstate", "apple,t8103-pmgr-pwrstate"; - reg = <0x2a8 4>; - #power-domain-cells = <0>; - #reset-cells = <0>; - label = "fpwm0"; - }; -}; - /* * PCIe port 0: the N1 (Wi-Fi and Bluetooth). Port 1 is the SD reader, not yet * described. The registers, interrupt, DART streams and PERST# pin are the diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi new file mode 100644 index 0000000000000..9758c90ed36d4 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -0,0 +1,238 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (14-inch and 16-inch PROLED XDR, M5 Pro and M5 Max, 2026) + * + * Shared by K114c, K114s, K116c and K116s. These are the J714/J716 MacBook Pros + * with a tandem OLED panel that takes touch input, and a rear Apple logo that is + * lit by its own light. Everything here comes from the boards' Apple device tree + * (ADT) as shipped with macOS 27.2. None of it has been tested on the hardware yet. + * + * Against J716c the ADT differs in: + * - the panel: no I2C backlight driver (i2c7 disp-bklt) and no dp855 TCON; an + * "ixora" TCON and a display NAND on spi4 instead. The OLED needs no separate + * backlight controller, so the panel only ever runs through the display + * coprocessor here, as the boot framebuffer for now. + * - the MTP transport: a "kiwi" interface (the touchscreen) next to the trackpad. + * - the FPWM channels: pwm1 (fpwm,s5l8920x at 0x305044000) drives the rear logo + * ("bklb-backlight", 25 kHz), and pwm2 (0x305048000, "mesa-backlight", 100 Hz) + * exists only on these boards. + * + * The M5 Pro boards (K114s, K116s) use the same die and, in the static ADT, the + * same CPU list as the M5 Max ones; the boot loader drops the cores a part does + * not have from this tree using the ADT the Mac boots with. + * + * Copyright The Asahi Linux Contributors + */ + +/dts-v1/; + +#include + +#include "t6050-max.dtsi" + +/ { + chassis-type = "laptop"; + + aliases { + serial0 = &dockchannel; + }; + + chosen { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + framebuffer0: framebuffer@0 { + compatible = "apple,simple-framebuffer", "simple-framebuffer"; + reg = <0 0 0 0>; /* To be filled by the loader */ + /* Format properties will be added by the loader */ + status = "disabled"; + }; + }; + + led-controller { + compatible = "pwm-leds"; + + /* ADT /arm-io/pwm0/kbd-backlight: default-hz 25000 */ + led-0 { + pwms = <&fpwm0 0 40000>; + label = "apple::kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + }; + + /* + * The rear Apple logo, ADT /arm-io/pwm1/bklb-backlight: default-hz 25000. + * Keep whatever state the boot loader left it in. The ADT's brightness + * mapping (nits-to-pwm-percentage, calibrated per device through syscfg + * CGBl) is policy for user space, and its use-enable-pulse is not + * handled yet. + */ + led-1 { + pwms = <&fpwm1 0 40000>; + label = "apple::logo"; + max-brightness = <255>; + default-state = "keep"; + }; + }; +}; + +/* ATC1, ATC3 and the PD controller buses nub-spmi-a0 and -a2: not yet described for these boards */ +&nub_spmi_a0 { + status = "disabled"; +}; + +&nub_spmi_a2 { + status = "disabled"; +}; + +&atc1_phy_mbox { + status = "disabled"; +}; + +&atc1_phy { + status = "disabled"; +}; + +&usb_drd1 { + status = "disabled"; +}; + +&usb_drd1_dart_0 { + status = "disabled"; +}; + +&usb_drd1_dart_1 { + status = "disabled"; +}; + +&atc3_phy_mbox { + status = "disabled"; +}; + +&atc3_phy { + status = "disabled"; +}; + +&usb_drd3 { + status = "disabled"; +}; + +&usb_drd3_dart_0 { + status = "disabled"; +}; + +&usb_drd3_dart_1 { + status = "disabled"; +}; + +&i2c1 { + status = "disabled"; +}; + +&i2c2 { + status = "disabled"; +}; + +/* + * As on J716c, where reading pin 112 takes an SError, only the pins a node + * here names are exposed, and none is yet. The N1 on PCIe port 0 needs its + * board's platform ID, which the static ADT does not carry, so the port and + * its PERST# pin stay unused for now. + */ +&pinctrl_ap { + gpio-reserved-ranges = <0 221>; +}; + +&pcie0 { + status = "disabled"; +}; + +/* These boards' SMC fan and power keys are not yet checked */ +&smc_hwmon { + status = "disabled"; +}; + +/* + * The console is on the USB debug link, which drains only while a host reads + * it; the machine also boots with nothing attached there. + */ +&dockchannel { + apple,tx-never-wait; + status = "okay"; +}; + +&fpwm0 { + status = "okay"; +}; + +&ps_fpwm1 { + status = "okay"; +}; + +&fpwm1 { + status = "okay"; +}; + +/* + * ADT /arm-io/pwm2/mesa-backlight (default-hz 100), next to the Touch ID sensor + * (spi2/mesa). What it lights and how macOS drives it is not known yet. + */ +&fpwm2 { + status = "disabled"; +}; + +/* + * The keyboard, trackpad and touchscreen: the HID transport on the MTP's + * DockChannel FIFO, laid out as on J716c (ADT dockchannel-mtp/mtp-transport). + */ +&mtp_dockchannel { + mtp_hid: input@8000 { + compatible = "apple,dockchannel-hid"; + reg = <0x8000 0x1000>, <0xc000 0x1000>, + <0x0 0x1000>, <0x4000 0x1000>; + reg-names = "config", "data", "rmt-config", "rmt-data"; + iommus = <&mtp_dart 0>; + interrupt-parent = <&mtp_dockchannel>; + interrupts = <2 IRQ_TYPE_LEVEL_HIGH>, + <3 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "tx", "rx"; + apple,fifo-size = <0x800>; + apple,helper-cpu = <&mtp>; + /* ADT multi-touch function-afe-reset: pKW8('pcIO', 0x10000, 0x11c0000) */ + apple,afe-reset-gpios = <&smc_pcio 2 GPIO_ACTIVE_HIGH>; + + mtp_multitouch: multi-touch { + apple,power-method = <2>; + }; + + keyboard { + }; + + stm { + }; + + /* + * The touchscreen (ADT mtp-transport/kiwi, image-tag "fsat"). macOS + * sends it firmware through the same CBOR bootloader as the trackpad. + * Its power, reset, 24 MHz clock and display-sync lines are SoC GPIOs + * (nub-gpio0 0x1a, 0x19, 0x16; gpio0 0xb), with an SMC power reference + * (pKW4('rCIO', 0x20000)) and the TSRC clock source. How that load and + * the report format map onto this transport is still being worked + * out, so the interface stays off until it has been tested. + */ + kiwi: kiwi { + status = "disabled"; + }; + }; +}; + +/* + * The board's pcIO outputs, from the ADT: dp2hdmi_pwr_en pKW8('pcIO', 0, 0x1a0000), + * hdmi_pwr_en pKW8('pcIO', 0x800000, 0xf0000), and the trackpad AFE reset (2), + * pKW8('pcIO', 0x10000, 0x11c0000); the same as on J716c. + */ +&smc_pcio { + apple,output-commands = /bits/ 64 <0x001a000000000000 0x000f000000800000 0x011c000000010000>; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k114c.dts b/arch/arm64/boot/dts/apple/t6050-k114c.dts new file mode 100644 index 0000000000000..1acbb53d1aa04 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-k114c.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (14-inch PROLED XDR, M5 Max, 2026) + * + * target-type: K114c (Mac17,11) + * + * Preliminary: described from the ADT only, not yet booted on the hardware. + * + * Copyright The Asahi Linux Contributors + */ + +#include "t6050-k114-k116.dtsi" + +/ { + compatible = "apple,k114c", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (14-inch PROLED XDR, M5 Max, 2026)"; +}; + +&mtp_multitouch { + firmware-name = "apple/tpmtfw-k114c.bin"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k114s.dts b/arch/arm64/boot/dts/apple/t6050-k114s.dts new file mode 100644 index 0000000000000..bb1c9b4998953 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-k114s.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (14-inch PROLED XDR, M5 Pro, 2026) + * + * target-type: K114s (Mac17,13) + * + * Preliminary: described from the ADT only, not yet booted on the hardware. + * + * Copyright The Asahi Linux Contributors + */ + +#include "t6050-k114-k116.dtsi" + +/ { + compatible = "apple,k114s", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (14-inch PROLED XDR, M5 Pro, 2026)"; +}; + +&mtp_multitouch { + firmware-name = "apple/tpmtfw-k114s.bin"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts new file mode 100644 index 0000000000000..6942c070e7030 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-k116c.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (16-inch PROLED XDR, M5 Max, 2026) + * + * target-type: K116c (Mac17,10) + * + * Preliminary: described from the ADT only, not yet booted on the hardware. + * + * Copyright The Asahi Linux Contributors + */ + +#include "t6050-k114-k116.dtsi" + +/ { + compatible = "apple,k116c", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (16-inch PROLED XDR, M5 Max, 2026)"; +}; + +&mtp_multitouch { + firmware-name = "apple/tpmtfw-k116c.bin"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-k116s.dts b/arch/arm64/boot/dts/apple/t6050-k116s.dts new file mode 100644 index 0000000000000..6461b33a1b830 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-k116s.dts @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * MacBook Pro (16-inch PROLED XDR, M5 Pro, 2026) + * + * target-type: K116s (Mac17,12) + * + * Preliminary: described from the ADT only, not yet booted on the hardware. + * + * Copyright The Asahi Linux Contributors + */ + +#include "t6050-k114-k116.dtsi" + +/ { + compatible = "apple,k116s", "apple,t6050", "apple,arm-platform"; + model = "Apple MacBook Pro (16-inch PROLED XDR, M5 Pro, 2026)"; +}; + +&mtp_multitouch { + firmware-name = "apple/tpmtfw-k116s.bin"; +}; diff --git a/drivers/hid/dockchannel-hid/dockchannel-hid.c b/drivers/hid/dockchannel-hid/dockchannel-hid.c index 737963b424964..a752c224959de 100644 --- a/drivers/hid/dockchannel-hid/dockchannel-hid.c +++ b/drivers/hid/dockchannel-hid/dockchannel-hid.c @@ -264,6 +264,11 @@ dchid_get_interface(struct dockchannel_hid *dchid, int index, const char *name) dev_dbg(dchid->dev, "No OF node for subdevice %s, ignoring\n", name); return NULL; } + if (!of_device_is_available(of_node)) { + dev_dbg(dchid->dev, "Subdevice %s is disabled, ignoring\n", name); + of_node_put(of_node); + return NULL; + } of_property_read_u32(of_node, "apple,power-method", &power_method); firmware_managed_reset =