aboutsummaryrefslogtreecommitdiff
path: root/include/miiphy.h
diff options
context:
space:
mode:
authorAlex Marginean <alexandru.marginean@nxp.com>2019-07-12 10:13:50 +0300
committerJoe Hershberger <joe.hershberger@ni.com>2019-07-18 16:37:13 -0500
commit8880edba06d5deb52ebca7c3eb1bbdcdcc8ec2b6 (patch)
tree2a43309592555ec6fe3b5b3a3a0ed3237dd00e95 /include/miiphy.h
parentc38ac2893cc8f56365ab1084b2c5b06fc31dd697 (diff)
downloadu-boot-8880edba06d5deb52ebca7c3eb1bbdcdcc8ec2b6.zip
u-boot-8880edba06d5deb52ebca7c3eb1bbdcdcc8ec2b6.tar.gz
u-boot-8880edba06d5deb52ebca7c3eb1bbdcdcc8ec2b6.tar.bz2
net: add MDIO_MUX DM class
Adds a class for MDIO MUXes, which control access to a series of downstream child MDIOs. MDIO MUX drivers are required to implement a select function used to switch between child buses. MUX children are registered as MDIO buses and they can be used just like regular MDIOs. Signed-off-by: Alex Marginean <alexm.osslist@gmail.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'include/miiphy.h')
-rw-r--r--include/miiphy.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/miiphy.h b/include/miiphy.h
index e6dd441..9b97d09 100644
--- a/include/miiphy.h
+++ b/include/miiphy.h
@@ -167,4 +167,24 @@ struct phy_device *dm_mdio_phy_connect(struct udevice *dev, int addr,
#endif
+#ifdef CONFIG_DM_MDIO_MUX
+
+/* indicates none of the child buses is selected */
+#define MDIO_MUX_SELECT_NONE -1
+
+/**
+ * struct mdio_mux_ops - MDIO MUX operations
+ *
+ * @select: Selects a child bus
+ * @deselect: Clean up selection. Optional, can be NULL
+ */
+struct mdio_mux_ops {
+ int (*select)(struct udevice *mux, int cur, int sel);
+ int (*deselect)(struct udevice *mux, int sel);
+};
+
+#define mdio_mux_get_ops(dev) ((struct mdio_mux_ops *)(dev)->driver->ops)
+
+#endif
+
#endif