bcm63xx: ar-5381u: expose LEDs through controller
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 24 May 2020 18:16:30 +0000 (20:16 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 24 May 2020 18:16:30 +0000 (20:16 +0200)
Exposing LEDs through LED controller instead of gpio-leds takes
advantage of HW blinking.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
target/linux/bcm63xx/dts/bcm6328-comtrend-ar-5381u.dts

index a2600cdc72d0c2fc79262e8206bb9bf5deb9ddab..ce57ee6413359faa4b99687dd378b97dcaa08ee1 100644 (file)
@@ -10,7 +10,7 @@
 
        aliases {
                led-boot = &led_power_green;
-               led-failsafe = &led_power_green;
+               led-failsafe = &led_alarm_red;
                led-running = &led_power_green;
                led-upgrade = &led_power_green;
        };
                        debounce-interval = <60>;
                };
        };
-
-       leds {
-               compatible = "gpio-leds";
-
-               alarm_red {
-                       label = "AR-5381u:red:alarm";
-                       gpios = <&pinctrl 2 1>;
-               };
-               inet_green {
-                       label = "AR-5381u:green:inet";
-                       gpios = <&pinctrl 3 1>;
-               };
-               led_power_green: power_green {
-                       label = "AR-5381u:green:power";
-                       gpios = <&pinctrl 4 1>;
-                       default-state = "on";
-               };
-       };
 };
 
 &hsspi {
        };
 };
 
+&leds {
+       status = "okay";
+
+       pinctrl-names = "default";
+       pinctrl-0 = <&pinctrl_leds>;
+
+       led_alarm_red: led@2 {
+               reg = <2>;
+               active-low;
+               label = "AR-5381u:red:alarm";
+       };
+
+       led@3 {
+               reg = <3>;
+               active-low;
+               label = "AR-5381u:green:inet";
+       };
+
+       led_power_green: led@4 {
+               reg = <4>;
+               active-low;
+               label = "AR-5381u:green:power";
+               default-state = "on";
+       };
+};
+
+&pinctrl {
+       pinctrl_leds: leds {
+               function = "led";
+               pins = "gpio2", "gpio3", "gpio4";
+       };
+};
+
 &uart0 {
        status = "okay";
 };