Lines Matching defs:phy
20 #include <linux/phy.h>
28 /* Extract the clause 22 phy ID from the compatible string of the form
29 * ethernet-phy-idAAAA.BBBB */
37 if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) {
63 int of_mdiobus_phy_device_register(struct mii_bus *mdio, struct phy_device *phy,
73 phy->irq = rc;
76 phy->irq = mdio->irq[addr];
83 &phy->mdio.reset_assert_delay);
85 &phy->mdio.reset_deassert_delay);
90 phy->mdio.dev.of_node = child;
91 phy->mdio.dev.fwnode = of_fwnode_handle(child);
93 /* All data is now stored in the phy struct;
95 rc = phy_device_register(phy);
101 dev_dbg(&mdio->dev, "registered phy %pOFn at address %i\n",
111 struct phy_device *phy;
121 "ethernet-phy-ieee802.3-c45");
124 phy = phy_device_create(mdio, addr, phy_id, 0, NULL);
126 phy = get_phy_device(mdio, addr, is_c45);
127 if (IS_ERR(phy)) {
130 return PTR_ERR(phy);
133 rc = of_mdiobus_phy_device_register(mdio, phy, child, addr);
137 phy_device_free(phy);
141 /* phy->mii_ts may already be defined by the PHY driver. A
146 phy->mii_ts = mii_ts;
203 * Return true if the child node is for a phy. It must either:
204 * o Compatible string of "ethernet-phy-idX.X"
205 * o Compatible string of "ethernet-phy-ieee802.3-c45"
206 * o Compatible string of "ethernet-phy-ieee802.3-c22"
210 * A device which is not a phy is expected to have a compatible string
220 if (of_device_is_compatible(child, "ethernet-phy-ieee802.3-c45"))
223 if (of_device_is_compatible(child, "ethernet-phy-ieee802.3-c22"))
281 /* Loop over the child nodes and register a phy_device for each phy */
317 dev_info(&mdio->dev, "scan phy %pOFn at address %i\n",
368 * @phy_np: Pointer to the phy's device tree node
391 * of_phy_connect - Connect to the phy described in the device tree
392 * @dev: pointer to net_device claiming the phy
407 struct phy_device *phy = of_phy_find_device(phy_np);
410 if (!phy)
413 phy->dev_flags |= flags;
415 ret = phy_connect_direct(dev, phy, hndlr, iface);
418 put_device(&phy->mdio.dev);
420 return ret ? NULL : phy;
426 * - Get phy node and connect to the phy described in the device tree
427 * @dev: pointer to net_device claiming the phy
428 * @np: Pointer to device tree node for the net_device claiming the phy
441 struct phy_device *phy;
455 phy_np = of_parse_phandle(np, "phy-handle", 0);
460 phy = of_phy_connect(dev, phy_np, hndlr, 0, iface);
464 return phy;
470 * @dev: pointer to net_device claiming the phy
483 struct phy_device *phy = of_phy_find_device(phy_np);
486 if (!phy)
489 ret = phy_attach_direct(dev, phy, flags, iface);
492 put_device(&phy->mdio.dev);
494 return ret ? NULL : phy;