diff mbox series

[v2] of: of_mdio: Handle broken-turn-around for non-phy mdio devices

Message ID 20210217044443.1246392-1-nathan@nathanrossi.com
State New
Headers show
Series [v2] of: of_mdio: Handle broken-turn-around for non-phy mdio devices | expand

Commit Message

Nathan Rossi Feb. 17, 2021, 4:44 a.m. UTC
From: Nathan Rossi <nathan.rossi@digi.com>

The documentation for MDIO bindings describes the "broken-turn-around",
property such that any MDIO device can define it. Other MDIO devices may
require this property in order to correctly function on the MDIO bus.

Enable the parsing and configuration associated with this property for
non-phy MDIO devices.

Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
---
Changes in v2:
- Only handle broken-turn-around for non-phy devices
- No need for of_mdiobus_child_parse function
---
 drivers/net/mdio/of_mdio.c | 3 +++
 1 file changed, 3 insertions(+)

---
2.30.0
diff mbox series

Patch

diff --git a/drivers/net/mdio/of_mdio.c b/drivers/net/mdio/of_mdio.c
index 4daf94bb56..9796f259a8 100644
--- a/drivers/net/mdio/of_mdio.c
+++ b/drivers/net/mdio/of_mdio.c
@@ -158,6 +158,9 @@  static int of_mdiobus_register_device(struct mii_bus *mdio,
 	if (IS_ERR(mdiodev))
 		return PTR_ERR(mdiodev);
 
+	if (of_property_read_bool(child, "broken-turn-around"))
+		mdio->phy_ignore_ta_mask |= 1 << addr;
+
 	/* Associate the OF node with the device structure so it
 	 * can be looked up later.
 	 */