From b28a438abf34e14b278eb8901f8bcd2ea0c5a548 Mon Sep 17 00:00:00 2001 From: Tianling Shen Date: Wed, 15 Nov 2023 20:24:16 +0800 Subject: [PATCH] rockchip: add LED configuration for yt8531 Signed-off-by: Tianling Shen (cherry picked from commit 3313bd7e8ab60f31325d9578e7db57b77c11256c) --- ...mm-add-LED-configuration-for-yt85xx.patch} | 31 +++++++++++++++++-- 1 file changed, 28 insertions(+), 3 deletions(-) rename target/linux/rockchip/patches-5.15/{601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch => 601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch} (55%) diff --git a/target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch b/target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch similarity index 55% rename from target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch rename to target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch index 0cce28b06b..6e38648183 100644 --- a/target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt8521.patch +++ b/target/linux/rockchip/patches-5.15/601-net-phy-motorcomm-add-LED-configuration-for-yt85xx.patch @@ -1,6 +1,6 @@ --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c -@@ -223,6 +223,12 @@ +@@ -224,6 +224,12 @@ #define YTPHY_WCR_INTR_SEL BIT(6) #define YTPHY_WCR_ENABLE BIT(3) @@ -13,7 +13,7 @@ /* 2b00 84ms * 2b01 168ms *default* * 2b10 336ms -@@ -1458,6 +1464,7 @@ static int yt8521_resume(struct phy_devi +@@ -1459,6 +1465,7 @@ static int yt8521_resume(struct phy_devi static int yt8521_config_init(struct phy_device *phydev) { struct device_node *node = phydev->mdio.dev.of_node; @@ -21,7 +21,7 @@ int old_page; int ret = 0; -@@ -1487,6 +1494,16 @@ static int yt8521_config_init(struct phy +@@ -1488,6 +1495,16 @@ static int yt8521_config_init(struct phy if (ret < 0) goto err_restore_page; } @@ -38,3 +38,28 @@ err_restore_page: return phy_restore_page(phydev, old_page, ret); } +@@ -1495,6 +1512,7 @@ err_restore_page: + static int yt8531_config_init(struct phy_device *phydev) + { + struct device_node *node = phydev->mdio.dev.of_node; ++ u32 led_data[YTPHY_LED_NUM_CONFIG]; + int ret; + + ret = ytphy_rgmii_clk_delay_config_with_lock(phydev); +@@ -1519,6 +1537,16 @@ static int yt8531_config_init(struct phy + return ret; + } + ++ if (!of_property_read_u32_array(node, "motorcomm,led-data", ++ led_data, YTPHY_LED_NUM_CONFIG)) { ++ for (int i = 0; i < YTPHY_LED_NUM_CONFIG; i++) { ++ ret = ytphy_write_ext(phydev, YTPHY_LED_CONFIG_REG(i), ++ led_data[i]); ++ if (ret < 0) ++ return ret; ++ } ++ } ++ + return 0; + } +