hwmon: (max31827) handle vref regulator
authorAntoniu Miclaus <antoniu.miclaus@analog.com>
Mon, 25 Sep 2023 12:29:28 +0000 (15:29 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 28 Oct 2023 16:21:53 +0000 (09:21 -0700)
Add missing implementation for the max31827 supply regulator.
This is a hardware required property that is not handled.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Link: https://lore.kernel.org/r/20230925122929.10610-1-antoniu.miclaus@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/max31827.c

index 614bbf5d25fa45b41ff77f9fe6167902df442c3b..fd1fed1a797cd4ed2ae14b98dc09088cde292e4b 100644 (file)
@@ -412,6 +412,10 @@ static int max31827_probe(struct i2c_client *client)
                return dev_err_probe(dev, PTR_ERR(st->regmap),
                                     "Failed to allocate regmap.\n");
 
+       err = devm_regulator_get_enable(dev, "vref");
+       if (err)
+               return dev_err_probe(dev, err, "failed to enable regulator\n");
+
        err = max31827_init_client(st);
        if (err)
                return err;