public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Romain Gantois <romain.gantois@bootlin.com>
To: Russell King <linux@armlinux.org.uk>,
	 Andrew Lunn <andrew+netdev@lunn.ch>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,  Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	 Conor Dooley <conor+dt@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
	 Heiner Kallweit <hkallweit1@gmail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	 Mark Brown <broonie@kernel.org>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	 Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	netdev@vger.kernel.org,  devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Romain Gantois <romain.gantois@bootlin.com>
Subject: [PATCH net-next 2/2] net: sfp: manage receiver and transmitter regulators
Date: Tue, 03 Mar 2026 14:54:27 +0100	[thread overview]
Message-ID: <20260303-sfp-regulators-v1-2-7101ae34cb84@bootlin.com> (raw)
In-Reply-To: <20260303-sfp-regulators-v1-0-7101ae34cb84@bootlin.com>

If phandles to receiver and/or transmitter regulators for an SFP device are
found, enable them at probe time.

Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
---
 drivers/net/phy/sfp.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index f4bf53da3d4fd..602c166f60ddf 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -12,6 +12,7 @@
 #include <linux/of.h>
 #include <linux/phy.h>
 #include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
 #include <linux/rtnetlink.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
@@ -3095,6 +3096,14 @@ static int sfp_probe(struct platform_device *pdev)
 	struct sfp *sfp;
 	int err, i;
 
+	err = devm_regulator_get_enable_optional(&pdev->dev, "vccr");
+	if (err && err != -ENODEV)
+		return err;
+
+	err = devm_regulator_get_enable_optional(&pdev->dev, "vcct");
+	if (err && err != -ENODEV)
+		return err;
+
 	sfp = sfp_alloc(&pdev->dev);
 	if (IS_ERR(sfp))
 		return PTR_ERR(sfp);

-- 
2.52.0


  parent reply	other threads:[~2026-03-03 13:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 13:54 [PATCH net-next 0/2] net: sfp: Describe and handle regulators Romain Gantois
2026-03-03 13:54 ` [PATCH net-next 1/2] dt-bindings: net: sff,sfp: Describe power supply pins Romain Gantois
2026-03-03 18:37   ` Conor Dooley
2026-03-03 13:54 ` Romain Gantois [this message]
2026-03-03 14:22   ` [PATCH net-next 2/2] net: sfp: manage receiver and transmitter regulators Mark Brown
2026-03-03 14:40     ` Romain Gantois
2026-03-03 15:12       ` Russell King (Oracle)
2026-03-03 15:12     ` Russell King (Oracle)
2026-03-03 15:14       ` Mark Brown
2026-03-03 15:25         ` Russell King (Oracle)
2026-03-03 17:31           ` Mark Brown
2026-03-03 18:32             ` Russell King (Oracle)
2026-03-06 19:20               ` Mark Brown
2026-03-20  9:39                 ` Romain Gantois
2026-03-20 14:45                   ` Russell King (Oracle)
2026-03-25  9:40                     ` Romain Gantois
2026-03-20  9:55                 ` Romain Gantois
2026-03-04 21:38             ` Andrew Lunn
2026-03-06 16:19               ` Mark Brown
2026-03-03 15:10 ` [PATCH net-next 0/2] net: sfp: Describe and handle regulators Russell King (Oracle)
2026-03-03 15:54   ` Romain Gantois
2026-03-03 17:19     ` Russell King (Oracle)
2026-03-04 21:44     ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260303-sfp-regulators-v1-2-7101ae34cb84@bootlin.com \
    --to=romain.gantois@bootlin.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=andrew@lunn.ch \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=maxime.chevallier@bootlin.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=robh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox