[PATCH 1/1] net:designware: allow to pass the phy interface

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Sun Oct 14 10:25:01 EDT 2012


If none set use NA (0) as before.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 drivers/net/designware.c |    4 +++-
 include/net/designware.h |    3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 1cbcd5a..bf71d15 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -55,6 +55,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 */
@@ -254,7 +255,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;
 
@@ -427,6 +428,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;
diff --git a/include/net/designware.h b/include/net/designware.h
index 1c8a00e..3f31c97 100644
--- a/include/net/designware.h
+++ b/include/net/designware.h
@@ -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);
 };
 
-- 
1.7.10.4




More information about the barebox mailing list