Skip to contentSkip to conversation

Add power supply for INA2XX

PATCH Applied Svyatoslav Ryhel 3 participants 7 messages Apr 7, 2023 – Apr 12, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover Add power supply for INA2XX

TI ina2xx hwmon has vs power supply, add one for correct work.

Svyatoslav Ryhel (2):
dt-bindings: hwmon: ina2xx: add supply property
hwmon: ina2xx: add optional regulator support

 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
 drivers/hwmon/ina2xx.c                                 | 4 ++++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.37.2
#1 lore raw

PATCH v2 1/2 dt-bindings: hwmon: ina2xx: add supply property

Add vs-supply property.

---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml +5 -0
index 47af97bb4ced..8648877d2d01 100644
@@ -57,6 +57,10 @@ properties:
     $ref: /schemas/types.yaml#/definitions/uint32
     enum: [1, 2, 4, 8]
 
+  vs-supply:
+    description: phandle to the regulator that provides the VS supply typically
+      in range from 2.7 V to 5.5 V.
+
 required:
   - compatible
   - reg
@@ -73,5 +77,6 @@ examples:
             compatible = "ti,ina220";
             reg = <0x44>;
             shunt-resistor = <1000>;
+            vs-supply = <&vdd_3v0>;
         };
     };
Signature · 1 line
2.37.2
#4 lore raw

PATCH v2 2/2 hwmon: ina2xx: add optional regulator support

In reply to Svyatoslav Ryhel

TI ina2xx sensors according to datasheets have dedicated vs supplies. Add it for proper work.

---
 drivers/hwmon/ina2xx.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/hwmon/ina2xx.c +4 -0
index 00fc70305a89..fd50d9785ccb 100644
@@ -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);
Signature · 1 line
2.37.2
maintainer Applied
#5 lore raw

Re: [PATCH v2 2/2] hwmon: ina2xx: add optional regulator support

Quoted 4 lines · Svyatoslav Ryhel

TI ina2xx sensors according to datasheets have dedicated vs supplies. Add it for proper work.

Applied to hwmon-next.

Thanks,
Guenter

maintainer
#6 lore raw
In reply to Svyatoslav Ryhel
Quoted 6 lines · Svyatoslav Ryhel

TI ina2xx hwmon has vs power supply, add one for correct work.

Svyatoslav Ryhel (2):
dt-bindings: hwmon: ina2xx: add supply property
hwmon: ina2xx: add optional regulator support

Change log missing.

Guenter

Quoted 7 lines
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
 drivers/hwmon/ina2xx.c                                 | 4 ++++
 2 files changed, 9 insertions(+)
Signature · 1 line
2.37.2