devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
       [not found] <20230801163546.3170-1-mail@carsten-spiess.de>
@ 2023-08-01 16:35 ` Carsten Spieß
  2023-08-01 20:52   ` Conor Dooley
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Spieß @ 2023-08-01 16:35 UTC (permalink / raw)
  To: Carsten Spieß, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm
  Cc: linux-hwmon, devicetree, linux-kernel, linux-renesas-soc

Add dt-bindings for Renesas ISL28022 power monitor.

Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
---
v3:
- changelog added
v2/v3:
- schema errors fixed
- properties reworked
- shunt-resistor minimum and default value added
---
 .../bindings/hwmon/renesas,isl28022.yaml      | 65 +++++++++++++++++++
 MAINTAINERS                                   |  1 +
 2 files changed, 66 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml

diff --git a/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml b/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
new file mode 100644
index 000000000000..1e0971287941
--- /dev/null
+++ b/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
@@ -0,0 +1,65 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/hwmon/renesas,isl28022.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas ISL28022 power monitor
+
+maintainers:
+  - Carsten Spieß <mail@carsten-spiess.de>
+
+description: |
+  The ISL28022 is a power monitor with I2C interface. The device monitors
+  voltage, current via shunt resistor and calculated power.
+
+  Datasheets:
+    https://www.renesas.com/us/en/www/doc/datasheet/isl28022.pdf
+
+properties:
+  compatible:
+    enum:
+      - renesas,isl28022
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    description: |
+      Shunt resistor value in micro-Ohm
+    minimum: 800
+    default: 10000
+
+  renesas,shunt-range-microvolt:
+    description: |
+      Maximal shunt voltage range of +/- 40 mV, 80 mV, 160 mV or 320 mV
+    default: 320000
+    enum: [40000, 80000, 160000, 320000]
+
+  renesas,average-samples:
+    description: |
+      Number of samples to be used to report voltage, current and power values.
+    default: 1
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [1, 2, 4, 8, 16, 32, 64, 128]
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        power-monitor@40 {
+            compatible = "renesas,isl28022";
+            reg = <0x40>;
+            shunt-resistor-micro-ohms = <8000>;
+            renesas,shunt-range-microvolt = <40000>;
+            renesas,average-samples = <128>;
+        };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index b02e3b991676..23b8e8183ece 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -11069,6 +11069,7 @@ ISL28022 HARDWARE MONITORING DRIVER
 M:	Carsten Spieß <mail@carsten-spiess.de>
 L:	linux-hwmon@vger.kernel.org
 S:	Maintained
+F:	Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
 F:	Documentation/hwmon/isl28022.rst
 F:	drivers/hwmon/isl28022.c
 
-- 
2.34.1


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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
  2023-08-01 16:35 ` [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022 Carsten Spieß
@ 2023-08-01 20:52   ` Conor Dooley
  2023-08-02  7:30     ` Carsten Spieß
  0 siblings, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2023-08-01 20:52 UTC (permalink / raw)
  To: Carsten Spieß
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, linux-hwmon,
	devicetree, linux-kernel, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 3441 bytes --]

On Tue, Aug 01, 2023 at 06:35:46PM +0200, Carsten Spieß wrote:
> Add dt-bindings for Renesas ISL28022 power monitor.
> 
> Signed-off-by: Carsten Spieß <mail@carsten-spiess.de>
> ---
> v3:
> - changelog added
> v2/v3:
> - schema errors fixed
> - properties reworked
> - shunt-resistor minimum and default value added
> ---
>  .../bindings/hwmon/renesas,isl28022.yaml      | 65 +++++++++++++++++++
>  MAINTAINERS                                   |  1 +
>  2 files changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
> 
> diff --git a/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml b/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
> new file mode 100644
> index 000000000000..1e0971287941
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
> @@ -0,0 +1,65 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/hwmon/renesas,isl28022.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas ISL28022 power monitor
> +
> +maintainers:
> +  - Carsten Spieß <mail@carsten-spiess.de>
> +
> +description: |
> +  The ISL28022 is a power monitor with I2C interface. The device monitors
> +  voltage, current via shunt resistor and calculated power.
> +
> +  Datasheets:
> +    https://www.renesas.com/us/en/www/doc/datasheet/isl28022.pdf
> +
> +properties:
> +  compatible:
> +    enum:
> +      - renesas,isl28022

You've only got one compatible, why the enum? Will there be more similar
devices that have an incompatible programming model?

> +
> +  reg:
> +    maxItems: 1
> +
> +  shunt-resistor-micro-ohms:
> +    description: |
> +      Shunt resistor value in micro-Ohm
> +    minimum: 800
> +    default: 10000
> +
> +  renesas,shunt-range-microvolt:
> +    description: |

You don't need these |s if you have no formatting to preserve in the
text.
Otherwise, this does look good to me.

Cheers,
Conor.

> +      Maximal shunt voltage range of +/- 40 mV, 80 mV, 160 mV or 320 mV
> +    default: 320000
> +    enum: [40000, 80000, 160000, 320000]
> +
> +  renesas,average-samples:
> +    description: |
> +      Number of samples to be used to report voltage, current and power values.
> +    default: 1
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [1, 2, 4, 8, 16, 32, 64, 128]
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        power-monitor@40 {
> +            compatible = "renesas,isl28022";
> +            reg = <0x40>;
> +            shunt-resistor-micro-ohms = <8000>;
> +            renesas,shunt-range-microvolt = <40000>;
> +            renesas,average-samples = <128>;
> +        };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index b02e3b991676..23b8e8183ece 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11069,6 +11069,7 @@ ISL28022 HARDWARE MONITORING DRIVER
>  M:	Carsten Spieß <mail@carsten-spiess.de>
>  L:	linux-hwmon@vger.kernel.org
>  S:	Maintained
> +F:	Documentation/devicetree/bindings/hwmon/renesas,isl28022.yaml
>  F:	Documentation/hwmon/isl28022.rst
>  F:	drivers/hwmon/isl28022.c
>  
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
  2023-08-01 20:52   ` Conor Dooley
@ 2023-08-02  7:30     ` Carsten Spieß
  2023-08-02  7:43       ` Conor Dooley
  2023-08-02 15:05       ` Guenter Roeck
  0 siblings, 2 replies; 6+ messages in thread
From: Carsten Spieß @ 2023-08-02  7:30 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Jean Delvare, Guenter Roeck, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, linux-hwmon,
	devicetree, linux-kernel, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]


On 8/1/23 22:52, Conor Dooley wrote:
> On Tue, Aug 01, 2023 at 06:35:46PM +0200, Carsten Spieß wrote:
> > Add dt-bindings for Renesas ISL28022 power monitor.
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - renesas,isl28022  
> 
> You've only got one compatible, why the enum? Will there be more similar
> devices that have an incompatible programming model?
Yes, there are isl28023 and isl28025 with different register addresses,
might be supported in future releases.

> > +  renesas,shunt-range-microvolt:
> > +    description: |  
> 
> You don't need these |s if you have no formatting to preserve in the
> text.
Will fix in v4.

> Otherwise, this does look good to me.
Thanks, regards
Carsten

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
  2023-08-02  7:30     ` Carsten Spieß
@ 2023-08-02  7:43       ` Conor Dooley
  2023-08-02 15:07         ` Guenter Roeck
  2023-08-02 15:05       ` Guenter Roeck
  1 sibling, 1 reply; 6+ messages in thread
From: Conor Dooley @ 2023-08-02  7:43 UTC (permalink / raw)
  To: Carsten Spieß
  Cc: Conor Dooley, Jean Delvare, Guenter Roeck, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-hwmon, devicetree, linux-kernel,
	linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

On Wed, Aug 02, 2023 at 09:30:23AM +0200, Carsten Spieß wrote:
> 
> On 8/1/23 22:52, Conor Dooley wrote:
> > On Tue, Aug 01, 2023 at 06:35:46PM +0200, Carsten Spieß wrote:
> > > Add dt-bindings for Renesas ISL28022 power monitor.
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - renesas,isl28022  
> > 
> > You've only got one compatible, why the enum? Will there be more similar
> > devices that have an incompatible programming model?
> Yes, there are isl28023 and isl28025 with different register addresses,
> might be supported in future releases.

Right. Unless that's a very strong "might", const: will do the trick
here just fine.

Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>

> > > +  renesas,shunt-range-microvolt:
> > > +    description: |  
> > 
> > You don't need these |s if you have no formatting to preserve in the
> > text.
> Will fix in v4.

There's no need to send a v4 for that alone.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
  2023-08-02  7:30     ` Carsten Spieß
  2023-08-02  7:43       ` Conor Dooley
@ 2023-08-02 15:05       ` Guenter Roeck
  1 sibling, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-08-02 15:05 UTC (permalink / raw)
  To: Carsten Spieß
  Cc: Conor Dooley, Jean Delvare, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, linux-hwmon,
	devicetree, linux-kernel, linux-renesas-soc

On Wed, Aug 02, 2023 at 09:30:23AM +0200, Carsten Spieß wrote:
> 
> On 8/1/23 22:52, Conor Dooley wrote:
> > On Tue, Aug 01, 2023 at 06:35:46PM +0200, Carsten Spieß wrote:
> > > Add dt-bindings for Renesas ISL28022 power monitor.
> > > +properties:
> > > +  compatible:
> > > +    enum:
> > > +      - renesas,isl28022  
> > 
> > You've only got one compatible, why the enum? Will there be more similar
> > devices that have an incompatible programming model?
> Yes, there are isl28023 and isl28025 with different register addresses,
> might be supported in future releases.

This is misleading. ISL28023 and ISL28025 are PMBus compatible chips
and would be added as PMBus driver(s) (if needed). Support for those chips
will never be part of the isl28022 driver, and any devicetree properties
of those chips would not be described in this file.

Guenter

> 
> > > +  renesas,shunt-range-microvolt:
> > > +    description: |  
> > 
> > You don't need these |s if you have no formatting to preserve in the
> > text.
> Will fix in v4.
> 
> > Otherwise, this does look good to me.
> Thanks, regards
> Carsten



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

* Re: [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022
  2023-08-02  7:43       ` Conor Dooley
@ 2023-08-02 15:07         ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2023-08-02 15:07 UTC (permalink / raw)
  To: Conor Dooley
  Cc: Carsten Spieß, Conor Dooley, Jean Delvare, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-hwmon, devicetree, linux-kernel,
	linux-renesas-soc

On Wed, Aug 02, 2023 at 08:43:59AM +0100, Conor Dooley wrote:
> On Wed, Aug 02, 2023 at 09:30:23AM +0200, Carsten Spieß wrote:
> > 
> > On 8/1/23 22:52, Conor Dooley wrote:
> > > On Tue, Aug 01, 2023 at 06:35:46PM +0200, Carsten Spieß wrote:
> > > > Add dt-bindings for Renesas ISL28022 power monitor.
> > > > +properties:
> > > > +  compatible:
> > > > +    enum:
> > > > +      - renesas,isl28022  
> > > 
> > > You've only got one compatible, why the enum? Will there be more similar
> > > devices that have an incompatible programming model?
> > Yes, there are isl28023 and isl28025 with different register addresses,
> > might be supported in future releases.
> 
> Right. Unless that's a very strong "might", const: will do the trick
> here just fine.

It is a very strong "will never be" for isl28023 and isl28025.

Guenter

> 
> Otherwise,
> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
> 
> > > > +  renesas,shunt-range-microvolt:
> > > > +    description: |  
> > > 
> > > You don't need these |s if you have no formatting to preserve in the
> > > text.
> > Will fix in v4.
> 
> There's no need to send a v4 for that alone.



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

end of thread, other threads:[~2023-08-02 15:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20230801163546.3170-1-mail@carsten-spiess.de>
2023-08-01 16:35 ` [PATCH v3 2/2] dt-bindings: hwmon: add renesas,isl28022 Carsten Spieß
2023-08-01 20:52   ` Conor Dooley
2023-08-02  7:30     ` Carsten Spieß
2023-08-02  7:43       ` Conor Dooley
2023-08-02 15:07         ` Guenter Roeck
2023-08-02 15:05       ` 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).