mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] net: phy: fixed-link: read link parameters from devicetree
@ 2016-08-08 11:02 Lucas Stach
  2016-08-08 11:17 ` Antony Pavlov
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas Stach @ 2016-08-08 11:02 UTC (permalink / raw)
  To: barebox

Implement the missing reading of the fixed link parameters from
the devicetree properties.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/net/phy/phy.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 13b832470926..fc39c5d8c750 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -309,11 +309,14 @@ static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
 
 	phydev->dev.parent = &edev->dev;
 	phydev->registered = 1;
-	phydev->speed = 1000;
-	phydev->duplex = 1;
-	phydev->pause = phydev->asym_pause = 0;
 	phydev->link = 1;
 
+	if (of_property_read_u32(np, "speed", &phydev->speed))
+		return NULL;
+	phydev->duplex = of_property_read_bool(np,"full-duplex");
+	phydev->pause = of_property_read_bool(np, "pause");
+	phydev->asym_pause = of_property_read_bool(np, "asym-pause");
+
 	return phydev;
 }
 
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net: phy: fixed-link: read link parameters from devicetree
  2016-08-08 11:02 [PATCH] net: phy: fixed-link: read link parameters from devicetree Lucas Stach
@ 2016-08-08 11:17 ` Antony Pavlov
  0 siblings, 0 replies; 3+ messages in thread
From: Antony Pavlov @ 2016-08-08 11:17 UTC (permalink / raw)
  To: Lucas Stach; +Cc: barebox

On Mon,  8 Aug 2016 13:02:57 +0200
Lucas Stach <l.stach@pengutronix.de> wrote:

> Implement the missing reading of the fixed link parameters from
> the devicetree properties.
> 
> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
> ---
>  drivers/net/phy/phy.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index 13b832470926..fc39c5d8c750 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -309,11 +309,14 @@ static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
>  
>  	phydev->dev.parent = &edev->dev;
>  	phydev->registered = 1;
> -	phydev->speed = 1000;
> -	phydev->duplex = 1;
> -	phydev->pause = phydev->asym_pause = 0;
>  	phydev->link = 1;
>  
> +	if (of_property_read_u32(np, "speed", &phydev->speed))
> +		return NULL;
> +	phydev->duplex = of_property_read_bool(np,"full-duplex");
                                                ^^^^
                                                  please fix coding style here.
> +	phydev->pause = of_property_read_bool(np, "pause");
> +	phydev->asym_pause = of_property_read_bool(np, "asym-pause");
> +
>  	return phydev;
>  }
>  
> -- 
> 2.8.1
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox


-- 
-- 
Best regards,
  Antony Pavlov

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] net: phy: fixed-link: read link parameters from devicetree
@ 2018-02-06  7:54 Sascha Hauer
  0 siblings, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2018-02-06  7:54 UTC (permalink / raw)
  To: Barebox List

From: Lucas Stach <l.stach@pengutronix.de>

Implement the missing reading of the fixed link parameters from
the devicetree properties.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 drivers/net/phy/phy.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 2b8fa63c06..42dcad9069 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -309,8 +309,13 @@ static struct phy_device *of_phy_register_fixed_link(struct device_node *np,
 
 	phydev->dev.parent = &edev->dev;
 	phydev->registered = 1;
-	phydev->speed = 1000;
-	phydev->duplex = 1;
+	phydev->link = 1;
+
+	if (of_property_read_u32(np, "speed", &phydev->speed))
+		return NULL;
+	phydev->duplex = of_property_read_bool(np,"full-duplex");
+	phydev->pause = of_property_read_bool(np, "pause");
+	phydev->asym_pause = of_property_read_bool(np, "asym-pause");
 
 	return phydev;
 }
-- 
2.15.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-06  7:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-08 11:02 [PATCH] net: phy: fixed-link: read link parameters from devicetree Lucas Stach
2016-08-08 11:17 ` Antony Pavlov
2018-02-06  7:54 Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox