devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller
@ 2022-11-01  6:48 Leonard Göhrs
  2022-11-01 11:55 ` Rob Herring
  2022-11-01 12:28 ` Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Leonard Göhrs @ 2022-11-01  6:48 UTC (permalink / raw)
  To: Leonard Göhrs, kernel, Jonathan Cameron, Lars-Peter Clausen
  Cc: Rob Herring, Krzysztof Kozlowski, linux-iio, devicetree,
	linux-kernel

Add binding documentation for the TI LMP92064 dual channel SPI ADC.

Changes from v1 -> v2:

 - Rename the "shunt-resistor" devicetree property to
   "shunt-resistor-micro-ohms".
 - Add supply regulator support for the two voltage domains of the chip
   (vdd and vdig).
 - Add reference to spi-peripheral-props.yaml

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---
 .../bindings/iio/adc/ti,lmp92064.yaml         | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml

diff --git a/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
new file mode 100644
index 000000000000..357b15ebd897
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/ti,lmp92064.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments LMP92064 Precision Current and Voltage Sensor.
+
+maintainers:
+  - Leonard Göhrs <l.goehrs@pengutronix.de>
+
+description: |
+  The LMP92064 is a two channel ADC intended for combined voltage and current
+  measurements.
+
+  The device contains two ADCs to allow simultaneous sampling of voltage and
+  current and thus of instantaneous power consumption.
+
+properties:
+  compatible:
+    enum:
+      - ti,lmp92064
+
+  reg:
+    maxItems: 1
+
+  vdd-supply:
+    description: Regulator that provides power to the main part of the chip
+
+  vdig-supply:
+    description: |
+      Regulator that provides power to the digital I/O part of the chip
+
+  shunt-resistor-micro-ohms:
+    description: |
+      Value of the shunt resistor (in µΩ) connected between INCP and INCN,
+      across which current is measured. Used to provide correct scaling of the
+      raw ADC measurement.
+
+  reset-gpios:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - shunt-resistor-micro-ohms
+
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            compatible = "ti,lmp92064";
+            reg = <0>;
+            vdd-supply = <&vdd>;
+            vdig-supply = <&vdd>;
+            spi-max-frequency = <20000000>;
+            shunt-resistor-micro-ohms = <15000>;
+            reset-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
+        };
+    };
+...
-- 
2.30.2


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

* Re: [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller
  2022-11-01  6:48 [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller Leonard Göhrs
@ 2022-11-01 11:55 ` Rob Herring
  2022-11-01 12:28 ` Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2022-11-01 11:55 UTC (permalink / raw)
  To: Leonard Göhrs
  Cc: Krzysztof Kozlowski, linux-iio, kernel, Jonathan Cameron,
	Lars-Peter Clausen, devicetree, Rob Herring, linux-kernel


On Tue, 01 Nov 2022 07:48:03 +0100, Leonard Göhrs wrote:
> Add binding documentation for the TI LMP92064 dual channel SPI ADC.
> 
> Changes from v1 -> v2:
> 
>  - Rename the "shunt-resistor" devicetree property to
>    "shunt-resistor-micro-ohms".
>  - Add supply regulator support for the two voltage domains of the chip
>    (vdd and vdig).
>  - Add reference to spi-peripheral-props.yaml
> 
> Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
> ---
>  .../bindings/iio/adc/ti,lmp92064.yaml         | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
> 

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/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.example.dtb: adc@0: 'spi-max-frequency' does not match any of the regexes: 'pinctrl-[0-9]+'
	From schema: /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml

doc reference errors (make refcheckdocs):

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

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] 4+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller
  2022-11-01  6:48 [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller Leonard Göhrs
  2022-11-01 11:55 ` Rob Herring
@ 2022-11-01 12:28 ` Rob Herring
  2022-11-06 14:52   ` Jonathan Cameron
  1 sibling, 1 reply; 4+ messages in thread
From: Rob Herring @ 2022-11-01 12:28 UTC (permalink / raw)
  To: Leonard Göhrs
  Cc: kernel, Jonathan Cameron, Lars-Peter Clausen, Krzysztof Kozlowski,
	linux-iio, devicetree, linux-kernel

On Tue, Nov 01, 2022 at 07:48:03AM +0100, Leonard Göhrs wrote:
> Add binding documentation for the TI LMP92064 dual channel SPI ADC.
> 
> Changes from v1 -> v2:
> 
>  - Rename the "shunt-resistor" devicetree property to
>    "shunt-resistor-micro-ohms".
>  - Add supply regulator support for the two voltage domains of the chip
>    (vdd and vdig).
>  - Add reference to spi-peripheral-props.yaml
> 
> Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
> ---
>  .../bindings/iio/adc/ti,lmp92064.yaml         | 70 +++++++++++++++++++
>  1 file changed, 70 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
> new file mode 100644
> index 000000000000..357b15ebd897
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/adc/ti,lmp92064.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Texas Instruments LMP92064 Precision Current and Voltage Sensor.
> +
> +maintainers:
> +  - Leonard Göhrs <l.goehrs@pengutronix.de>
> +
> +description: |
> +  The LMP92064 is a two channel ADC intended for combined voltage and current
> +  measurements.
> +
> +  The device contains two ADCs to allow simultaneous sampling of voltage and
> +  current and thus of instantaneous power consumption.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - ti,lmp92064
> +
> +  reg:
> +    maxItems: 1
> +
> +  vdd-supply:
> +    description: Regulator that provides power to the main part of the chip
> +
> +  vdig-supply:
> +    description: |
> +      Regulator that provides power to the digital I/O part of the chip
> +
> +  shunt-resistor-micro-ohms:
> +    description: |
> +      Value of the shunt resistor (in µΩ) connected between INCP and INCN,
> +      across which current is measured. Used to provide correct scaling of the
> +      raw ADC measurement.
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - shunt-resistor-micro-ohms
> +
> +allOf:
> +  - $ref: /schemas/spi/spi-peripheral-props.yaml#
> +
> +additionalProperties: false

This should be unevaluatedProperties instead.

> +
> +examples:
> +  - |
> +    #include <dt-bindings/gpio/gpio.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        adc@0 {
> +            compatible = "ti,lmp92064";
> +            reg = <0>;
> +            vdd-supply = <&vdd>;
> +            vdig-supply = <&vdd>;
> +            spi-max-frequency = <20000000>;
> +            shunt-resistor-micro-ohms = <15000>;
> +            reset-gpios = <&gpio1 16 GPIO_ACTIVE_HIGH>;
> +        };
> +    };
> +...
> -- 
> 2.30.2
> 
> 

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

* Re: [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller
  2022-11-01 12:28 ` Rob Herring
@ 2022-11-06 14:52   ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2022-11-06 14:52 UTC (permalink / raw)
  To: Rob Herring
  Cc: Leonard Göhrs, kernel, Lars-Peter Clausen,
	Krzysztof Kozlowski, linux-iio, devicetree, linux-kernel

On Tue, 1 Nov 2022 07:28:24 -0500
Rob Herring <robh@kernel.org> wrote:

> On Tue, Nov 01, 2022 at 07:48:03AM +0100, Leonard Göhrs wrote:
> > Add binding documentation for the TI LMP92064 dual channel SPI ADC.
> > 
> > Changes from v1 -> v2:
> > 
> >  - Rename the "shunt-resistor" devicetree property to
> >    "shunt-resistor-micro-ohms".
> >  - Add supply regulator support for the two voltage domains of the chip
> >    (vdd and vdig).
> >  - Add reference to spi-peripheral-props.yaml

Change log should be below the ---
We don't want to directly capture in the git tree - though I will apply
a link tag so people can find the thread on lore.kernel.org if they want
this information.

I'm aware that for some parts of the kernel the policy is different but in IIO
we assume the link tag is sufficient.

> > 
> > Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
> > ---
> >  .../bindings/iio/adc/ti,lmp92064.yaml         | 70 +++++++++++++++++++
> >  1 file changed, 70 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml
> > 

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

end of thread, other threads:[~2022-11-06 14:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-01  6:48 [PATCH v2 1/2] dt-bindings: iio: adc: add TI LMP92064 controller Leonard Göhrs
2022-11-01 11:55 ` Rob Herring
2022-11-01 12:28 ` Rob Herring
2022-11-06 14:52   ` Jonathan Cameron

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).