From 5c96f495004a68266c119cf125edfcb384530a6b Mon Sep 17 00:00:00 2001 From: Crazypedia Date: Fri, 28 Aug 2026 13:18:06 -0400 Subject: [PATCH] feat(lilygo-tdeck-max): wire up the EPD frontlight Devicetree only, on top of the optional-frontlight support from #633. The panel is reflective, so this lights it from the front, but it is still a BACKLIGHT_TYPE device and shows up as the usual Display brightness slider. BL_PWM is GPIO41. It has to use LEDC timer/channel 1 because timer/channel 0 is already taken by the keyboard backlight on this board. The backlight node is left disabled so Boot starts it and applies the stored brightness, which is the same handling every other board's backlight gets. Co-Authored-By: Claude Opus 5 --- Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts b/Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts index 64bd0d874..3feb4862c 100644 --- a/Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts +++ b/Devices/lilygo-tdeck-max/lilygo,tdeck-max.dts @@ -154,6 +154,7 @@ // Default to a fast (~1s) refresh for the automatic ghost-clears so the // full-screen flash they cause is as short as possible. refresh-mode = ; + backlight = <&display_backlight>; }; sdcard@1 { @@ -187,4 +188,19 @@ compatible = "espressif,esp32-usbdevice-msc"; }; }; + + display_backlight_pwm { + compatible = "espressif,esp32-pwm-ledc"; + pin = <&gpio0 41 GPIO_FLAG_NONE>; + period-ns = <33333>; + ledc-timer = <1>; + ledc-channel = <1>; + }; + + display_backlight { + compatible = "pwm-backlight"; + status = "disabled"; + pwm = <&display_backlight_pwm>; + }; + };