From bddbb9cff4ab97ad367692201a0abe680a59d44d Mon Sep 17 00:00:00 2001 From: Stanislav Jakubek Date: Tue, 26 Nov 2024 09:40:35 +0100 Subject: [PATCH] hwmon: (tmp108) Add basic regulator support TMP108/P3T1085 are powered by the V+/VCC regulator, add support for it. Signed-off-by: Stanislav Jakubek Signed-off-by: Guenter Roeck --- drivers/hwmon/tmp108.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/hwmon/tmp108.c b/drivers/hwmon/tmp108.c index fbe673009126..cd631e481d80 100644 --- a/drivers/hwmon/tmp108.c +++ b/drivers/hwmon/tmp108.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #define DRIVER_NAME "tmp108" @@ -331,6 +332,10 @@ static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char * u32 config; int err; + err = devm_regulator_get_enable(dev, "vcc"); + if (err) + return dev_err_probe(dev, err, "Failed to enable regulator\n"); + tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL); if (!tmp108) return -ENOMEM; -- 2.50.1