Skip to content

Commit ad20248

Browse files
clamor-sgroeck
authored andcommitted
hwmon: ina2xx: add optional regulator support
TI ina2xx sensors according to datasheets have dedicated vs supplies. Add it for proper work. Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com> Link: https://lore.kernel.org/r/20230407160508.20479-3-clamor95@gmail.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 4173a5b commit ad20248

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/hwmon/ina2xx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,10 @@ static int ina2xx_probe(struct i2c_client *client)
656656
return PTR_ERR(data->regmap);
657657
}
658658

659+
ret = devm_regulator_get_enable(dev, "vs");
660+
if (ret)
661+
return dev_err_probe(dev, ret, "failed to enable vs regulator\n");
662+
659663
ret = ina2xx_init(data);
660664
if (ret < 0) {
661665
dev_err(dev, "error configuring the device: %d\n", ret);

0 commit comments

Comments
 (0)