From 5a6a452a741161b9e19580dbf3adae9ad2fade81 Mon Sep 17 00:00:00 2001 From: AmadeusGhost <42570690+AmadeusGhost@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:44:41 +0800 Subject: [PATCH] rockchip: add LED configuration from OF for rtl8211f (cherry picked from commit 1289211440583a19bf4648acca566ee756de3684) --- ...-LED-configuration-from-OF-for-8211f.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 target/linux/rockchip/patches-5.15/604-net-phy-realtek-add-LED-configuration-from-OF-for-8211f.patch diff --git a/target/linux/rockchip/patches-5.15/604-net-phy-realtek-add-LED-configuration-from-OF-for-8211f.patch b/target/linux/rockchip/patches-5.15/604-net-phy-realtek-add-LED-configuration-from-OF-for-8211f.patch new file mode 100644 index 0000000000..abdd7a5e77 --- /dev/null +++ b/target/linux/rockchip/patches-5.15/604-net-phy-realtek-add-LED-configuration-from-OF-for-8211f.patch @@ -0,0 +1,34 @@ +From edcc2833819f6750bf003b95a6ac856aced26276 Mon Sep 17 00:00:00 2001 +From: AnYun +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 +@@ -343,6 +343,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, +@@ -417,6 +418,14 @@ static int rtl8211f_config_init(struct p + return ret; + } + ++ ret = of_property_read_u32(dev->of_node, ++ "realtek,led-data", &led_data); ++ if (ret == 0) { ++ 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); + } +