Lines Matching full:mdio
2 * OF helpers for the MDIO (Ethernet PHY) API
47 static int of_mdiobus_register_phy(struct mii_bus *mdio, in of_mdiobus_register_phy() argument
59 phy = phy_device_create(mdio, addr, phy_id, 0, NULL); in of_mdiobus_register_phy()
61 phy = get_phy_device(mdio, addr, is_c45); in of_mdiobus_register_phy()
72 mdio->irq[addr] = rc; in of_mdiobus_register_phy()
74 phy->irq = mdio->irq[addr]; in of_mdiobus_register_phy()
78 mdio->phy_ignore_ta_mask |= 1 << addr; in of_mdiobus_register_phy()
81 &phy->mdio.reset_assert_delay); in of_mdiobus_register_phy()
83 &phy->mdio.reset_deassert_delay); in of_mdiobus_register_phy()
88 phy->mdio.dev.of_node = child; in of_mdiobus_register_phy()
89 phy->mdio.dev.fwnode = of_fwnode_handle(child); in of_mdiobus_register_phy()
100 dev_dbg(&mdio->dev, "registered phy %pOFn at address %i\n", in of_mdiobus_register_phy()
105 static int of_mdiobus_register_device(struct mii_bus *mdio, in of_mdiobus_register_device() argument
111 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
130 dev_dbg(&mdio->dev, "registered mdio device %pOFn at address %i\n", in of_mdiobus_register_device()
138 * to have a compatible string, so they can be matched to an MDIO
195 * @mdio: pointer to mii_bus structure
196 * @np: pointer to device_node of MDIO bus.
201 int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) in of_mdiobus_register() argument
208 return mdiobus_register(mdio); in of_mdiobus_register()
216 mdio->phy_mask = ~0; in of_mdiobus_register()
218 mdio->dev.of_node = np; in of_mdiobus_register()
219 mdio->dev.fwnode = of_fwnode_handle(np); in of_mdiobus_register()
222 mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; in of_mdiobus_register()
223 of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); in of_mdiobus_register()
225 /* Register the MDIO bus */ in of_mdiobus_register()
226 rc = mdiobus_register(mdio); in of_mdiobus_register()
232 addr = of_mdio_parse_addr(&mdio->dev, child); in of_mdiobus_register()
239 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
241 rc = of_mdiobus_register_device(mdio, child, addr); in of_mdiobus_register()
244 dev_err(&mdio->dev, in of_mdiobus_register()
245 "MDIO device at address %d is missing.\n", in of_mdiobus_register()
262 if (mdiobus_is_registered_device(mdio, addr)) in of_mdiobus_register()
266 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n", in of_mdiobus_register()
274 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
286 mdiobus_unregister(mdio); in of_mdiobus_register()
352 put_device(&phy->mdio.dev); in of_phy_connect()
426 put_device(&phy->mdio.dev); in of_phy_attach()
532 put_device(&phydev->mdio.dev); /* of_phy_find_device() */ in of_phy_deregister_fixed_link()