From: Asdlerto Korry 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. Signed-off-by: Asdlerto Korry --- 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 #include #include +#include #include @@ -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