diff mbox series

[v1,10/10] arm64: dts: mediatek: spherion: Add keyboard backlight

Message ID 20220316151327.564214-11-nfraprado@collabora.com
State Superseded
Headers show
Series Introduce support for MediaTek MT8192 Google Chromebooks | expand

Commit Message

NĂ­colas F. R. A. Prado March 16, 2022, 3:13 p.m. UTC
The Spherion board has keyboard backlight controlled by the PWM signal
generated by the ChromeOS EC.

Enable PWM output for ChromeOS EC and add a PWM controlled LED node for
the keyboard backlight.

Signed-off-by: NĂ­colas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---

 .../dts/mediatek/mt8192-asurada-spherion-r0.dts  | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts
index 20ae4a869c63..b9dd5fd2e964 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada-spherion-r0.dts
@@ -4,12 +4,28 @@ 
  */
 /dts-v1/;
 #include "mt8192-asurada.dtsi"
+#include <dt-bindings/leds/common.h>
 
 / {
 	model = "MediaTek Spherion (rev0 - 3)";
 	compatible = "google,spherion-rev3", "google,spherion-rev2",
 		     "google,spherion-rev1", "google,spherion-rev0",
 		     "google,spherion", "mediatek,mt8192";
+
+	pwmleds {
+		compatible = "pwm-leds";
+
+		led {
+			function = LED_FUNCTION_KBD_BACKLIGHT;
+			color = <LED_COLOR_ID_WHITE>;
+			pwms = <&cros_ec_pwm 0>;
+			max-brightness = <1023>;
+		};
+	};
+};
+
+&cros_ec_pwm {
+	status = "okay";
 };
 
 &touchscreen {