lede/target/linux/rockchip/patches-6.1/102-net-phy-realtek-RTL8211-add-LED-configuration-from-OF.patch
aakkll b828e123c6
kernel: bump to 5.4.249, 6.1.40 (#11404)
Signed-off-by: aakkll <94471752+aakkll@users.noreply.github.com>
2023-07-26 22:25:00 +08:00

35 lines
983 B
Diff

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
@@ -349,6 +349,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 +426,14 @@ 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, 0x10, led_data);
+ phy_write(phydev, RTL821x_PAGE_SELECT, 0x0);
+ }
+
return genphy_soft_reset(phydev);
}