]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: adp5585: Support getting vdd regulator
authorNuno Sá <nuno.sa@analog.com>
Tue, 1 Jul 2025 14:32:13 +0000 (15:32 +0100)
committerLee Jones <lee@kernel.org>
Tue, 1 Jul 2025 20:50:51 +0000 (21:50 +0100)
Make sure we get and enable the VDD supply (if available).

Reviewed-by: Lee Jones <lee@kernel.org>
Signed-off-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20250701-dev-adp5589-fw-v7-18-b1fcfe9e9826@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/adp5585.c

index 8f0fd737442611e00e61ea992dd6437dbaf31292..11a26f668653439378f9eb31d053c45772a940d0 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
 #include <linux/types.h>
 
 enum {
@@ -709,6 +710,10 @@ static int adp5585_i2c_probe(struct i2c_client *i2c)
        if (IS_ERR(regmap_config))
                return PTR_ERR(regmap_config);
 
+       ret = devm_regulator_get_enable(&i2c->dev, "vdd");
+       if (ret)
+               return ret;
+
        adp5585->regmap = devm_regmap_init_i2c(i2c, regmap_config);
        if (IS_ERR(adp5585->regmap))
                return dev_err_probe(&i2c->dev, PTR_ERR(adp5585->regmap),