Skip to content

Commit 50aa09a

Browse files
WhatAmISupposedToPutHeremarcan
authored andcommitted
arm64: dts: apple: t8112: Add PWM controller
This patch adds the device tree entries for the PWM controller present on M2 macbooks that is connected to the keyboard backlight. Signed-off-by: Sasha Finkelstein <[email protected]> Signed-off-by: Hector Martin <[email protected]>
1 parent b15999c commit 50aa09a

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

arch/arm64/boot/dts/apple/t8112-j413.dts

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

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

1516
/ {
1617
compatible = "apple,j413", "apple,t8112", "apple,arm-platform";
@@ -20,6 +21,18 @@
2021
bluetooth0 = &bluetooth0;
2122
wifi0 = &wifi0;
2223
};
24+
25+
led-controller {
26+
compatible = "pwm-leds";
27+
led-0 {
28+
pwms = <&fpwm1 0 40000>;
29+
label = "kbd_backlight";
30+
function = LED_FUNCTION_KBD_BACKLIGHT;
31+
color = <LED_COLOR_ID_WHITE>;
32+
max-brightness = <255>;
33+
default-state = "keep";
34+
};
35+
};
2336
};
2437

2538
/*
@@ -61,3 +74,7 @@
6174
&i2c4 {
6275
status = "okay";
6376
};
77+
78+
&fpwm1 {
79+
status = "okay";
80+
};

arch/arm64/boot/dts/apple/t8112-j493.dts

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

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

1516
/ {
1617
compatible = "apple,j493", "apple,t8112", "apple,arm-platform";
@@ -20,6 +21,18 @@
2021
bluetooth0 = &bluetooth0;
2122
wifi0 = &wifi0;
2223
};
24+
25+
led-controller {
26+
compatible = "pwm-leds";
27+
led-0 {
28+
pwms = <&fpwm1 0 40000>;
29+
label = "kbd_backlight";
30+
function = LED_FUNCTION_KBD_BACKLIGHT;
31+
color = <LED_COLOR_ID_WHITE>;
32+
max-brightness = <255>;
33+
default-state = "keep";
34+
};
35+
};
2336
};
2437

2538
/*
@@ -50,3 +63,7 @@
5063
&i2c4 {
5164
status = "okay";
5265
};
66+
67+
&fpwm1 {
68+
status = "okay";
69+
};

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,15 @@
458458
status = "disabled";
459459
};
460460

461+
fpwm1: pwm@235044000 {
462+
compatible = "apple,t8112-fpwm", "apple,s5l-fpwm";
463+
reg = <0x2 0x35044000 0x0 0x4000>;
464+
power-domains = <&ps_fpwm1>;
465+
clocks = <&clkref>;
466+
#pwm-cells = <2>;
467+
status = "disabled";
468+
};
469+
461470
serial0: serial@235200000 {
462471
compatible = "apple,s5l-uart";
463472
reg = <0x2 0x35200000 0x0 0x1000>;

0 commit comments

Comments
 (0)