2023-04-07 16:08:44

by Svyatoslav Ryhel

[permalink] [raw]
Subject: [PATCH v2 0/2] 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(+)

--
2.37.2


2023-04-07 16:09:20

by Svyatoslav Ryhel

[permalink] [raw]
Subject: [PATCH v2 1/2] dt-bindings: hwmon: ina2xx: add supply property

Add vs-supply property.

Signed-off-by: Svyatoslav Ryhel <[email protected]>
---
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 47af97bb4ced..8648877d2d01 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -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>;
};
};
--
2.37.2

2023-04-07 16:10:01

by Svyatoslav Ryhel

[permalink] [raw]
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 <[email protected]>
---
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

2023-04-07 16:25:23

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 0/2] Add power supply for INA2XX

On Fri, Apr 07, 2023 at 07:05:06PM +0300, Svyatoslav Ryhel wrote:
> 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

> Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
> drivers/hwmon/ina2xx.c | 4 ++++
> 2 files changed, 9 insertions(+)
>
> --
> 2.37.2
>

2023-04-12 15:02:51

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: ina2xx: add supply property


On Fri, 07 Apr 2023 19:05:07 +0300, Svyatoslav Ryhel wrote:
> Add vs-supply property.
>
> Signed-off-by: Svyatoslav Ryhel <[email protected]>
> ---
> Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 5 +++++
> 1 file changed, 5 insertions(+)
>

Acked-by: Rob Herring <[email protected]>

2023-04-12 15:19:37

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH v2 1/2] dt-bindings: hwmon: ina2xx: add supply property

On Fri, Apr 07, 2023 at 07:05:07PM +0300, Svyatoslav Ryhel wrote:
> Add vs-supply property.
>
> Signed-off-by: Svyatoslav Ryhel <[email protected]>
> Acked-by: Rob Herring <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

2023-04-12 15:19:57

by Guenter Roeck

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

On Fri, Apr 07, 2023 at 07:05:08PM +0300, Svyatoslav Ryhel wrote:
> TI ina2xx sensors according to datasheets have dedicated
> vs supplies. Add it for proper work.
>
> Signed-off-by: Svyatoslav Ryhel <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter