miiphy: Add function to retrieve MDIO bus list head
authorPankaj Bansal <pankaj.bansal@nxp.com>
Tue, 18 Sep 2018 10:16:48 +0000 (15:46 +0530)
committerJoe Hershberger <joe.hershberger@ni.com>
Wed, 24 Oct 2018 19:45:36 +0000 (14:45 -0500)
In upcoming freescale board LX2160AQDS, the MDIO bus is muxed.
i.e. same MDIO bus can be routed to eight different slots depending
on mux register settings.

To support this mdio mux behavior, we add each MDIO bus mux as a
separate MDIO bus.

Now, various phy devices can be attached to each of these slots(mux).
The information about these devices is passed to OS via device tree.

To do the fdt fixups related to MDIO bus, its necessary that MDIO bus
list is accessed.Therefore, add a function to retrieve the list head.

Signed-off-by: Pankaj Bansal <pankaj.bansal@nxp.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
common/miiphyutil.c
include/miiphy.h

index 8d89751122b4bbc20888d9a8fb5d3df2e53e0bff..2db067876e4b8f58263ddf2ceca8209f0f5e207d 100644 (file)
@@ -177,6 +177,11 @@ struct mii_dev *mdio_get_current_dev(void)
        return current_mii;
 }
 
+struct list_head *mdio_get_list_head(void)
+{
+       return &mii_devs;
+}
+
 struct phy_device *mdio_phydev_for_ethname(const char *ethname)
 {
        struct list_head *entry;
index 2da28e311a2b8edf55f43b9a542a64a4d68a1144..f11763affd0ae121c451bf7899669c8a209df893 100644 (file)
@@ -39,6 +39,7 @@ void miiphy_init(void);
 int miiphy_set_current_dev(const char *devname);
 const char *miiphy_get_current_dev(void);
 struct mii_dev *mdio_get_current_dev(void);
+struct list_head *mdio_get_list_head(void);
 struct mii_dev *miiphy_get_dev_by_name(const char *devname);
 struct phy_device *mdio_phydev_for_ethname(const char *devname);