qoriq: define leds for Firebox M300
authorThibaut VARÈNE <hacks@slashdirt.org>
Tue, 14 Jun 2022 13:54:48 +0000 (15:54 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Tue, 28 Jun 2022 21:09:53 +0000 (00:09 +0300)
This patch provides support for the Firebox M300 only user-controllable
bi-color LED, and makes the green "shield" LED act as the typical
OpenWrt status led.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
target/linux/qoriq/files/arch/powerpc/boot/dts/fsl/watchguard-firebox-m300.dts
target/linux/qoriq/image/generic.mk

index 54f7e06bc5b52974bdc8dc5d45d3e70e148ad495..4ba30a3c0f5e2dfc4c00fc225538043d0c839ef7 100644 (file)
@@ -7,6 +7,8 @@
  * Copyright 2020 - 2021 Stijn Tintel <stijn@linux-ipv6.be>
  */
 
+#include <dt-bindings/gpio/gpio.h>
+
 /include/ "t208xsi-pre.dtsi"
 /include/ "t208xqds.dtsi"
 
                ethernet2 = &enet1;
                ethernet3 = &enet2;
                ethernet4 = &enet3;
+
+               led-boot = &led_shield;
+               led-failsafe = &led_shield;
+               led-running = &led_shield;
+               led-upgrade = &led_shield;
        };
 };
 
                        status = "disabled";
                };
        };
+
+       leds {
+               compatible = "gpio-leds";
+
+               shield-red {
+                       label = "red:shield";
+                       gpios = <&gpio0 28 GPIO_ACTIVE_HIGH>;
+               };
+
+               led_shield: shield-green {
+                       label = "green:shield";
+                       gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
+               };
+       };
 };
index b8ffc69ba09db0ebdb15d9eaac4dec76fed561b2..b2689850b3db853202520bbc85d727fa71225eed 100644 (file)
@@ -6,7 +6,7 @@ define Device/watchguard_firebox-m300
   DEVICE_COMPAT_VERSION := 1.1
   DEVICE_DTS_DIR := $(DTS_DIR)/fsl
   DEVICE_PACKAGES := \
-       kmod-hwmon-w83793 kmod-ptp-qoriq kmod-rtc-rs5c372a kmod-tpm-i2c-atmel
+       kmod-hwmon-w83793 kmod-leds-gpio kmod-ptp-qoriq kmod-rtc-rs5c372a kmod-tpm-i2c-atmel
   KERNEL := kernel-bin | gzip | fit gzip $$(KDIR)/image-$$(firstword $$(DEVICE_DTS)).dtb
   KERNEL_SUFFIX := -fit-uImage.itb
   IMAGES := sdcard.img.gz sysupgrade.img.gz