diff mbox series

[v3,1/2] dt-bindings: iio: adc: add TI LMP92064 controller

Message ID 20221128133503.1355898-1-l.goehrs@pengutronix.de (mailing list archive)
State Accepted
Headers show
Series [v3,1/2] dt-bindings: iio: adc: add TI LMP92064 controller | expand

Commit Message

Leonard Göhrs Nov. 28, 2022, 1:35 p.m. UTC
Add binding documentation for the TI LMP92064 dual channel SPI ADC.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
---

Changes from v2 -> v3:

 - Use unevaluatedProperties: false instead of additionalProperties: false

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


 .../bindings/iio/adc/ti,lmp92064.yaml         | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/ti,lmp92064.yaml


base-commit: b7b275e60bcd5f89771e865a8239325f86d9927d

Comments

Krzysztof Kozlowski Nov. 28, 2022, 9:25 p.m. UTC | #1
On 28/11/2022 14:35, Leonard Göhrs wrote:
> Add binding documentation for the TI LMP92064 dual channel SPI ADC.
> 
> Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
> ---
> 



Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
Jonathan Cameron Dec. 4, 2022, 2:32 p.m. UTC | #2
On Mon, 28 Nov 2022 22:25:20 +0100
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> On 28/11/2022 14:35, Leonard Göhrs wrote:
> > Add binding documentation for the TI LMP92064 dual channel SPI ADC.
> > 
> > Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
> > ---
> >   
> 
> 
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Series applied to the togreg branch of iio.git. This is now 6.3 material
as the merge window will open soon so we've missed this cycle.

For now I'll push out as testing to let 0-day look at it prior to rebasing
the branch on rc1.

Thanks,

Jonathan
>
diff mbox series

Patch

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 0000000000000..5fb65bf7749d0
--- /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#
+
+unevaluatedProperties: 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>;
+        };
+    };
+...