* [PATCH v4 0/3] Driver for TI INA238 I2C Power Monitor
@ 2021-11-02 5:27 Nathan Rossi
2021-11-02 5:27 ` [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
2021-11-02 5:27 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
0 siblings, 2 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-11-02 5:27 UTC (permalink / raw)
To: linux-hwmon, devicetree, linux-kernel, linux-doc
Cc: Nathan Rossi, Nathan Rossi, Guenter Roeck, Jean Delvare,
Rob Herring, Jonathan Corbet
From: Nathan Rossi <nathan.rossi@digi.com>
Changes in v2:
- Added device tree binding for ti,shunt-gain to specify the target
ADCRANGE for the ina238
- Reworked ina238 driver to use hwmon_chip_info API, and addressed
various review comments
Changes in v3:
- Fix schema error for ti,shunt-gain binding
- Address review comments
Changes in v4:
- Change ina238_data.gain type to int
Nathan Rossi (3):
dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
hwmon: Driver for Texas Instruments INA238
.../devicetree/bindings/hwmon/ti,ina2xx.yaml | 22 +
Documentation/hwmon/ina238.rst | 56 ++
Documentation/hwmon/index.rst | 1 +
drivers/hwmon/Kconfig | 12 +
drivers/hwmon/Makefile | 1 +
drivers/hwmon/ina238.c | 644 ++++++++++++++++++
6 files changed, 736 insertions(+)
create mode 100644 Documentation/hwmon/ina238.rst
create mode 100644 drivers/hwmon/ina238.c
---
2.33.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
2021-11-02 5:27 [PATCH v4 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
@ 2021-11-02 5:27 ` Nathan Rossi
2021-11-02 17:36 ` Rob Herring
2021-11-09 20:32 ` Guenter Roeck
2021-11-02 5:27 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
1 sibling, 2 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-11-02 5:27 UTC (permalink / raw)
To: linux-hwmon, devicetree, linux-kernel
Cc: Nathan Rossi, Nathan Rossi, Guenter Roeck, Jean Delvare,
Rob Herring
From: Nathan Rossi <nathan.rossi@digi.com>
Add a property to the binding to define the selected shunt voltage gain.
This specifies the range and accuracy that applies to the shunt circuit.
This property only applies to devices that have a selectable shunt
voltage range via PGA or ADCRANGE register configuration.
Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
---
Changes in v2:
- Added binding for shunt-gain
Changes in v3:
- Fix schema error, setting $ref to uint32
- Improve the description to detail exactly how to define the property
and how the property affects initial device configuration and
calculation of values
---
.../devicetree/bindings/hwmon/ti,ina2xx.yaml | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 180573f26c..47af97bb4c 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -36,6 +36,27 @@ properties:
Shunt resistor value in micro-Ohm.
$ref: /schemas/types.yaml#/definitions/uint32
+ ti,shunt-gain:
+ description: |
+ Programmable gain divisor for the shunt voltage accuracy and range. This
+ property only applies to devices that have configurable PGA/ADCRANGE. The
+ gain value is used configure the gain and to convert the shunt voltage,
+ current and power register values when reading measurements from the
+ device.
+
+ For devices that have a configurable PGA (e.g. INA209, INA219, INA220),
+ the gain value maps directly with the PG bits of the config register.
+
+ For devices that have ADCRANGE configuration (e.g. INA238) a shunt-gain
+ value of 1 maps to ADCRANGE=1 where no gain divisor is applied to the
+ shunt voltage, and a value of 4 maps to ADCRANGE=0 such that a wider
+ voltage range is used.
+
+ The default value is device dependent, and is defined by the reset value
+ of PGA/ADCRANGE in the respective configuration registers.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [1, 2, 4, 8]
+
required:
- compatible
- reg
---
2.33.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
2021-11-02 5:27 ` [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
@ 2021-11-02 17:36 ` Rob Herring
2021-11-09 20:32 ` Guenter Roeck
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2021-11-02 17:36 UTC (permalink / raw)
To: Nathan Rossi
Cc: Guenter Roeck, devicetree, Nathan Rossi, linux-hwmon, Rob Herring,
linux-kernel, Jean Delvare
On Tue, 02 Nov 2021 05:27:54 +0000, Nathan Rossi wrote:
> From: Nathan Rossi <nathan.rossi@digi.com>
>
> Add a property to the binding to define the selected shunt voltage gain.
> This specifies the range and accuracy that applies to the shunt circuit.
> This property only applies to devices that have a selectable shunt
> voltage range via PGA or ADCRANGE register configuration.
>
> Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
> ---
> Changes in v2:
> - Added binding for shunt-gain
>
> Changes in v3:
> - Fix schema error, setting $ref to uint32
> - Improve the description to detail exactly how to define the property
> and how the property affects initial device configuration and
> calculation of values
> ---
> .../devicetree/bindings/hwmon/ti,ina2xx.yaml | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
2021-11-02 5:27 ` [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
2021-11-02 17:36 ` Rob Herring
@ 2021-11-09 20:32 ` Guenter Roeck
1 sibling, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2021-11-09 20:32 UTC (permalink / raw)
To: Nathan Rossi
Cc: linux-hwmon, devicetree, linux-kernel, Nathan Rossi, Jean Delvare,
Rob Herring
On Tue, Nov 02, 2021 at 05:27:54AM +0000, Nathan Rossi wrote:
> From: Nathan Rossi <nathan.rossi@digi.com>
>
> Add a property to the binding to define the selected shunt voltage gain.
> This specifies the range and accuracy that applies to the shunt circuit.
> This property only applies to devices that have a selectable shunt
> voltage range via PGA or ADCRANGE register configuration.
>
> Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> Changes in v2:
> - Added binding for shunt-gain
>
> Changes in v3:
> - Fix schema error, setting $ref to uint32
> - Improve the description to detail exactly how to define the property
> and how the property affects initial device configuration and
> calculation of values
> ---
> .../devicetree/bindings/hwmon/ti,ina2xx.yaml | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> ---
> 2.33.0
>
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> index 180573f26c..47af97bb4c 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> @@ -36,6 +36,27 @@ properties:
> Shunt resistor value in micro-Ohm.
> $ref: /schemas/types.yaml#/definitions/uint32
>
> + ti,shunt-gain:
> + description: |
> + Programmable gain divisor for the shunt voltage accuracy and range. This
> + property only applies to devices that have configurable PGA/ADCRANGE. The
> + gain value is used configure the gain and to convert the shunt voltage,
> + current and power register values when reading measurements from the
> + device.
> +
> + For devices that have a configurable PGA (e.g. INA209, INA219, INA220),
> + the gain value maps directly with the PG bits of the config register.
> +
> + For devices that have ADCRANGE configuration (e.g. INA238) a shunt-gain
> + value of 1 maps to ADCRANGE=1 where no gain divisor is applied to the
> + shunt voltage, and a value of 4 maps to ADCRANGE=0 such that a wider
> + voltage range is used.
> +
> + The default value is device dependent, and is defined by the reset value
> + of PGA/ADCRANGE in the respective configuration registers.
> + $ref: /schemas/types.yaml#/definitions/uint32
> + enum: [1, 2, 4, 8]
> +
> required:
> - compatible
> - reg
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
2021-11-02 5:27 [PATCH v4 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
2021-11-02 5:27 ` [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
@ 2021-11-02 5:27 ` Nathan Rossi
2021-11-02 17:37 ` Rob Herring
2021-11-09 20:31 ` Guenter Roeck
1 sibling, 2 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-11-02 5:27 UTC (permalink / raw)
To: linux-hwmon, devicetree, linux-kernel
Cc: Nathan Rossi, Nathan Rossi, Guenter Roeck, Jean Delvare,
Rob Herring
From: Nathan Rossi <nathan.rossi@digi.com>
Document the compatible string for the Texas Instruments INA238, this
device is a variant of the existing INA2xx devices and has the same
device tree bindings (shunt resistor).
Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
---
Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 6f0443322a..180573f26c 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -26,6 +26,7 @@ properties:
- ti,ina226
- ti,ina230
- ti,ina231
+ - ti,ina238
reg:
maxItems: 1
---
2.33.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
2021-11-02 5:27 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
@ 2021-11-02 17:37 ` Rob Herring
2021-11-09 20:31 ` Guenter Roeck
1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring @ 2021-11-02 17:37 UTC (permalink / raw)
To: Nathan Rossi
Cc: linux-hwmon, devicetree, linux-kernel, Guenter Roeck,
Nathan Rossi, Jean Delvare, Rob Herring
On Tue, 02 Nov 2021 05:27:54 +0000, Nathan Rossi wrote:
> From: Nathan Rossi <nathan.rossi@digi.com>
>
> Document the compatible string for the Texas Instruments INA238, this
> device is a variant of the existing INA2xx devices and has the same
> device tree bindings (shunt resistor).
>
> Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
> ---
> Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
2021-11-02 5:27 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
2021-11-02 17:37 ` Rob Herring
@ 2021-11-09 20:31 ` Guenter Roeck
1 sibling, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2021-11-09 20:31 UTC (permalink / raw)
To: Nathan Rossi
Cc: linux-hwmon, devicetree, linux-kernel, Nathan Rossi, Jean Delvare,
Rob Herring
On Tue, Nov 02, 2021 at 05:27:54AM +0000, Nathan Rossi wrote:
> From: Nathan Rossi <nathan.rossi@digi.com>
>
> Document the compatible string for the Texas Instruments INA238, this
> device is a variant of the existing INA2xx devices and has the same
> device tree bindings (shunt resistor).
>
> Signed-off-by: Nathan Rossi <nathan.rossi@digi.com>
> Acked-by: Rob Herring <robh@kernel.org>
Applied to hwmon-next.
Thanks,
Guenter
> ---
> Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 1 +
> 1 file changed, 1 insertion(+)
>
> ---
> 2.33.0
>
> diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> index 6f0443322a..180573f26c 100644
> --- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> +++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
> @@ -26,6 +26,7 @@ properties:
> - ti,ina226
> - ti,ina230
> - ti,ina231
> + - ti,ina238
>
> reg:
> maxItems: 1
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2021-11-09 20:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-02 5:27 [PATCH v4 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
2021-11-02 5:27 ` [PATCH v4 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
2021-11-02 17:36 ` Rob Herring
2021-11-09 20:32 ` Guenter Roeck
2021-11-02 5:27 ` [PATCH v4 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
2021-11-02 17:37 ` Rob Herring
2021-11-09 20:31 ` Guenter Roeck
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).