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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Lucas Stach <l.stach@xxxxxxxxxxxxxx>

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

Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx>
---
 drivers/net/phy/phy.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 2b8fa63c06..42dcad9069 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -309,8 +309,13 @@ 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->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.15.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux