diff options
author | Yanhong Wang <yanhong.wang@starfivetech.com> | 2023-03-24 05:28:48 +0300 |
---|---|---|
committer | Hal Feng <hal.feng@starfivetech.com> | 2023-11-29 05:54:34 +0300 |
commit | 4542b17102eac99de0eb8801392dfe57c30225d0 (patch) | |
tree | addf6058b6232ca3313aa68eb101f632594b526f | |
parent | 9572aaa97604dfc8b46f778e63c15b5ecde34250 (diff) | |
download | u-boot-4542b17102eac99de0eb8801392dfe57c30225d0.tar.xz |
net: phy: motorcomm: Move ytphy_of_config function call to startup function
In order to dynamically adjust the phy clock delay configuration, so
move ytphy_of_config function call to startup function.
Signed-off-by: Yanhong Wang <yanhong.wang@starfivetech.com>
-rw-r--r-- | drivers/net/phy/motorcomm.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/phy/motorcomm.c b/drivers/net/phy/motorcomm.c index 94142a5a5a..6e8beac30e 100644 --- a/drivers/net/phy/motorcomm.c +++ b/drivers/net/phy/motorcomm.c @@ -96,6 +96,8 @@ static const struct ytphy_reg_field ytphy_rxden_grp[] = { { "rxc_dly_en", 1, 8, 0x1 } }; +static int ytphy_of_config(struct phy_device *phydev); + static int ytphy_read_ext(struct phy_device *phydev, u32 regnum) { int ret; @@ -194,6 +196,11 @@ static int ytphy_startup(struct phy_device *phydev) { int retval; + /*set delay config*/ + retval = ytphy_of_config(phydev); + if (retval < 0) + return retval; + retval = genphy_update_link(phydev); if (retval) return retval; @@ -256,6 +263,7 @@ static int ytphy_of_config(struct phy_device *phydev) cfg = ofnode_read_u32_default(node, ytphy_rxtxd_grp[i].name, ~0); + cfg = (cfg != -1) ? cfg : ytphy_rxtxd_grp[i].dflt; /*check the cfg overflow or not*/ @@ -369,10 +377,6 @@ static int yt8531_config(struct phy_device *phydev) ret = 0; genphy_config_aneg(phydev); - /*set delay config*/ - ret = ytphy_of_config(phydev); - if (ret < 0) - return ret; return 0; } |