bcm63xx: ar-5315u: expose LEDs through controller
authorÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 24 May 2020 18:19:21 +0000 (20:19 +0200)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Sun, 24 May 2020 18:19:21 +0000 (20:19 +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/bcm6318-comtrend-ar-5315u.dts

index 000ff99767fe9be24433c0013abefea9421c5975..be102746255403da38b19c372200b2a0fef1c048 100644 (file)
                        debounce-interval = <60>;
                };
        };
-
-       leds {
-               compatible = "gpio-leds";
-
-               wps_green {
-                       label = "AR-5315u:green:wps";
-                       gpios = <&pinctrl 0 1>;
-               };
-               led_power_green: power_green {
-                       label = "AR-5315u:green:power";
-                       gpios = <&pinctrl 1 1>;
-                       default-state = "on";
-               };
-               usb_green {
-                       label = "AR-5315u:green:usb";
-                       gpios = <&pinctrl 2 1>;
-               };
-               inet_green {
-                       label = "AR-5315u:green:inet";
-                       gpios = <&pinctrl 8 1>;
-               };
-               inet_red {
-                       label = "AR-5315u:red:inet";
-                       gpios = <&pinctrl 9 1>;
-               };
-               dsl_green {
-                       label = "AR-5315u:green:dsl";
-                       gpios = <&pinctrl 10 1>;
-               };
-               power_red {
-                       label = "AR-5315u:red:power";
-                       gpios = <&pinctrl 11 1>;
-               };
-       };
 };
 
 &hsspi {
        };
 };
 
-&pinctrl {
+&leds {
+       status = "okay";
+
        pinctrl-names = "default";
-       pinctrl-0 = <&pinctrl_ephy0_act_led &pinctrl_ephy1_act_led
+       pinctrl-0 = <&pinctrl_leds
+                    &pinctrl_ephy0_act_led &pinctrl_ephy1_act_led
                     &pinctrl_ephy2_act_led &pinctrl_ephy3_act_led>;
+
+       led@0 {
+               reg = <0>;
+               active-low;
+               label = "AR-5315u:green:wps";
+       };
+
+       led_power_green: led@1 {
+               reg = <1>;
+               active-low;
+               label = "AR-5315u:green:power";
+               default-state = "on";
+       };
+
+       led@2 {
+               reg = <2>;
+               active-low;
+               label = "AR-5315u:green:usb";
+       };
+
+       led@4 {
+               reg = <4>;
+               brcm,hardware-controlled;
+               brcm,link-signal-sources = <4>;
+               /* EPHY0 Act */
+       };
+
+       led@5 {
+               reg = <5>;
+               brcm,hardware-controlled;
+               brcm,link-signal-sources = <5>;
+               /* EPHY1 Act */
+       };
+
+       led@6 {
+               reg = <6>;
+               brcm,hardware-controlled;
+               brcm,link-signal-sources = <6>;
+               /* EPHY2 Act */
+       };
+
+       led@7 {
+               reg = <7>;
+               brcm,hardware-controlled;
+               brcm,link-signal-sources = <7>;
+               /* EPHY3 Act */
+       };
+
+       led@8 {
+               reg = <8>;
+               active-low;
+               label = "AR-5315u:green:inet";
+       };
+
+       led@9 {
+               reg = <9>;
+               active-low;
+               label = "AR-5315u:red:inet";
+       };
+
+       led@10 {
+               reg = <10>;
+               active-low;
+               label = "AR-5315u:green:dsl";
+       };
+
+       led@11 {
+               reg = <11>;
+               active-low;
+               label = "AR-5315u:red:power";
+       };
+};
+
+&pinctrl {
+       pinctrl_leds: leds {
+               function = "led";
+               pins = "gpio0", "gpio1",
+                      "gpio2", "gpio8",
+                      "gpio9", "gpio10",
+                      "gpio11";
+       };
 };
 
 &uart0 {