Lines Matching refs:phydev
199 struct phy_device *phydev) in of_mdiobus_link_phydev() argument
201 struct device *dev = &phydev->dev; in of_mdiobus_link_phydev()
225 if (addr == phydev->addr) { in of_mdiobus_link_phydev()
233 struct phy_device *phydev) in of_mdiobus_link_phydev() argument
281 struct phy_device *phydev; in __mdiobus_register() local
283 phydev = mdiobus_scan(bus, i); in __mdiobus_register()
284 if (IS_ERR(phydev)) { in __mdiobus_register()
285 err = PTR_ERR(phydev); in __mdiobus_register()
297 struct phy_device *phydev = bus->phy_map[i]; in __mdiobus_register() local
298 if (phydev) { in __mdiobus_register()
299 phy_device_remove(phydev); in __mdiobus_register()
300 phy_device_free(phydev); in __mdiobus_register()
316 struct phy_device *phydev = bus->phy_map[i]; in mdiobus_unregister() local
317 if (phydev) { in mdiobus_unregister()
318 phy_device_remove(phydev); in mdiobus_unregister()
319 phy_device_free(phydev); in mdiobus_unregister()
351 struct phy_device *phydev; in mdiobus_scan() local
354 phydev = get_phy_device(bus, addr, false); in mdiobus_scan()
355 if (IS_ERR(phydev) || phydev == NULL) in mdiobus_scan()
356 return phydev; in mdiobus_scan()
362 of_mdiobus_link_phydev(bus, phydev); in mdiobus_scan()
364 err = phy_device_register(phydev); in mdiobus_scan()
366 phy_device_free(phydev); in mdiobus_scan()
370 return phydev; in mdiobus_scan()
488 struct phy_device *phydev = to_phy_device(dev); in mdio_bus_match() local
490 const int num_ids = ARRAY_SIZE(phydev->c45_ids.device_ids); in mdio_bus_match()
497 return phydrv->match_phy_device(phydev); in mdio_bus_match()
499 if (phydev->is_c45) { in mdio_bus_match()
501 if (!(phydev->c45_ids.devices_in_package & (1 << i))) in mdio_bus_match()
505 (phydev->c45_ids.device_ids[i] & in mdio_bus_match()
512 (phydev->phy_id & phydrv->phy_id_mask); in mdio_bus_match()
518 static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) in mdio_bus_phy_may_suspend() argument
520 struct device_driver *drv = phydev->dev.driver; in mdio_bus_phy_may_suspend()
522 struct net_device *netdev = phydev->attached_dev; in mdio_bus_phy_may_suspend()
533 return !phydev->suspended; in mdio_bus_phy_may_suspend()
553 struct phy_device *phydev = to_phy_device(dev); in mdio_bus_suspend() local
560 if (phydev->attached_dev && phydev->adjust_link) in mdio_bus_suspend()
561 phy_stop_machine(phydev); in mdio_bus_suspend()
563 if (!mdio_bus_phy_may_suspend(phydev)) in mdio_bus_suspend()
566 return phy_suspend(phydev); in mdio_bus_suspend()
571 struct phy_device *phydev = to_phy_device(dev); in mdio_bus_resume() local
574 if (!mdio_bus_phy_may_suspend(phydev)) in mdio_bus_resume()
577 ret = phy_resume(phydev); in mdio_bus_resume()
582 if (phydev->attached_dev && phydev->adjust_link) in mdio_bus_resume()
583 phy_start_machine(phydev); in mdio_bus_resume()
590 struct phy_device *phydev = to_phy_device(dev); in mdio_bus_restore() local
591 struct net_device *netdev = phydev->attached_dev; in mdio_bus_restore()
597 ret = phy_init_hw(phydev); in mdio_bus_restore()
602 phydev->link = 0; in mdio_bus_restore()
603 phydev->state = PHY_UP; in mdio_bus_restore()
605 phy_start_machine(phydev); in mdio_bus_restore()
629 struct phy_device *phydev = to_phy_device(dev); in phy_id_show() local
631 return sprintf(buf, "0x%.8lx\n", (unsigned long)phydev->phy_id); in phy_id_show()
638 struct phy_device *phydev = to_phy_device(dev); in phy_interface_show() local
641 if (phy_is_internal(phydev)) in phy_interface_show()
644 mode = phy_modes(phydev->interface); in phy_interface_show()
653 struct phy_device *phydev = to_phy_device(dev); in phy_has_fixups_show() local
655 return sprintf(buf, "%d\n", phydev->has_fixups); in phy_has_fixups_show()