diff mbox series

[v2,14/17] mfd: adp5585: support getting vdd regulator

Message ID 20250415-dev-adp5589-fw-v2-14-3a799c3ed812@analog.com
State New
Headers show
Series [v2,01/17] dt-bindings: mfd: adp5585: ease on the required properties | expand

Commit Message

Nuno Sá via B4 Relay April 15, 2025, 2:49 p.m. UTC
From: Nuno Sá <nuno.sa@analog.com>

Make sure we get and enable the VDD supply (if available).

Signed-off-by: Nuno Sá <nuno.sa@analog.com>
---
 drivers/mfd/adp5585.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mfd/adp5585.c b/drivers/mfd/adp5585.c
index c1d51d50dca6c9367d4a1b98a4f8bbec12dbf90b..667cc5bd0745f64eec60837ec3c00057af0cddeb 100644
--- a/drivers/mfd/adp5585.c
+++ b/drivers/mfd/adp5585.c
@@ -18,6 +18,7 @@ 
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
 static const struct mfd_cell adp5585_devs[] = {
@@ -849,6 +850,10 @@  static int adp5585_i2c_probe(struct i2c_client *i2c)
 	adp5585->dev = &i2c->dev;
 	adp5585->irq = i2c->irq;
 
+	ret = devm_regulator_get_enable(&i2c->dev, "vdd");
+	if (ret)
+		return ret;
+
 	adp5585->regmap = devm_regmap_init_i2c(i2c, info->regmap_config);
 	if (IS_ERR(adp5585->regmap))
 		return dev_err_probe(&i2c->dev, PTR_ERR(adp5585->regmap),