[openwrt/openwrt] ramips: mt76x8: fixs for Keenetic Air (KN-1613) and Extra (KN-1713)

LEDE Commits lede-commits at lists.infradead.org
Sun Jan 12 08:48:35 PST 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/191ed4e803bbd82e9023d73ed9ff3c1d5ea64892

commit 191ed4e803bbd82e9023d73ed9ff3c1d5ea64892
Author: Anton Yu. Ivanusev <ivanusevanton at yandex.ru>
AuthorDate: Wed Jan 8 01:14:10 2025 +0500

    ramips: mt76x8: fixs for Keenetic Air (KN-1613) and Extra (KN-1713)
    
    A new syntax for LEDs was used, and migration of the LEDs configuration was
    added. Used lower case hex characters for the addresses. Fixed a USB port
    power issue.
    
    Signed-off-by: Anton Yu. Ivanusev <ivanusevanton at yandex.ru>
    Link: https://github.com/openwrt/openwrt/pull/17521
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 .../linux/ramips/dts/mt7628an_keenetic_kn-1613.dts |  9 ++++--
 .../linux/ramips/dts/mt7628an_keenetic_kn-1713.dts | 32 ++++++++++++----------
 .../mt76x8/base-files/etc/board.d/04_led_migration | 16 +++++++++++
 3 files changed, 39 insertions(+), 18 deletions(-)

diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts
index 4b124c9295..af6292980b 100644
--- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts
+++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1613.dts
@@ -30,18 +30,21 @@
 		};
 
 		internet {
-			label = "green:internet";
+			function = LED_FUNCTION_WAN;
+			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
 		};
 
 		wifi2 {
-			label = "green:wifi2";
+			function = LED_FUNCTION_WLAN_2GHZ;
+			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy0tpt";
 		};
 
 		wifi5 {
-			label = "green:wifi5";
+			function = LED_FUNCTION_WLAN_5GHZ;
+			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
 			linux,default-trigger = "phy1tpt";
 		};
diff --git a/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts b/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts
index 972c88eadd..84127a88e0 100644
--- a/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts
+++ b/target/linux/ramips/dts/mt7628an_keenetic_kn-1713.dts
@@ -27,6 +27,7 @@
 		regulator-max-microvolt = <5000000>;
 		gpios = <&gpio 6 GPIO_ACTIVE_HIGH>;
 		enable-active-high;
+		regulator-always-on;
 	};
 
 	leds {
@@ -44,17 +45,18 @@
 			gpios = <&gpio 38 GPIO_ACTIVE_LOW>;
 		};
 
-		fn {
-			function = LED_FUNCTION_USB;
+		wifi2 {
+			function = LED_FUNCTION_WLAN_2GHZ;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
+			linux,default-trigger = "phy0tpt";
 		};
 
-		wifi {
-			function = LED_FUNCTION_WLAN;
+		wifi5 {
+			function = LED_FUNCTION_WLAN_5GHZ;
 			color = <LED_COLOR_ID_GREEN>;
 			gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
-			linux,default-trigger = "phy0tpt","phy1tpt";
+			linux,default-trigger = "phy1tpt";
 		};
 	};
 
@@ -93,7 +95,7 @@
 			partition at 0 {
 				compatible = "denx,uimage";
 				label = "firmware";
-				reg = <0x0 0x1CC0000>;
+				reg = <0x0 0x1cc0000>;
 			};
 		};
 	};
@@ -160,21 +162,21 @@
 				reg = <0x50000 0xe60000>;
 			};
 
-			partition at EB0000 {
+			partition at eb0000 {
 				label = "config_1";
-				reg = <0xEB0000 0x40000>;
+				reg = <0xeb0000 0x40000>;
 				read-only;
 			};
 
-			partition at EF0000 {
+			partition at ef0000 {
 				label = "storage";
-				reg = <0xEF0000 0x100000>;
+				reg = <0xef0000 0x100000>;
 				read-only;
 			};
 
-			partition at FF0000 {
+			partition at ff0000 {
 				label = "dump";
-				reg = <0xFF0000 0x10000>;
+				reg = <0xff0000 0x10000>;
 				read-only;
 			};
 
@@ -198,12 +200,12 @@
 
 			firmware2: partition at 1050000 {
 				label = "firmware_2";
-				reg = <0x1050000 0xE60000>;
+				reg = <0x1050000 0xe60000>;
 			};
 			
-			partition at 1EB0000 {
+			partition at 1eb0000 {
 				label = "Config_2";
-				reg = <0x1EB0000 0x40000>;
+				reg = <0x1eb0000 0x40000>;
 				read-only;
 			};
 		};
diff --git a/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration b/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration
new file mode 100644
index 0000000000..c845fadd73
--- /dev/null
+++ b/target/linux/ramips/mt76x8/base-files/etc/board.d/04_led_migration
@@ -0,0 +1,16 @@
+. /lib/functions.sh
+. /lib/functions/migrations.sh
+
+board=$(board_name)
+
+case "$board" in
+keenetic,kn-1613)
+	migrate_leds 'green:internet=green:wan'
+	;;
+esac
+
+remove_devicename_leds
+
+migrations_apply system
+
+exit 0




More information about the lede-commits mailing list