[PATCH net-next v3 2/2] nfc: s3fwrn5: i2c: Enable the pvdd supply
From: Asdlerto Korry via B4 Relay
Date: Thu Nov 12 2026 - 12:50:59 EST
From: Asdlerto Korry <korryasdlerto@xxxxxxxxx>
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@xxxxxxxxxxxxxxxx>
Signed-off-by: Asdlerto Korry <korryasdlerto@xxxxxxxxx>
---
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