diff --git a/arch/arm64/boot/dts/apple/t6050-j714s.dts b/arch/arm64/boot/dts/apple/t6050-j714s.dts index 383ec08bedbe2..9a3f85e07744f 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714s.dts @@ -213,30 +213,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 = ; - max-brightness = <255>; - default-state = "keep"; - }; - }; }; -&fpwm0 { - status = "okay"; -}; +#include "t6050-kbd-backlight.dtsi" /* * The keyboard and trackpad: the HID transport on the MTP's DockChannel FIFO diff --git a/arch/arm64/boot/dts/apple/t6050-j716c.dts b/arch/arm64/boot/dts/apple/t6050-j716c.dts index 8fdea5242027b..01d4d88f9aa85 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716c.dts @@ -52,6 +52,8 @@ }; }; +#include "t6050-kbd-backlight.dtsi" + /* * PCIe port 0: the N1 (Wi-Fi and Bluetooth), the only GP port this board uses besides the SD * reader on port 1 (not yet described). The boot loader trains the link after the SMC releases diff --git a/arch/arm64/boot/dts/apple/t6050-j716s.dts b/arch/arm64/boot/dts/apple/t6050-j716s.dts index 43747a4ce6be7..81d76dd322774 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j716s.dts @@ -44,26 +44,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 = ; - 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 { diff --git a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi index f7cedd1a4c854..4ef2601e7eb1c 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi @@ -49,17 +49,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 = ; - max-brightness = <255>; + /delete-property/ default-state; }; /* @@ -170,10 +169,6 @@ status = "okay"; }; -&fpwm0 { - status = "okay"; -}; - &ps_fpwm1 { status = "okay"; }; diff --git a/arch/arm64/boot/dts/apple/t6050-kbd-backlight.dtsi b/arch/arm64/boot/dts/apple/t6050-kbd-backlight.dtsi new file mode 100644 index 0000000000000..8e1dba5c6fea2 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-kbd-backlight.dtsi @@ -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 + +/ { + led-controller { + compatible = "pwm-leds"; + + led-0 { + pwms = <&fpwm0 0 40000>; + label = "kbd_backlight"; + function = LED_FUNCTION_KBD_BACKLIGHT; + color = ; + max-brightness = <255>; + default-state = "keep"; + }; + }; +}; + +&fpwm0 { + status = "okay"; +};