9
0
Fork 0

net: fec_imx: Add devicetree support for mdio bus

The fec has a mdio bus. This adds support for a subnode
in which the phys on this bus can be specified.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2014-05-21 11:58:50 +02:00
parent 1607f679da
commit 0955253ce1
1 changed files with 5 additions and 0 deletions

View File

@ -621,6 +621,7 @@ static int fec_alloc_receive_packets(struct fec_priv *fec, int count, int size)
#ifdef CONFIG_OFDEVICE
static int fec_probe_dt(struct device_d *dev, struct fec_priv *fec)
{
struct device_node *mdiobus;
int ret;
ret = of_get_phy_mode(dev->device_node);
@ -629,6 +630,10 @@ static int fec_probe_dt(struct device_d *dev, struct fec_priv *fec)
else
fec->interface = ret;
mdiobus = of_get_child_by_name(dev->device_node, "mdio");
if (mdiobus)
fec->miibus.dev.device_node = mdiobus;
return 0;
}
#else