[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230407160508.20479-3-clamor95@gmail.com>
Date: Fri, 7 Apr 2023 19:05:08 +0300
From: Svyatoslav Ryhel <clamor95@...il.com>
To: Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <jdelvare@...e.com>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Svyatoslav Ryhel <clamor95@...il.com>
Cc: linux-hwmon@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [PATCH v2 2/2] 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@...il.com>
---
drivers/hwmon/ina2xx.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hwmon/ina2xx.c b/drivers/hwmon/ina2xx.c
index 00fc70305a89..fd50d9785ccb 100644
--- a/drivers/hwmon/ina2xx.c
+++ b/drivers/hwmon/ina2xx.c
@@ -656,6 +656,10 @@ static int ina2xx_probe(struct i2c_client *client)
return PTR_ERR(data->regmap);
}
+ ret = devm_regulator_get_enable(dev, "vs");
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to enable vs regulator\n");
+
ret = ina2xx_init(data);
if (ret < 0) {
dev_err(dev, "error configuring the device: %d\n", ret);
--
2.37.2
Powered by blists - more mailing lists