diff mbox

[2/2] net: stmmac: add fixed_phy support via fixed-link DT binding

Message ID 1421999305-19267-3-git-send-email-ming.lei@canonical.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ming Lei Jan. 23, 2015, 7:48 a.m. UTC
Signed-off-by: Ming Lei <ming.lei@canonical.com>
---
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Ming Lei Jan. 23, 2015, 8:28 a.m. UTC | #1
On 1/23/15, Ming Lei <ming.lei@canonical.com> wrote:
> Signed-off-by: Ming Lei <ming.lei@canonical.com>
> ---
>  .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 3039de2..73a3ced 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -27,6 +27,7 @@
>  #include <linux/of.h>
>  #include <linux/of_net.h>
>  #include <linux/of_device.h>
> +#include <linux/of_mdio.h>
>
>  #include "stmmac.h"
>  #include "stmmac_platform.h"
> @@ -216,6 +217,15 @@ static int stmmac_probe_config_dt(struct
> platform_device *pdev,
>  		plat->pmt = 1;
>  	}
>
> +	if (of_phy_is_fixed_link(np)) {
> +		int ret = of_phy_register_fixed_link(np);
> +		if (ret) {
> +			dev_err(&pdev->dev, "failed to register fixed PHY\n");
> +			return ret;
> +		}
> +		plat->phy_bus_name = "fixed";
> +	}
> +
>  	if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
>  		of_device_is_compatible(np, "snps,dwmac-3.710")) {
>  		plat->enh_desc = 1;

Sorry, bypassing check on phy id is missed in this patch, and will
submit v1 later.

Thanks,
Ming Lei
diff mbox

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 3039de2..73a3ced 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -27,6 +27,7 @@ 
 #include <linux/of.h>
 #include <linux/of_net.h>
 #include <linux/of_device.h>
+#include <linux/of_mdio.h>
 
 #include "stmmac.h"
 #include "stmmac_platform.h"
@@ -216,6 +217,15 @@  static int stmmac_probe_config_dt(struct platform_device *pdev,
 		plat->pmt = 1;
 	}
 
+	if (of_phy_is_fixed_link(np)) {
+		int ret = of_phy_register_fixed_link(np);
+		if (ret) {
+			dev_err(&pdev->dev, "failed to register fixed PHY\n");
+			return ret;
+		}
+		plat->phy_bus_name = "fixed";
+	}
+
 	if (of_device_is_compatible(np, "snps,dwmac-3.610") ||
 		of_device_is_compatible(np, "snps,dwmac-3.710")) {
 		plat->enh_desc = 1;