Skip to content

Commit bddbb9c

Browse files
Stanislav Jakubekgroeck
authored andcommitted
hwmon: (tmp108) Add basic regulator support
TMP108/P3T1085 are powered by the V+/VCC regulator, add support for it. Signed-off-by: Stanislav Jakubek <[email protected]> Signed-off-by: Guenter Roeck <[email protected]>
1 parent fd8cace commit bddbb9c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/hwmon/tmp108.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/init.h>
1818
#include <linux/jiffies.h>
1919
#include <linux/regmap.h>
20+
#include <linux/regulator/consumer.h>
2021
#include <linux/slab.h>
2122

2223
#define DRIVER_NAME "tmp108"
@@ -331,6 +332,10 @@ static int tmp108_common_probe(struct device *dev, struct regmap *regmap, char *
331332
u32 config;
332333
int err;
333334

335+
err = devm_regulator_get_enable(dev, "vcc");
336+
if (err)
337+
return dev_err_probe(dev, err, "Failed to enable regulator\n");
338+
334339
tmp108 = devm_kzalloc(dev, sizeof(*tmp108), GFP_KERNEL);
335340
if (!tmp108)
336341
return -ENOMEM;

0 commit comments

Comments
 (0)