rtl8211f: add LED configuration from OF
This commit is contained in:
parent
895a1db6ff
commit
e9814ed7f7
@ -0,0 +1,44 @@
|
||||
From edcc2833819f6750bf003b95a6ac856aced26276 Mon Sep 17 00:00:00 2001
|
||||
From: AnYun <amadeus@jmu.edu.cn>
|
||||
Date: Mon, 3 Apr 2023 23:26:04 +0800
|
||||
Subject: [PATCH] net: phy: realtek: add LED configuration from OF for 8211f
|
||||
|
||||
---
|
||||
drivers/net/phy/realtek.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/drivers/net/phy/realtek.c
|
||||
+++ b/drivers/net/phy/realtek.c
|
||||
@@ -27,6 +27,8 @@
|
||||
#define RTL821x_EXT_PAGE_SELECT 0x1e
|
||||
#define RTL821x_PAGE_SELECT 0x1f
|
||||
|
||||
+#define RTL8211F_LCR 0x10
|
||||
+#define RTL8211F_EEELCR 0x11
|
||||
#define RTL8211F_PHYCR1 0x18
|
||||
#define RTL8211F_PHYCR2 0x19
|
||||
#define RTL8211F_INSR 0x1d
|
||||
@@ -349,6 +351,7 @@ static int rtl8211f_config_init(struct p
|
||||
struct rtl821x_priv *priv = phydev->priv;
|
||||
struct device *dev = &phydev->mdio.dev;
|
||||
u16 val_txdly, val_rxdly;
|
||||
+ u32 led_data;
|
||||
int ret;
|
||||
|
||||
ret = phy_modify_paged_changed(phydev, 0xa43, RTL8211F_PHYCR1,
|
||||
@@ -425,6 +428,15 @@ static int rtl8211f_config_init(struct p
|
||||
}
|
||||
}
|
||||
|
||||
+ ret = of_property_read_u32(dev->of_node,
|
||||
+ "realtek,led-data", &led_data);
|
||||
+ if (!ret) {
|
||||
+ phy_write(phydev, RTL821x_PAGE_SELECT, 0xd04);
|
||||
+ phy_write(phydev, RTL8211F_LCR, led_data);
|
||||
+ phy_write(phydev, RTL8211F_EEELCR, 0x0);
|
||||
+ phy_write(phydev, RTL821x_PAGE_SELECT, 0x0);
|
||||
+ }
|
||||
+
|
||||
return genphy_soft_reset(phydev);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user