From 20d07e127954469db12b94e75055b77dc2f85f68 Mon Sep 17 00:00:00 2001
From: zengchao <chao.zeng@siemens.com>
Date: Wed, 6 Nov 2019 11:21:49 +0800
Subject: [PATCH] HACK: setting the RJ45 port led behavior

Temporary needed until we have a proper, likely LED-class based
solution upstream.

Signed-off-by: zengchao <chao.zeng@siemens.com>
---
 drivers/net/phy/dp83867.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index c8031e297faf..16dee5050f45 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -53,6 +53,10 @@
 #define DP83867_10M_SGMII_CFG   0x016F
 #define DP83867_10M_SGMII_RATE_ADAPT_MASK BIT(7)
 
+/*RJ45 led configuration*/
+#define DP83867_LEDCR_1      0x0018
+#define RJ45_LED_SETTING     0x665b
+
 #define DP83867_SW_RESET	BIT(15)
 #define DP83867_SW_RESTART	BIT(14)
 
@@ -484,6 +488,9 @@ static int dp83867_verify_rgmii_cfg(struct phy_device *phydev)
 		return -EINVAL;
 	}
 
+	/*Set the RJ45 led action*/
+	phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_LEDCR_1, RJ45_LED_SETTING);
+
 	return 0;
 }
 
