Lines Matching full:mdio

3  * OF helpers for the MDIO (Ethernet PHY) API
28 MODULE_DESCRIPTION("OpenFirmware MDIO bus (Ethernet PHY) accessors");
37 int of_mdiobus_phy_device_register(struct mii_bus *mdio, struct phy_device *phy, in of_mdiobus_phy_device_register() argument
40 return fwnode_mdiobus_phy_device_register(mdio, phy, in of_mdiobus_phy_device_register()
46 static int of_mdiobus_register_phy(struct mii_bus *mdio, in of_mdiobus_register_phy() argument
49 return fwnode_mdiobus_register_phy(mdio, of_fwnode_handle(child), addr); in of_mdiobus_register_phy()
52 static int of_mdiobus_register_device(struct mii_bus *mdio, in of_mdiobus_register_device() argument
59 mdiodev = mdio_device_create(mdio, addr); in of_mdiobus_register_device()
78 dev_dbg(&mdio->dev, "registered mdio device %pOFn at address %i\n", in of_mdiobus_register_device()
86 * to have a compatible string, so they can be matched to an MDIO
142 static int __of_mdiobus_parse_phys(struct mii_bus *mdio, struct device_node *np, in __of_mdiobus_parse_phys() argument
155 rc = __of_mdiobus_parse_phys(mdio, child, NULL); in __of_mdiobus_parse_phys()
162 addr = of_mdio_parse_addr(&mdio->dev, child); in __of_mdiobus_parse_phys()
171 rc = of_mdiobus_register_phy(mdio, child, addr); in __of_mdiobus_parse_phys()
173 rc = of_mdiobus_register_device(mdio, child, addr); in __of_mdiobus_parse_phys()
176 dev_err(&mdio->dev, in __of_mdiobus_parse_phys()
177 "MDIO device at address %d is missing.\n", in __of_mdiobus_parse_phys()
191 * @mdio: pointer to mii_bus structure
192 * @np: pointer to device_node of MDIO bus.
193 * @owner: module owning the @mdio object.
198 int __of_mdiobus_register(struct mii_bus *mdio, struct device_node *np, in __of_mdiobus_register() argument
206 return __mdiobus_register(mdio, owner); in __of_mdiobus_register()
214 mdio->phy_mask = ~0; in __of_mdiobus_register()
216 device_set_node(&mdio->dev, of_fwnode_handle(np)); in __of_mdiobus_register()
219 mdio->reset_delay_us = DEFAULT_GPIO_RESET_DELAY; in __of_mdiobus_register()
220 of_property_read_u32(np, "reset-delay-us", &mdio->reset_delay_us); in __of_mdiobus_register()
221 mdio->reset_post_delay_us = 0; in __of_mdiobus_register()
222 of_property_read_u32(np, "reset-post-delay-us", &mdio->reset_post_delay_us); in __of_mdiobus_register()
224 /* Register the MDIO bus */ in __of_mdiobus_register()
225 rc = __mdiobus_register(mdio, owner); in __of_mdiobus_register()
230 rc = __of_mdiobus_parse_phys(mdio, np, &scanphys); in __of_mdiobus_register()
246 if (mdiobus_is_registered_device(mdio, addr)) in __of_mdiobus_register()
250 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n", in __of_mdiobus_register()
258 rc = of_mdiobus_register_phy(mdio, child, addr); in __of_mdiobus_register()
272 mdiobus_unregister(mdio); in __of_mdiobus_register()
332 put_device(&phy->mdio.dev); in of_phy_connect()
475 put_device(&phydev->mdio.dev); /* of_phy_find_device() */ in of_phy_deregister_fixed_link()