Lines Matching full:mdio
3 * OF helpers for the MDIO (Ethernet PHY) API
36 int of_mdiobus_phy_device_register(struct mii_bus *mdio, struct phy_device *phy, in of_mdiobus_phy_device_register() argument
39 return fwnode_mdiobus_phy_device_register(mdio, phy, in of_mdiobus_phy_device_register()
45 static int of_mdiobus_register_phy(struct mii_bus *mdio, in of_mdiobus_register_phy() argument
48 return fwnode_mdiobus_register_phy(mdio, of_fwnode_handle(child), addr); in of_mdiobus_register_phy()
51 static int of_mdiobus_register_device(struct mii_bus *mdio, in of_mdiobus_register_device() argument
58 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
77 dev_dbg(&mdio->dev, "registered mdio device %pOFn at address %i\n", in of_mdiobus_register_device()
85 * to have a compatible string, so they can be matched to an MDIO
143 * @mdio: pointer to mii_bus structure
144 * @np: pointer to device_node of MDIO bus.
145 * @owner: module owning the @mdio object.
150 int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np, in __of_mdiobus_register() argument
158 return __mdiobus_register(mdio, owner); in __of_mdiobus_register()
166 mdio->phy_mask = ~0; in __of_mdiobus_register()
168 device_set_node(&mdio->dev, of_fwnode_handle(np)); in __of_mdiobus_register()
171 mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; in __of_mdiobus_register()
172 of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); in __of_mdiobus_register()
173 mdio->reset_post_delay_us = 0; in __of_mdiobus_register()
174 of_property_read_u32(np, "reset-post-delay-us", &mdio->reset_post_delay_us); in __of_mdiobus_register()
176 /* Register the MDIO bus */ in __of_mdiobus_register()
177 rc = __mdiobus_register(mdio, owner); in __of_mdiobus_register()
183 addr = of_mdio_parse_addr(&mdio->dev, child); in __of_mdiobus_register()
190 rc = of_mdiobus_register_phy(mdio, child, addr); in __of_mdiobus_register()
192 rc = of_mdiobus_register_device(mdio, child, addr); in __of_mdiobus_register()
195 dev_err(&mdio->dev, in __of_mdiobus_register()
196 "MDIO device at address %d is missing.\n", in __of_mdiobus_register()
213 if (mdiobus_is_registered_device(mdio, addr)) in __of_mdiobus_register()
217 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n", in __of_mdiobus_register()
225 rc = of_mdiobus_register_phy(mdio, child, addr); in __of_mdiobus_register()
238 mdiobus_unregister(mdio); in __of_mdiobus_register()
298 put_device(&phy->mdio.dev); in of_phy_connect()
442 put_device(&phydev->mdio.dev); /* of_phy_find_device() */ in of_phy_deregister_fixed_link()