mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
net: ethernet: stmmac: dwmac-rk: Make the phy clock could be used for external phy
Use the phy_clk to prepare_enable and unprepare_disable related phy clock. Change-Id: Idcf3ee00c03b4a5009a6a9385077b0a421dbc601 Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
@@ -1285,14 +1285,17 @@ static int rk_gmac_clk_init(struct plat_stmmacenet_data *plat)
|
||||
clk_set_rate(bsp_priv->clk_mac, 50000000);
|
||||
}
|
||||
|
||||
if (plat->phy_node && bsp_priv->integrated_phy) {
|
||||
if (plat->phy_node) {
|
||||
bsp_priv->clk_phy = of_clk_get(plat->phy_node, 0);
|
||||
if (IS_ERR(bsp_priv->clk_phy)) {
|
||||
ret = PTR_ERR(bsp_priv->clk_phy);
|
||||
dev_err(dev, "Cannot get PHY clock: %d\n", ret);
|
||||
return -EINVAL;
|
||||
/* If it is not integrated_phy, clk_phy is optional */
|
||||
if (bsp_priv->integrated_phy) {
|
||||
if (IS_ERR(bsp_priv->clk_phy)) {
|
||||
ret = PTR_ERR(bsp_priv->clk_phy);
|
||||
dev_err(dev, "Cannot get PHY clock: %d\n", ret);
|
||||
return -EINVAL;
|
||||
}
|
||||
clk_set_rate(bsp_priv->clk_phy, 50000000);
|
||||
}
|
||||
clk_set_rate(bsp_priv->clk_phy, 50000000);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user