net: phy: motorcomm: enable the reference clock for YT8521

Commit 42310a2438 ("net: phy: motorcomm: Enable optional clock for
YT8531") enables the SoC-provided reference clock for the YT8531 in its
probe. The YT8521 has the same need on crystal-less boards but goes
through yt8521_probe(), so enable it there too. The clock is optional,
so crystal-clocked boards are unaffected.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Gavin Gao <attinagaoxu@gmail.com>
Signed-off-by: Jiaxing Hu <gahing@gahingwoo.com>
Link: https://patch.msgid.link/20260731013807.1488843-1-gahing@gahingwoo.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Jiaxing Hu
2026-07-31 13:38:07 +12:00
committed by Jakub Kicinski
parent ef26a42b07
commit dc3b7209b5

View File

@@ -1065,6 +1065,7 @@ static int yt8521_probe(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
struct yt8521_priv *priv;
struct clk *clk;
int chip_config;
u16 mask, val;
u32 freq;
@@ -1076,6 +1077,11 @@ static int yt8521_probe(struct phy_device *phydev)
phydev->priv = priv;
clk = devm_clk_get_optional_enabled(dev, NULL);
if (IS_ERR(clk))
return dev_err_probe(dev, PTR_ERR(clk),
"failed to get and enable PHY clock\n");
chip_config = ytphy_read_ext_with_lock(phydev, YT8521_CHIP_CONFIG_REG);
if (chip_config < 0)
return chip_config;