Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <LED_COLOR_ID_WHITE>;
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
Expand Down
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 1 addition & 18 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <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
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 @@ -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 = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
/delete-property/ default-state;
};

/*
Expand Down Expand Up @@ -170,10 +169,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";
};
Loading