Skip to content

Commit b4bc88a

Browse files
KAZUMIZUdavem330
authored andcommitted
ravb: Add fixed-link support
This patch adds support of the fixed PHY. This patch is based on commit 8700981 ("ucc_geth: use the new fixed PHY helpers"). Signed-off-by: Kazuya Mizuguchi <[email protected]> Signed-off-by: Yoshihiro Kaneko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a7159a3 commit b4bc88a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -882,13 +882,25 @@ static int ravb_phy_init(struct net_device *ndev)
882882
struct ravb_private *priv = netdev_priv(ndev);
883883
struct phy_device *phydev;
884884
struct device_node *pn;
885+
int err;
885886

886887
priv->link = 0;
887888
priv->speed = 0;
888889
priv->duplex = -1;
889890

890891
/* Try connecting to PHY */
891892
pn = of_parse_phandle(np, "phy-handle", 0);
893+
if (!pn) {
894+
/* In the case of a fixed PHY, the DT node associated
895+
* to the PHY is the Ethernet MAC DT node.
896+
*/
897+
if (of_phy_is_fixed_link(np)) {
898+
err = of_phy_register_fixed_link(np);
899+
if (err)
900+
return err;
901+
}
902+
pn = of_node_get(np);
903+
}
892904
phydev = of_phy_connect(ndev, pn, ravb_adjust_link, 0,
893905
priv->phy_interface);
894906
if (!phydev) {

0 commit comments

Comments
 (0)