Thread (2 messages) 2 messages, 2 authors, 2016-08-08
STALE3582d

[PATCH] net: phy: fixed-link: read link parameters from devicetree

From: Lucas Stach <l.stach@pengutronix.de>
Date: 2016-08-08 11:03:21
Subsystem: ethernet phy library, networking drivers, the rest · Maintainers: Andrew Lunn, Heiner Kallweit, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Implement the missing reading of the fixed link parameters from
the devicetree properties.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/net/phy/phy.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 13b832470926..fc39c5d8c750 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -309,11 +309,14 @@ static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
 
 	phydev->dev.parent = &edev->dev;
 	phydev->registered = 1;
-	phydev->speed = 1000;
-	phydev->duplex = 1;
-	phydev->pause = phydev->asym_pause = 0;
 	phydev->link = 1;
 
+	if (of_property_read_u32(np, "speed", &phydev->speed))
+		return NULL;
+	phydev->duplex = of_property_read_bool(np,"full-duplex");
+	phydev->pause = of_property_read_bool(np, "pause");
+	phydev->asym_pause = of_property_read_bool(np, "asym-pause");
+
 	return phydev;
 }
 
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help