arm64: dts: librem5-devkit: Make LED use PWM
authorGuido Günther <agx@sigxcpu.org>
Sun, 9 Oct 2022 12:26:54 +0000 (14:26 +0200)
committerShawn Guo <shawnguo@kernel.org>
Sat, 29 Oct 2022 01:15:12 +0000 (09:15 +0800)
We can use PWM instead of just GPIO allowing us to control brightness.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts

index 6445c6b90b5bb8bc1577b3233be65416508b0333..7e4b6d65fd894ab3b5736e0377b5a1f118c7042b 100644 (file)
        };
 
        leds {
-               compatible = "gpio-leds";
-               pinctrl-names = "default";
-               pinctrl-0 = <&pinctrl_gpio_leds>;
+               compatible = "pwm-leds";
 
                led1 {
                        label = "LED 1";
-                       gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
-                       default-state = "off";
+                       max-brightness = <248>;
+                       pwms = <&pwm2 0 50000 0>;
                };
        };
 
                >;
        };
 
-       pinctrl_gpio_leds: gpioledgrp {
+       pinctrl_pwm_led: pwmledgrp {
                fsl,pins = <
-                       MX8MQ_IOMUXC_GPIO1_IO13_GPIO1_IO13      0x16
+                       MX8MQ_IOMUXC_GPIO1_IO13_PWM2_OUT        0x16
                >;
        };
 
        status = "okay";
 };
 
+&pwm2 {
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_pwm_led>;
+       status = "okay";
+};
+
 &snvs_pwrkey {
        status = "okay";
 };