9
0
Fork 0

net:designware: allow to pass the phy interface

If none set use NA (0) as before.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Jean-Christophe PLAGNIOL-VILLARD 2012-10-14 16:25:01 +02:00 committed by Sascha Hauer
parent 840d4858d0
commit 052a701207
2 changed files with 6 additions and 1 deletions

View File

@ -53,6 +53,7 @@ struct dw_eth_dev {
struct eth_mac_regs *mac_regs_p;
struct eth_dma_regs *dma_regs_p;
int phy_addr;
phy_interface_t interface;
};
/* Speed specific definitions */
@ -262,7 +263,7 @@ static int dwc_ether_open(struct eth_device *dev)
int ret;
ret = phy_device_connect(dev, &priv->miibus, priv->phy_addr,
dwc_update_linkspeed, 0, PHY_INTERFACE_MODE_NA);
dwc_update_linkspeed, 0, priv->interface);
if (ret)
return ret;
@ -433,6 +434,7 @@ static int dwc_ether_probe(struct device_d *dev)
edev->set_ethaddr = dwc_ether_set_ethaddr;
priv->phy_addr = pdata->phy_addr;
priv->interface = pdata->interface;
miibus->read = dwc_ether_mii_read;
miibus->write = dwc_ether_mii_write;
miibus->priv = priv;

View File

@ -1,8 +1,11 @@
#ifndef __DWC_UNIMAC_H
#define __DWC_UNIMAC_H
#include <linux/phy.h>
struct dwc_ether_platform_data {
int phy_addr;
phy_interface_t interface;
void (*fix_mac_speed)(int speed);
};