Lines Matching full:mdio

3  * OF helpers for the MDIO (Ethernet PHY) API
63 int of_mdiobus_phy_device_register(struct mii_bus *mdio, struct phy_device *phy, in of_mdiobus_phy_device_register() argument
74 mdio->irq[addr] = rc; in of_mdiobus_phy_device_register()
76 phy->irq = mdio->irq[addr]; in of_mdiobus_phy_device_register()
80 mdio->phy_ignore_ta_mask |= 1 << addr; in of_mdiobus_phy_device_register()
83 &phy->mdio.reset_assert_delay); in of_mdiobus_phy_device_register()
85 &phy->mdio.reset_deassert_delay); in of_mdiobus_phy_device_register()
90 phy->mdio.dev.of_node = child; in of_mdiobus_phy_device_register()
91 phy->mdio.dev.fwnode = of_fwnode_handle(child); in of_mdiobus_phy_device_register()
101 dev_dbg(&mdio->dev, "registered phy %pOFn at address %i\n", in of_mdiobus_phy_device_register()
107 static int of_mdiobus_register_phy(struct mii_bus *mdio, in of_mdiobus_register_phy() argument
124 phy = phy_device_create(mdio, addr, phy_id, 0, NULL); in of_mdiobus_register_phy()
126 phy = get_phy_device(mdio, addr, is_c45); in of_mdiobus_register_phy()
133 rc = of_mdiobus_phy_device_register(mdio, phy, child, addr); in of_mdiobus_register_phy()
151 static int of_mdiobus_register_device(struct mii_bus *mdio, in of_mdiobus_register_device() argument
157 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
176 dev_dbg(&mdio->dev, "registered mdio device %pOFn at address %i\n", in of_mdiobus_register_device()
184 * to have a compatible string, so they can be matched to an MDIO
242 * @mdio: pointer to mii_bus structure
243 * @np: pointer to device_node of MDIO bus.
248 int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) in of_mdiobus_register() argument
255 return mdiobus_register(mdio); in of_mdiobus_register()
263 mdio->phy_mask = ~0; in of_mdiobus_register()
265 mdio->dev.of_node = np; in of_mdiobus_register()
266 mdio->dev.fwnode = of_fwnode_handle(np); in of_mdiobus_register()
269 mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; in of_mdiobus_register()
270 of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); in of_mdiobus_register()
271 mdio->reset_post_delay_us = 0; in of_mdiobus_register()
272 of_property_read_u32(np, "reset-post-delay-us", &mdio->reset_post_delay_us); in of_mdiobus_register()
274 /* Register the MDIO bus */ in of_mdiobus_register()
275 rc = mdiobus_register(mdio); in of_mdiobus_register()
281 addr = of_mdio_parse_addr(&mdio->dev, child); in of_mdiobus_register()
288 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
290 rc = of_mdiobus_register_device(mdio, child, addr); in of_mdiobus_register()
293 dev_err(&mdio->dev, in of_mdiobus_register()
294 "MDIO device at address %d is missing.\n", in of_mdiobus_register()
311 if (mdiobus_is_registered_device(mdio, addr)) in of_mdiobus_register()
315 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n", in of_mdiobus_register()
323 rc = of_mdiobus_register_phy(mdio, child, addr); in of_mdiobus_register()
335 mdiobus_unregister(mdio); in of_mdiobus_register()
415 put_device(&phy->mdio.dev); in of_phy_connect()
489 put_device(&phy->mdio.dev); in of_phy_attach()
589 put_device(&phydev->mdio.dev); /* of_phy_find_device() */ in of_phy_deregister_fixed_link()