devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Driver for TI INA238 I2C Power Monitor
@ 2021-10-25  2:58 Nathan Rossi
  2021-10-25  2:58 ` [PATCH 1/2] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
  2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
  0 siblings, 2 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-10-25  2:58 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>


Nathan Rossi (2):
  dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
  hwmon: Driver for Texas Instruments INA238

 .../devicetree/bindings/hwmon/ti,ina2xx.yaml  |   1 +
 Documentation/hwmon/ina238.rst                |  57 +++
 drivers/hwmon/Kconfig                         |  12 +
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/ina238.c                        | 453 ++++++++++++++++++
 5 files changed, 524 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 1/2] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
  2021-10-25  2:58 [PATCH 0/2] Driver for TI INA238 I2C Power Monitor Nathan Rossi
@ 2021-10-25  2:58 ` Nathan Rossi
  2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
  1 sibling, 0 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-10-25  2:58 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

* [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor
  2021-10-25  2:58 [PATCH 0/2] Driver for TI INA238 I2C Power Monitor Nathan Rossi
  2021-10-25  2:58 ` [PATCH 1/2] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
@ 2021-10-27  7:42 ` Nathan Rossi
  2021-10-27  7:42   ` [PATCH v2 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
                     ` (2 more replies)
  1 sibling, 3 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-10-27  7:42 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

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  |   7 +
 Documentation/hwmon/ina238.rst                |  56 ++
 Documentation/hwmon/index.rst                 |   1 +
 drivers/hwmon/Kconfig                         |  12 +
 drivers/hwmon/Makefile                        |   1 +
 drivers/hwmon/ina238.c                        | 672 ++++++++++++++++++
 6 files changed, 749 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 v2 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string
  2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
@ 2021-10-27  7:42   ` Nathan Rossi
  2021-10-27  7:42   ` [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
  2021-10-27 15:57   ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Guenter Roeck
  2 siblings, 0 replies; 7+ messages in thread
From: Nathan Rossi @ 2021-10-27  7:42 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

* [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
  2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
  2021-10-27  7:42   ` [PATCH v2 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
@ 2021-10-27  7:42   ` Nathan Rossi
  2021-10-27 14:12     ` Rob Herring
  2021-10-27 15:57   ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Guenter Roeck
  2 siblings, 1 reply; 7+ messages in thread
From: Nathan Rossi @ 2021-10-27  7:42 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
---
 Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
index 180573f26c..6a70e2fe9d 100644
--- a/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
+++ b/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
@@ -36,6 +36,12 @@ 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.
+    enum: [1, 2, 4, 8]
+
 required:
   - compatible
   - reg
---
2.33.0

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property
  2021-10-27  7:42   ` [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
@ 2021-10-27 14:12     ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2021-10-27 14:12 UTC (permalink / raw)
  To: Nathan Rossi
  Cc: Nathan Rossi, Jean Delvare, Rob Herring, Guenter Roeck,
	devicetree, linux-hwmon, linux-kernel

On Wed, 27 Oct 2021 07:42:12 +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
> ---
>  Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml | 6 ++++++
>  1 file changed, 6 insertions(+)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml: properties:ti,shunt-gain: 'oneOf' conditional failed, one must be fixed:
	'type' is a required property
		hint: A vendor boolean property can use "type: boolean"
	Additional properties are not allowed ('enum' was unexpected)
		hint: A vendor boolean property can use "type: boolean"
	/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml: properties:ti,shunt-gain: 'oneOf' conditional failed, one must be fixed:
		'$ref' is a required property
		'allOf' is a required property
		hint: A vendor property needs a $ref to types.yaml
		from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
	1 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	2 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	4 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	8 is not of type 'string'
		hint: A vendor string property with exact values has an implicit type
	hint: Vendor specific properties must have a type and description unless they have a defined, common suffix.
	from schema $id: http://devicetree.org/meta-schemas/vendor-props.yaml#
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml: ignoring, error in schema: properties: ti,shunt-gain
warning: no schema found in file: ./Documentation/devicetree/bindings/hwmon/ti,ina2xx.yaml
Documentation/devicetree/bindings/hwmon/ti,ina2xx.example.dt.yaml:0:0: /example-0/i2c/power-sensor@44: failed to match any schema with compatible: ['ti,ina220']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1546789

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor
  2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
  2021-10-27  7:42   ` [PATCH v2 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
  2021-10-27  7:42   ` [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
@ 2021-10-27 15:57   ` Guenter Roeck
  2 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2021-10-27 15:57 UTC (permalink / raw)
  To: Nathan Rossi, linux-hwmon, devicetree, linux-kernel, linux-doc
  Cc: Nathan Rossi, Jean Delvare, Rob Herring, Jonathan Corbet

On 10/27/21 12:42 AM, Nathan Rossi wrote:
> 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
> 
> 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  |   7 +
>   Documentation/hwmon/ina238.rst                |  56 ++
>   Documentation/hwmon/index.rst                 |   1 +
>   drivers/hwmon/Kconfig                         |  12 +
>   drivers/hwmon/Makefile                        |   1 +
>   drivers/hwmon/ina238.c                        | 672 ++++++++++++++++++
>   6 files changed, 749 insertions(+)
>   create mode 100644 Documentation/hwmon/ina238.rst
>   create mode 100644 drivers/hwmon/ina238.c
> ---
> 2.33.0
> 
General comment: Please never send a patch series as reply to a previous one.

Guenter

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-27 15:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-25  2:58 [PATCH 0/2] Driver for TI INA238 I2C Power Monitor Nathan Rossi
2021-10-25  2:58 ` [PATCH 1/2] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
2021-10-27  7:42 ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor Nathan Rossi
2021-10-27  7:42   ` [PATCH v2 1/3] dt-bindings: hwmon: ti,ina2xx: Document ti,ina238 compatible string Nathan Rossi
2021-10-27  7:42   ` [PATCH v2 2/3] dt-bindings: hwmon: ti,ina2xx: Add ti,shunt-gain property Nathan Rossi
2021-10-27 14:12     ` Rob Herring
2021-10-27 15:57   ` [PATCH v2 0/3] Driver for TI INA238 I2C Power Monitor 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).