From: Svyatoslav Ryhel <clamor95@gmail.com>
To: Guenter Roeck <linux@roeck-us.net>,
Jean Delvare <jdelvare@suse.com>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Svyatoslav Ryhel <clamor95@gmail.com>
Cc: linux-hwmon@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/2] hwmon: ina2xx: add optional regulator support
Date: Fri, 7 Apr 2023 19:05:08 +0300 [thread overview]
Message-ID: <20230407160508.20479-3-clamor95@gmail.com> (raw)
In-Reply-To: <20230407160508.20479-1-clamor95@gmail.com>
TI ina2xx sensors according to datasheets have dedicated
vs supplies. Add it for proper work.
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.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
next prev parent reply other threads:[~2023-04-07 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 16:05 [PATCH v2 0/2] Add power supply for INA2XX Svyatoslav Ryhel
2023-04-07 16:05 ` [PATCH v2 1/2] dt-bindings: hwmon: ina2xx: add supply property Svyatoslav Ryhel
2023-04-12 15:00 ` Rob Herring
2023-04-12 15:18 ` Guenter Roeck
2023-04-07 16:05 ` Svyatoslav Ryhel [this message]
2023-04-12 15:19 ` [PATCH v2 2/2] hwmon: ina2xx: add optional regulator support Guenter Roeck
2023-04-07 16:22 ` [PATCH v2 0/2] Add power supply for INA2XX Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230407160508.20479-3-clamor95@gmail.com \
--to=clamor95@gmail.com \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).