Lines Matching full:mdio
3 * OF helpers for the MDIO (Ethernet PHY) API
45 static int of_mdiobus_register_phy(struct mii_bus *mdio, in of_mdiobus_register_phy() argument
57 phy = phy_device_create(mdio, addr, phy_id, 0, NULL); in of_mdiobus_register_phy()
59 phy = get_phy_device(mdio, addr, is_c45); in of_mdiobus_register_phy()
70 mdio->irq[addr] = rc; in of_mdiobus_register_phy()
72 phy->irq = mdio->irq[addr]; in of_mdiobus_register_phy()
76 mdio->phy_ignore_ta_mask |= 1 << addr; in of_mdiobus_register_phy()
79 &phy->mdio.reset_assert_delay); in of_mdiobus_register_phy()
81 &phy->mdio.reset_deassert_delay); in of_mdiobus_register_phy()
86 phy->mdio.dev.of_node = child; in of_mdiobus_register_phy()
87 phy->mdio.dev.fwnode = of_fwnode_handle(child); in of_mdiobus_register_phy()
98 dev_dbg(&mdio->dev, "registered phy %pOFn at address %i\n", in of_mdiobus_register_phy()
103 static int of_mdiobus_register_device(struct mii_bus *mdio, in of_mdiobus_register_device() argument
109 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
128 dev_dbg(&mdio->dev, "registered mdio device %pOFn at address %i\n", in of_mdiobus_register_device()
136 * to have a compatible string, so they can be matched to an MDIO
193 * @mdio: pointer to mii_bus structure
194 * @np: pointer to device_node of MDIO bus.
199 int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) in of_mdiobus_register() argument
206 return mdiobus_register(mdio); in of_mdiobus_register()
214 mdio->phy_mask = ~0; in of_mdiobus_register()
216 mdio->dev.of_node = np; in of_mdiobus_register()
217 mdio->dev.fwnode = of_fwnode_handle(np); in of_mdiobus_register()
220 mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; in of_mdiobus_register()
221 of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); in of_mdiobus_register()
223 /* Register the MDIO bus */ in of_mdiobus_register()
224 rc = mdiobus_register(mdio); in of_mdiobus_register()
230 addr = of_mdio_parse_addr(&mdio->dev, child); in of_mdiobus_register()
237 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
239 rc = of_mdiobus_register_device(mdio, child, addr); in of_mdiobus_register()
242 dev_err(&mdio->dev, in of_mdiobus_register()
243 "MDIO device at address %d is missing.\n", in of_mdiobus_register()
260 if (mdiobus_is_registered_device(mdio, addr)) in of_mdiobus_register()
264 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n", in of_mdiobus_register()
268 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
278 mdiobus_unregister(mdio); in of_mdiobus_register()
338 put_device(&phy->mdio.dev); in of_phy_connect()
412 put_device(&phy->mdio.dev); in of_phy_attach()
512 put_device(&phydev->mdio.dev); /* of_phy_find_device() */ in of_phy_deregister_fixed_link()