mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
net: ethernet: stmmac: dwmac-rk: Make the clk_phy could be used for external phy
For external phy, clk_phy should be optional, and some external phy need the clock input from clk_phy. This patch adds support for setting clk_phy for external phy. Signed-off-by: David Wu <david.wu@rock-chips.com> Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com> Link: https://patch.msgid.link/20250815023515.114-1-kernel@airkyi.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -1412,12 +1412,15 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat)
|
||||
clk_set_rate(plat->stmmac_clk, 50000000);
|
||||
}
|
||||
|
||||
if (plat->phy_node && bsp_priv->integrated_phy) {
|
||||
if (plat->phy_node) {
|
||||
bsp_priv->clk_phy = of_clk_get(plat->phy_node, 0);
|
||||
ret = PTR_ERR_OR_ZERO(bsp_priv->clk_phy);
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
|
||||
clk_set_rate(bsp_priv->clk_phy, 50000000);
|
||||
/* If it is not integrated_phy, clk_phy is optional */
|
||||
if (bsp_priv->integrated_phy) {
|
||||
if (ret)
|
||||
return dev_err_probe(dev, ret, "Cannot get PHY clock\n");
|
||||
clk_set_rate(bsp_priv->clk_phy, 50000000);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user