Skip to content

Commit 348981c

Browse files
WhatAmISupposedToPutHeremarcan
authored andcommitted
arm64: dts: apple: t8103: Add PWM controller
Adds PWM controller and keyboard backlight bindings for M1 MacBooks Signed-off-by: Sasha Finkelstein <[email protected]> Acked-by: Sven Peter <[email protected]> Signed-off-by: Hector Martin <[email protected]>
1 parent 8d59efc commit 348981c

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

arch/arm64/boot/dts/apple/t8103-j293.dts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,23 @@
1111

1212
#include "t8103.dtsi"
1313
#include "t8103-jxxx.dtsi"
14+
#include <dt-bindings/leds/common.h>
1415

1516
/ {
1617
compatible = "apple,j293", "apple,t8103", "apple,arm-platform";
1718
model = "Apple MacBook Pro (13-inch, M1, 2020)";
19+
20+
led-controller {
21+
compatible = "pwm-leds";
22+
led-0 {
23+
pwms = <&fpwm1 0 40000>;
24+
label = "kbd_backlight";
25+
function = LED_FUNCTION_KBD_BACKLIGHT;
26+
color = <LED_COLOR_ID_WHITE>;
27+
max-brightness = <255>;
28+
default-state = "keep";
29+
};
30+
};
1831
};
1932

2033
&bluetooth0 {
@@ -32,3 +45,7 @@
3245
&i2c4 {
3346
status = "okay";
3447
};
48+
49+
&fpwm1 {
50+
status = "okay";
51+
};

arch/arm64/boot/dts/apple/t8103-j313.dts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,23 @@
1111

1212
#include "t8103.dtsi"
1313
#include "t8103-jxxx.dtsi"
14+
#include <dt-bindings/leds/common.h>
1415

1516
/ {
1617
compatible = "apple,j313", "apple,t8103", "apple,arm-platform";
1718
model = "Apple MacBook Air (M1, 2020)";
19+
20+
led-controller {
21+
compatible = "pwm-leds";
22+
led-0 {
23+
pwms = <&fpwm1 0 40000>;
24+
label = "kbd_backlight";
25+
function = LED_FUNCTION_KBD_BACKLIGHT;
26+
color = <LED_COLOR_ID_WHITE>;
27+
max-brightness = <255>;
28+
default-state = "keep";
29+
};
30+
};
1831
};
1932

2033
&bluetooth0 {
@@ -24,3 +37,7 @@
2437
&wifi0 {
2538
brcm,board-type = "apple,shikoku";
2639
};
40+
41+
&fpwm1 {
42+
status = "okay";
43+
};

arch/arm64/boot/dts/apple/t8103.dtsi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,15 @@
432432
status = "disabled"; /* only used in J293 */
433433
};
434434

435+
fpwm1: pwm@235044000 {
436+
compatible = "apple,t8103-fpwm", "apple,s5l-fpwm";
437+
reg = <0x2 0x35044000 0x0 0x4000>;
438+
power-domains = <&ps_fpwm1>;
439+
clocks = <&clkref>;
440+
#pwm-cells = <2>;
441+
status = "disabled";
442+
};
443+
435444
serial0: serial@235200000 {
436445
compatible = "apple,s5l-uart";
437446
reg = <0x2 0x35200000 0x0 0x1000>;

0 commit comments

Comments
 (0)