mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-02-17 17:10:26 -05:00
hwmon: (tmp108) Add basic regulator support
TMP108/P3T1085 are powered by the V+/VCC regulator, add support for it. Signed-off-by: Stanislav Jakubek <stano.jakubek@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
committed by
Guenter Roeck
parent
fd8caceaae
commit
bddbb9cff4
@@ -17,6 +17,7 @@
|
||||
#include <linux/init.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#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;
|
||||
|
||||
Reference in New Issue
Block a user