Modify

Opened 5 years ago

Closed 5 years ago

#12732 closed enhancement (invalid)

Enable control LAN0-LAN4 LEDs on MR3x20-V1 / WR841N-V7

Reported by: dioptimizer@… Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: kernel Version: Trunk
Keywords: Cc:

Description

Tested on MR3220 and works fine.

Index: target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3x20.c
===================================================================
--- target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3x20.c	(revision 34914)
+++ target/linux/ar71xx/files/arch/mips/ath79/mach-tl-mr3x20.c	(working copy)
@@ -11,7 +11,9 @@
 #include <linux/gpio.h>
 
 #include <asm/mach-ath79/ath79.h>
+#include <asm/mach-ath79/ar71xx_regs.h>
 
+#include "common.h"
 #include "dev-eth.h"
 #include "dev-ap9x-pci.h"
 #include "dev-gpio-buttons.h"
@@ -23,6 +25,11 @@
 #define TL_MR3X20_GPIO_LED_QSS		0
 #define TL_MR3X20_GPIO_LED_SYSTEM	1
 #define TL_MR3X20_GPIO_LED_3G		8
+#define TL_MR3X20_GPIO_LED_LAN1		13
+#define TL_MR3X20_GPIO_LED_LAN2		14
+#define TL_MR3X20_GPIO_LED_LAN3		15
+#define TL_MR3X20_GPIO_LED_LAN4		16
+#define TL_MR3X20_GPIO_LED_WAN		17
 
 #define TL_MR3X20_GPIO_BTN_RESET	11
 #define TL_MR3X20_GPIO_BTN_QSS		12
@@ -51,6 +58,26 @@
 		.gpio		= TL_MR3X20_GPIO_LED_QSS,
 		.active_low	= 1,
 	}, {
+		.name		= "tp-link:green:lan1",
+		.gpio		= TL_MR3X20_GPIO_LED_LAN1,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan2",
+		.gpio		= TL_MR3X20_GPIO_LED_LAN2,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan3",
+		.gpio		= TL_MR3X20_GPIO_LED_LAN3,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:lan4",
+		.gpio		= TL_MR3X20_GPIO_LED_LAN4,
+		.active_low	= 1,
+	}, {
+		.name		= "tp-link:green:wan",
+		.gpio		= TL_MR3X20_GPIO_LED_WAN,
+		.active_low	= 1,
+	}, {
 		.name		= "tp-link:green:3g",
 		.gpio		= TL_MR3X20_GPIO_LED_3G,
 		.active_low	= 1,
@@ -97,6 +124,12 @@
 	ath79_register_eth(0);
 
 	ap91_pci_init(ee, mac);
+
+	ath79_gpio_function_disable(AR724X_GPIO_FUNC_ETH_SWITCH_LED0_EN |
+				    AR724X_GPIO_FUNC_ETH_SWITCH_LED1_EN |
+				    AR724X_GPIO_FUNC_ETH_SWITCH_LED2_EN |
+				    AR724X_GPIO_FUNC_ETH_SWITCH_LED3_EN |
+				    AR724X_GPIO_FUNC_ETH_SWITCH_LED4_EN);
 }
 
 static void __init tl_mr3x20_usb_setup(void)
Index: target/linux/ar71xx/base-files/etc/uci-defaults/leds
===================================================================
--- target/linux/ar71xx/base-files/etc/uci-defaults/leds	(revision 34914)
+++ target/linux/ar71xx/base-files/etc/uci-defaults/leds	(working copy)
@@ -115,6 +115,11 @@
 
 tl-mr3220 | \
 tl-mr3420 )
+	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
+	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02"
+	ucidef_set_led_switch "lan2" "LAN2" "tp-link:green:lan2" "switch0" "0x04"
+	ucidef_set_led_switch "lan3" "LAN3" "tp-link:green:lan3" "switch0" "0x08"
+	ucidef_set_led_switch "lan4" "LAN4" "tp-link:green:lan4" "switch0" "0x10"
 	ucidef_set_led_usbdev "usb" "USB" "tp-link:green:3g" "1-1"
 	;;
 
@@ -142,6 +147,7 @@
 	ucidef_set_led_wlan "wlan2g" "WLAN2G" "tp-link:blue:wlan2g" "phy0tpt"
 	;;
 
+tl-wr841n-v7 | \
 tl-wr741nd)
 	ucidef_set_led_netdev "wan" "WAN" "tp-link:green:wan" "eth1"
 	ucidef_set_led_switch "lan1" "LAN1" "tp-link:green:lan1" "switch0" "0x02" 

Attachments (1)

enable-lan0-lan4-led.patch (2.9 KB) - added by Dioptimizer <dioptimizer@…> 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by Dioptimizer <dioptimizer@…>

comment:1 Changed 5 years ago by jogo

  • Resolution set to invalid
  • Status changed from new to closed

Please submit the patch to the mailing list according to SubmittingPatches. I'll close this ticket to keep trac mostly for actual bugs.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.