mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
hwmon: (emc1403) Add regulator support
Add support for VDD power supply for this sensor. It is required on some devices for the sensor to start up and work properly. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20260731113007.145322-4-clamor95@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
parent
799bea4b95
commit
aa85c60479
|
|
@ -18,6 +18,7 @@
|
|||
#include <linux/err.h>
|
||||
#include <linux/sysfs.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/util_macros.h>
|
||||
|
||||
#define THERMAL_PID_REG 0xfd
|
||||
|
|
@ -659,6 +660,12 @@ static int emc1403_probe(struct i2c_client *client)
|
|||
{
|
||||
struct thermal_data *data;
|
||||
struct device *hwmon_dev;
|
||||
int ret;
|
||||
|
||||
ret = devm_regulator_get_enable(&client->dev, "vdd");
|
||||
if (ret)
|
||||
return dev_err_probe(&client->dev, ret,
|
||||
"Failed to enable regulator\n");
|
||||
|
||||
data = devm_kzalloc(&client->dev, sizeof(struct thermal_data),
|
||||
GFP_KERNEL);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user