aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx
diff options
context:
space:
mode:
authorKuang Rufan <master@a1983.com.cn>2017-08-25 20:45:19 +0800
committerJohn Crispin <john@phrozen.org>2017-09-04 12:48:23 +0200
commit69323a0c070523fb7193486c4f89546668a72de8 (patch)
tree6b57101833e7debc9c8cd53245f41ccf4e84ab96 /target/linux/ar71xx
parent05c3647d35bb6fe762b221f36f68d44cce15b963 (diff)
downloadupstream-69323a0c070523fb7193486c4f89546668a72de8.tar.gz
upstream-69323a0c070523fb7193486c4f89546668a72de8.tar.bz2
upstream-69323a0c070523fb7193486c4f89546668a72de8.zip
ar71xx: add support for TL-WR1041N(v2) LAN/WAN LEDs.
1. Add support to LAN/WAN LEDs attached to ar8327. 2. Fix the problem that LAN/WAN LEDs does not blink in hardware (auto) mode when connected to 10M/100M ethernet. Signed-off-by: Kuang Rufan <master@a1983.com.cn>
Diffstat (limited to 'target/linux/ar71xx')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c
index fa8c4749cd..f79f155862 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1041n-v2.c
@@ -74,6 +74,22 @@ static struct gpio_keys_button tl_wr1041nv2_gpio_keys[] __initdata = {
}
};
+static const struct ar8327_led_info tl_wr1041n_leds_ar8327[] = {
+ AR8327_LED_INFO(PHY0_0, HW, "tp-link:green:wan"),
+ AR8327_LED_INFO(PHY1_0, HW, "tp-link:green:lan1"),
+ AR8327_LED_INFO(PHY2_0, HW, "tp-link:green:lan2"),
+ AR8327_LED_INFO(PHY3_0, HW, "tp-link:green:lan3"),
+ AR8327_LED_INFO(PHY4_0, HW, "tp-link:green:lan4"),
+};
+
+static struct ar8327_led_cfg wr1041n_v2_ar8327_led_cfg = {
+ .led_ctrl0 = 0xcf35cf35, /* LED0: blink at 10/100/1000M */
+ .led_ctrl1 = 0xcf35cf35, /* LED1: blink at 10/100/1000M: anyway, no LED1 on tl-wr1041n */
+ .led_ctrl2 = 0xcf35cf35, /* LED2: blink at 10/100/1000M: anyway, no LED2 on tl-wr1041n */
+ .led_ctrl3 = 0x03ffff00, /* Pattern enabled for LED 0-2 of port 1-3 */
+ .open_drain = true,
+};
+
static struct ar8327_pad_cfg db120_ar8327_pad0_cfg = {
.mode = AR8327_PAD_MAC_RGMII,
.txclk_delay_en = true,
@@ -90,7 +106,10 @@ static struct ar8327_platform_data db120_ar8327_data = {
.duplex = 1,
.txpause = 1,
.rxpause = 1,
- }
+ },
+ .led_cfg = &wr1041n_v2_ar8327_led_cfg,
+ .num_leds = ARRAY_SIZE(tl_wr1041n_leds_ar8327),
+ .leds = tl_wr1041n_leds_ar8327
};
static struct mdio_board_info db120_mdio0_info[] = {