gluon/patches/lede/0047-ar71xx-fix-TP-Link-Archer-C7-v4-switch-LEDs.patch

73 lines
3.6 KiB
Diff

From: David Bauer <mail@david-bauer.net>
Date: Sat, 16 Dec 2017 15:43:02 +0100
Subject: ar71xx: fix TP-Link Archer C7 v4 switch LEDs
This fixes wrong switch LEDs on TP-Link Archer C7 v4.
Signed-off-by: David Bauer <mail@david-bauer.net>
diff --git a/target/linux/ar71xx/base-files/etc/board.d/01_leds b/target/linux/ar71xx/base-files/etc/board.d/01_leds
index 44b1c2837e8392596eed14b4bc0d761042109715..47b90d9cb2f81936aed22cdf7d1f6d870d23c16e 100755
--- a/target/linux/ar71xx/base-files/etc/board.d/01_leds
+++ b/target/linux/ar71xx/base-files/etc/board.d/01_leds
@@ -53,8 +53,7 @@ ap121f)
ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan" "phy0tpt"
;;
-archer-c25-v1|\
-archer-c7-v4)
+archer-c25-v1)
ucidef_set_led_netdev "wan" "WAN" "$board:green:wan" "eth0"
ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
@@ -62,12 +61,6 @@ archer-c7-v4)
ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x04"
ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x02"
- case "$board" in
- archer-c7-v4)
- ucidef_set_led_usbdev "usb1" "USB1" "$board:green:usb1" "1-1"
- ucidef_set_led_usbdev "usb2" "USB2" "$board:green:usb2" "2-1"
- ;;
- esac
;;
arduino-yun)
ucidef_set_led_wlan "wlan" "WLAN" "arduino:blue:wlan" "phy0tpt"
@@ -635,6 +628,17 @@ archer-c7)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy1tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "tp-link:blue:wlan5g" "phy0tpt"
;;
+archer-c7-v4)
+ ucidef_set_led_wlan "wlan" "WLAN" "$board:green:wlan2g" "phy1tpt"
+ ucidef_set_led_wlan "wlan5g" "WLAN5G" "$board:green:wlan5g" "phy0tpt"
+ ucidef_set_led_switch "wan" "WAN" "$board:green:wan" "switch0" "0x02"
+ ucidef_set_led_switch "lan1" "LAN1" "$board:green:lan1" "switch0" "0x04"
+ ucidef_set_led_switch "lan2" "LAN2" "$board:green:lan2" "switch0" "0x08"
+ ucidef_set_led_switch "lan3" "LAN3" "$board:green:lan3" "switch0" "0x10"
+ ucidef_set_led_switch "lan4" "LAN4" "$board:green:lan4" "switch0" "0x20"
+ ucidef_set_led_usbdev "usb1" "USB1" "$board:green:usb1" "1-1"
+ ucidef_set_led_usbdev "usb2" "USB2" "$board:green:usb2" "2-1"
+ ;;
tl-wpa8630)
ucidef_set_led_netdev "lan" "LAN" "$board:green:lan" "eth0"
ucidef_set_led_netdev "wlan" "WLAN" "$board:green:wlan" "wlan1"
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
index 64955c79945c0b2c28d5a93be6e45662200e60ed..9688b015356cb766c5966be2190e1aae29420d8d 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-archer-c7-v4.c
@@ -58,10 +58,10 @@
#define ARCHER_C7_74HC_GPIO_BASE QCA956X_GPIO_COUNT
#define ARCHER_C7_GPIO_LED_WPS (ARCHER_C7_74HC_GPIO_BASE + 0)
-#define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 1)
-#define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 2)
-#define ARCHER_C7_GPIO_LED_LAN3 (ARCHER_C7_74HC_GPIO_BASE + 3)
-#define ARCHER_C7_GPIO_LED_LAN4 (ARCHER_C7_74HC_GPIO_BASE + 4)
+#define ARCHER_C7_GPIO_LED_LAN4 (ARCHER_C7_74HC_GPIO_BASE + 1)
+#define ARCHER_C7_GPIO_LED_LAN3 (ARCHER_C7_74HC_GPIO_BASE + 2)
+#define ARCHER_C7_GPIO_LED_LAN2 (ARCHER_C7_74HC_GPIO_BASE + 3)
+#define ARCHER_C7_GPIO_LED_LAN1 (ARCHER_C7_74HC_GPIO_BASE + 4)
#define ARCHER_C7_GPIO_LED_WAN_GREEN (ARCHER_C7_74HC_GPIO_BASE + 5)
#define ARCHER_C7_GPIO_LED_WAN_AMBER (ARCHER_C7_74HC_GPIO_BASE + 6)
#define ARCHER_C7_GPIO_LED_WLAN2 (ARCHER_C7_74HC_GPIO_BASE + 7)