summaryrefslogtreecommitdiff
path: root/include/dm/ofnode.h
diff options
context:
space:
mode:
authorMichal Simek <[email protected]>2022-02-23 15:45:40 +0100
committerMichal Simek <[email protected]>2022-03-09 12:43:16 +0100
commitdb681d4929cac3f5d0a8ce638e7e5306fe6038d2 (patch)
tree099f3103642de45f71a4098bdbadfbafbc5ee696 /include/dm/ofnode.h
parentd24b3e32ab7f89c0b411747203d7f103f475cfbf (diff)
net: phy: Add new read ethernet phy id function
Add new function to get ethernet phy id from compatible property of the mdio phy node. Signed-off-by: Michal Simek <[email protected]> Signed-off-by: T Karthik Reddy <[email protected]> Link: https://lore.kernel.org/r/16019efb3820a50330935fdaae191cec1f101b5c.1645627539.git.michal.simek@xilinx.com
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r--include/dm/ofnode.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h
index 0cb324c8b0c..744dffe0a2d 100644
--- a/include/dm/ofnode.h
+++ b/include/dm/ofnode.h
@@ -895,6 +895,19 @@ int ofnode_read_pci_addr(ofnode node, enum fdt_pci_space type,
int ofnode_read_pci_vendev(ofnode node, u16 *vendor, u16 *device);
/**
+ * ofnode_read_eth_phy_id() - look up eth phy vendor and device id
+ *
+ * Look at the compatible property of a device node that represents a eth phy
+ * device and extract phy vendor id and device id from it.
+ *
+ * @param node node to examine
+ * @param vendor vendor id of the eth phy device
+ * @param device device id of the eth phy device
+ * @return 0 if ok, negative on error
+ */
+int ofnode_read_eth_phy_id(ofnode node, u16 *vendor, u16 *device);
+
+/**
* ofnode_read_addr_cells() - Get the number of address cells for a node
*
* This walks back up the tree to find the closest #address-cells property