mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/2] nfc: s3fwrn5: Add optional pvdd-supply
@ 2026-11-12 17:25 Asdlerto Korry via B4 Relay
  2026-11-12 17:25 ` [PATCH net-next v3 1/2] dt-bindings: net: nfc: samsung,s3fwrn5: Add pvdd-supply Asdlerto Korry via B4 Relay
  2026-11-12 17:25 ` [PATCH net-next v3 2/2] nfc: s3fwrn5: i2c: Enable the pvdd supply Asdlerto Korry via B4 Relay
  0 siblings, 2 replies; 3+ messages in thread
From: Asdlerto Korry via B4 Relay @ 2026-11-12 17:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski, David Heidelberg, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Conor Dooley
  Cc: oe-linux-nfc, netdev, devicetree, linux-kernel,
	Krzysztof Kozlowski, Asdlerto Korry

The Samsung S3FWRN5 NFC chip has a PVDD supply pin. On the Samsung
Galaxy M52 5G (sm7325) it is fed by a PMIC regulator that is not
always-on, so the driver has to enable it. These two patches add the
optional supply to the binding and make the driver enable it before the
enable GPIO is driven.

They were part of the series "arm64: dts: qcom: Add Samsung Galaxy M52
5G" (v2). As suggested by Krzysztof, they are split out and resent for
net-next. The DTS patches stay in the Qualcomm series; the DTS node uses
pvdd-supply only after this binding is merged.

Changes since v2 (as part of the DTS series):
 - sent as a separate series with the net-next prefix
 - no code changes, Reviewed-by from Krzysztof kept

---
Asdlerto Korry (2):
      dt-bindings: net: nfc: samsung,s3fwrn5: Add pvdd-supply
      nfc: s3fwrn5: i2c: Enable the pvdd supply

 Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml | 5 +++++
 drivers/nfc/s3fwrn5/i2c.c                                      | 7 +++++++
 2 files changed, 12 insertions(+)
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
change-id: 20261112-m52xq-nfc-netdev-709568b66d1d

Best regards,
-- 
Asdlerto Korry <korryasdlerto@gmail.com>



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

* [PATCH net-next v3 1/2] dt-bindings: net: nfc: samsung,s3fwrn5: Add pvdd-supply
  2026-11-12 17:25 [PATCH net-next v3 0/2] nfc: s3fwrn5: Add optional pvdd-supply Asdlerto Korry via B4 Relay
@ 2026-11-12 17:25 ` Asdlerto Korry via B4 Relay
  2026-11-12 17:25 ` [PATCH net-next v3 2/2] nfc: s3fwrn5: i2c: Enable the pvdd supply Asdlerto Korry via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Asdlerto Korry via B4 Relay @ 2026-11-12 17:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski, David Heidelberg, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Conor Dooley
  Cc: oe-linux-nfc, netdev, devicetree, linux-kernel,
	Krzysztof Kozlowski, Asdlerto Korry

From: Asdlerto Korry <korryasdlerto@gmail.com>

The PVDD pin of the S3FWRN5 has to be powered before the chip is
enabled. On some boards, like the Samsung Galaxy M52 5G, this supply
is switched by a SoC GPIO. Document it, so that the regulator can be
handed to the driver instead of being kept always on.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Asdlerto Korry <korryasdlerto@gmail.com>
---
 Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml b/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
index 12baee45752c..3c5a579a7108 100644
--- a/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
+++ b/Documentation/devicetree/bindings/net/nfc/samsung,s3fwrn5.yaml
@@ -34,6 +34,10 @@ properties:
     description:
       Output GPIO pin used to enter firmware mode and sleep/wakeup control
 
+  pvdd-supply:
+    description:
+      Power supply of the PVDD pin
+
   s3fwrn5,en-gpios:
     maxItems: 1
     deprecated: true
@@ -84,6 +88,7 @@ examples:
             wake-gpios = <&gpj0 2 GPIO_ACTIVE_HIGH>;
 
             clocks = <&rpmcc 20>;
+            pvdd-supply = <&nfc_pvdd>;
         };
     };
   # UART example on Raspberry Pi

-- 
2.25.1



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

* [PATCH net-next v3 2/2] nfc: s3fwrn5: i2c: Enable the pvdd supply
  2026-11-12 17:25 [PATCH net-next v3 0/2] nfc: s3fwrn5: Add optional pvdd-supply Asdlerto Korry via B4 Relay
  2026-11-12 17:25 ` [PATCH net-next v3 1/2] dt-bindings: net: nfc: samsung,s3fwrn5: Add pvdd-supply Asdlerto Korry via B4 Relay
@ 2026-11-12 17:25 ` Asdlerto Korry via B4 Relay
  1 sibling, 0 replies; 3+ messages in thread
From: Asdlerto Korry via B4 Relay @ 2026-11-12 17:25 UTC (permalink / raw)
  To: Krzysztof Kozlowski, David Heidelberg, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Rob Herring, Conor Dooley
  Cc: oe-linux-nfc, netdev, devicetree, linux-kernel,
	Krzysztof Kozlowski, Asdlerto Korry

From: Asdlerto Korry <korryasdlerto@gmail.com>

Get and enable the optional PVDD supply before the enable GPIO is
driven. Boards that switch this supply from the SoC no longer have to
mark the regulator always-on.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Asdlerto Korry <korryasdlerto@gmail.com>
---
 drivers/nfc/s3fwrn5/i2c.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c
index 4ba762611711..eaa9a1f75533 100644
--- a/drivers/nfc/s3fwrn5/i2c.c
+++ b/drivers/nfc/s3fwrn5/i2c.c
@@ -11,6 +11,7 @@
 #include <linux/gpio/consumer.h>
 #include <linux/delay.h>
 #include <linux/module.h>
+#include <linux/regulator/consumer.h>
 
 #include <net/nfc/nfc.h>
 
@@ -160,6 +161,12 @@ static int s3fwrn5_i2c_probe(struct i2c_client *client)
 	phy->i2c_dev = client;
 	i2c_set_clientdata(client, phy);
 
+	/* The chip has to be powered before EN is driven */
+	ret = devm_regulator_get_enable_optional(&client->dev, "pvdd");
+	if (ret && ret != -ENODEV)
+		return dev_err_probe(&client->dev, ret,
+				     "failed to enable pvdd supply\n");
+
 	phy->common.gpio_en = devm_gpiod_get(&client->dev, "en", GPIOD_OUT_HIGH);
 	if (IS_ERR(phy->common.gpio_en))
 		return PTR_ERR(phy->common.gpio_en);

-- 
2.25.1



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

end of thread, other threads:[~2026-11-12 17:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 17:25 [PATCH net-next v3 0/2] nfc: s3fwrn5: Add optional pvdd-supply Asdlerto Korry via B4 Relay
2026-11-12 17:25 ` [PATCH net-next v3 1/2] dt-bindings: net: nfc: samsung,s3fwrn5: Add pvdd-supply Asdlerto Korry via B4 Relay
2026-11-12 17:25 ` [PATCH net-next v3 2/2] nfc: s3fwrn5: i2c: Enable the pvdd supply Asdlerto Korry via B4 Relay

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

all inboxes | Powered by JetHome®