Thread (34 messages) 34 messages, 4 authors, 2025-06-27

Re: [PATCH net-next v6 04/14] net: phy: dp83822: Add support for phy_port representation

From: Kory Maincent <kory.maincent@bootlin.com>
Date: 2025-05-13 14:00:36
Also in: linux-arm-kernel, linux-arm-msm, linux-devicetree, lkml

On Wed,  7 May 2025 15:53:20 +0200
Maxime Chevallier [off-list ref] wrote:
With the phy_port representation intrduced, we can use .attach_port to
populate the port information based on either the straps or the
ti,fiber-mode property. This allows simplifying the probe function and
allow users to override the strapping configuration.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
...
  
+static int dp83822_attach_port(struct phy_device *phydev, struct phy_port
*port) +{
+	struct dp83822_private *dp83822 = phydev->priv;
+	int ret;
+
+	if (port->mediums) {
+		if (phy_port_is_fiber(port))
+			dp83822->fx_enabled = true;
+	} else {
+		ret = dp83822_read_straps(phydev);
+		if (ret)
+			return ret;
+
+#ifdef CONFIG_OF_MDIO
if IS_ENABLED(CONFIG_OF_MDIO) seems to be more used than ifdef

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help