Skip to contentSkip to conversation

dt-bindings: iio: adc: Maxim ADC yaml conversions

PATCH Superseded Jonathan Cameron 3 participants 12 messages Jul 22, 2020 – Aug 1, 2020

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover dt-bindings: iio: adc: Maxim ADC yaml conversions

From: Jonathan Cameron <[email protected]>

These 3 are all fairly simple (I think) so should be uncontroversial. My biggest question is with Jacopi and Akinobu are happy to be explicitly listed as maintainers for these bindings.

Jonathan Cameron (3):
dt-bindings: iio: adc: maxim,max11100 yaml conversion
dt-bindings: iio: adc: maxim,max1118 yaml conversion
dt-bindings: iio: adc: maxim,max9611 yaml conversions

 .../devicetree/bindings/iio/adc/max11100.txt  | 18 ------
 .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ---------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++
 .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++
 6 files changed, 157 insertions(+), 66 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max11100.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max1118.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max9611.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
Signature · 1 line
2.27.0
author maintainer
#1 lore raw

PATCH 1/3 dt-bindings: iio: adc: maxim,max11100 yaml conversion

From: Jonathan Cameron <[email protected]>

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

---
 .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/iio/adc/max11100.txt deleted +0 -18
deleted file mode 100644
index b7f7177b8aca..000000000000
@@ -1,18 +0,0 @@
-* Maxim max11100 Analog to Digital Converter (ADC)
-
-Required properties:
-  - compatible: Should be "maxim,max11100"
-  - reg: the adc unit address
-  - vref-supply: phandle to the regulator that provides reference voltage
-
-Optional properties:
-  - spi-max-frequency: SPI maximum frequency
-
-Example:
-
-max11100: adc@0 {
-        compatible = "maxim,max11100";
-        reg = <0>;
-        vref-supply = <&adc0_vref>;
-        spi-max-frequency = <240000>;
-};
Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.27.0
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion

Hi Jonathan,

Quoted 7 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

Thanks
j

Quoted 87 lines
---
 .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)
Documentation/devicetree/bindings/iio/adc/max11100.txt deleted +0 -18
deleted file mode 100644
index b7f7177b8aca..000000000000
@@ -1,18 +0,0 @@
-* Maxim max11100 Analog to Digital Converter (ADC)
-
-Required properties:
-  - compatible: Should be "maxim,max11100"
-  - reg: the adc unit address
-  - vref-supply: phandle to the regulator that provides reference voltage
-
-Optional properties:
-  - spi-max-frequency: SPI maximum frequency
-
-Example:
-
-max11100: adc@0 {
-        compatible = "maxim,max11100";
-        reg = <0>;
-        vref-supply = <&adc0_vref>;
-        spi-max-frequency = <240000>;
-};
Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml new file +49 -1
new file mode 100644
index 000000000000..0cf87556ef82
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/maxim,max11100.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX11100 ADC
+
+maintainers:
+  - Jacopo Mondi <[email protected]>
+
+description: |
+    Single channel 16 bit ADC with SPI interface.
+
+properties:
+  compatible:
+    const: maxim,max11100
+
+  reg:
+    maxItems: 1
+
+  vref-supply:
+    description: External reference, needed to establish input scaling.
+
+  spi-max-frequency:
+    minimum: 100000
+    maximum: 4800000
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - vref-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            compatible = "maxim,max11100";
+            reg = <0>;
+            vref-supply = <&adc_vref>;
+            spi-max-frequency = <240000>;
+        };
+    };
+...
--

2.27.0

maintainer Reviewed-by on v1 1/3
#3 lore raw

Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion

In reply to Jonathan Cameron
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

Quoted 7 lines
---
 .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)
author maintainer
#4 lore raw

Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion

Quoted 14 lines · On Thu, 23 Jul 2020 15:21:59 -0600 Rob Herring <[email protected]> wrote:
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion for this SPI ADC.
Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)

Quoted 7 lines
---
 .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)
Quoted 1 line

Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.

Thanks,

Jonathan

author maintainer
#5 lore raw

PATCH 2/3 dt-bindings: iio: adc: maxim,max1118 yaml conversion

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple device with a simple conversion. Special handling needed for the max1118 which is the only supported part that has an external reference voltage.

---
 .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
 .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/adc/max1118.txt deleted +0 -21
deleted file mode 100644
index cf33d0b15a6d..000000000000
@@ -1,21 +0,0 @@
-* MAX1117/MAX1118/MAX1119 8-bit, dual-channel ADCs
-
-Required properties:
- - compatible: Should be one of
-	* "maxim,max1117"
-	* "maxim,max1118"
-	* "maxim,max1119"
- - reg: spi chip select number for the device
- - (max1118 only) vref-supply: The regulator supply for ADC reference voltage
-
-Recommended properties:
- - spi-max-frequency: Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Example:
-adc@0 {
-	compatible = "maxim,max1118";
-	reg = <0>;
-	vref-supply = <&vdd_supply>;
-	spi-max-frequency = <1000000>;
-};
Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.27.0
maintainer
#6 lore raw

Re: [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 yaml conversion

Quoted 77 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Simple device with a simple conversion. Special handling needed for the max1118 which is the only supported part that has an external reference voltage.

---
 .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
 .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 21 deletions(-)
Documentation/devicetree/bindings/iio/adc/max1118.txt deleted +0 -21
deleted file mode 100644
index cf33d0b15a6d..000000000000
@@ -1,21 +0,0 @@
-* MAX1117/MAX1118/MAX1119 8-bit, dual-channel ADCs
-
-Required properties:
- - compatible: Should be one of
-	* "maxim,max1117"
-	* "maxim,max1118"
-	* "maxim,max1119"
- - reg: spi chip select number for the device
- - (max1118 only) vref-supply: The regulator supply for ADC reference voltage
-
-Recommended properties:
- - spi-max-frequency: Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Example:
-adc@0 {
-	compatible = "maxim,max1118";
-	reg = <0>;
-	vref-supply = <&vdd_supply>;
-	spi-max-frequency = <1000000>;
-};
Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml new file +31 -0
new file mode 100644
index 000000000000..ca24b8b23cde
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/maxim,max1118.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX1118 and similar ADCs
+
+maintainers:
+  - Akinobu Mita <[email protected]>
+
+description: |
+    Dual channel 8bit ADCs.
+
+properties:
+  compatible:
+    enum:
+      - maxim,max1117
+      - maxim,max1118
+      - maxim,max1119
+
+  reg:
+    maxItems: 1
+
+  spi-max-frequency:
+    maximum: 5000000
+
+required:
+  - compatible
+  - reg
+

Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml line 41

Quoted 10 lines
Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml new file +10 -0
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+           const: maxim,max1118
+    then:
+      properties:
+        vref-supply:
+          description: External reference, needed to establish input scaling

This needs to be moved to the main section when you add 'additionalProperties'.

Then add an 'else' clause here with:

not:
required:
- vref-supply

Or this works too:

properties:
vref-supply: false

Quoted 21 lines
Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml new file +18 -0
+
+      required:
+        - vref-supply
+
+examples:
+  - |
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@0 {
+            compatible = "maxim,max1118";
+            reg = <0>;
+            vref-supply = <&adc_vref>;
+            spi-max-frequency = <1000000>;
+        };
+    };
+...
Signature · 1 line
2.27.0
author maintainer
#7 lore raw

PATCH 3/3 dt-bindings: iio: adc: maxim,max9611 yaml conversions

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion of this binding for this current sense amplifier and ADC.

---
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/adc/max9611.txt deleted +0 -27
deleted file mode 100644
index ab4f43145ae5..000000000000
@@ -1,27 +0,0 @@
-* Maxim max9611/max9612 current sense amplifier with 12-bits ADC interface
-
-Maxim max9611/max9612 is an high-side current sense amplifier with integrated
-12-bits ADC communicating over I2c bus.
-The device node for this driver shall be a child of a I2c controller.
-
-Required properties
-  - compatible: Should be "maxim,max9611" or "maxim,max9612"
-  - reg: The 7-bits long I2c address of the device
-  - shunt-resistor-micro-ohms: Value, in micro Ohms, of the current sense shunt
-			        resistor
-
-Example:
-
-&i2c4 {
-	csa: adc@7c {
-		compatible = "maxim,max9611";
-		reg = <0x7c>;
-
-		shunt-resistor-micro-ohms = <5000>;
-	};
-};
-
-This device node describes a current sense amplifier sitting on I2c4 bus
-with address 0x7c (read address is 0xf9, write address is 0xf8).
-A sense resistor of 0,005 Ohm is installed between RS+ and RS- current-sensing
-inputs.
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml new file +49 -0

49 lines not on this page · raw message

Signature · 1 line
2.27.0
Reviewed-by on v1 3/3
#8 lore raw

Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions

Quoted 70 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion of this binding for this current sense amplifier and ADC.

---
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
Documentation/devicetree/bindings/iio/adc/max9611.txt deleted +0 -27
deleted file mode 100644
index ab4f43145ae5..000000000000
@@ -1,27 +0,0 @@
-* Maxim max9611/max9612 current sense amplifier with 12-bits ADC interface
-
-Maxim max9611/max9612 is an high-side current sense amplifier with integrated
-12-bits ADC communicating over I2c bus.
-The device node for this driver shall be a child of a I2c controller.
-
-Required properties
-  - compatible: Should be "maxim,max9611" or "maxim,max9612"
-  - reg: The 7-bits long I2c address of the device
-  - shunt-resistor-micro-ohms: Value, in micro Ohms, of the current sense shunt
-			        resistor
-
-Example:
-
-&i2c4 {
-	csa: adc@7c {
-		compatible = "maxim,max9611";
-		reg = <0x7c>;
-
-		shunt-resistor-micro-ohms = <5000>;
-	};
-};
-
-This device node describes a current sense amplifier sitting on I2c4 bus
-with address 0x7c (read address is 0xf9, write address is 0xf8).
-A sense resistor of 0,005 Ohm is installed between RS+ and RS- current-sensing
-inputs.
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml new file +19 -0
new file mode 100644
index 000000000000..a9fc05e6b62c
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/adc/maxim,max9611.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MAX9611 and similar current sense amplifiers with integrated ADCs
+
+maintainers:
+  - Jacopo Mondi <[email protected]>
+
+description: |
+   These devices combine a high-side current sense amplifier with a 12 bit ADC.
+   They have an i2c interface.
+
+properties:
+  compatible:
+    enum:
+      - maxim,max9611

Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml new file +10 -0
+      - maxim,max9612
+
+  reg:
+    maxItems: 1
+
+  shunt-resistor-micro-ohms:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Value in micro Ohms of the shunt resistor connected between the RS+ and
+      RS- inputs, across which the current is measured.  Value needed to compute

^ Double space

Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml line 31

Quoted 2 lines
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml new file +2 -0
+      the scaling of the measured current.
+

With additionalProperties added

Thanks
j

Quoted 21 lines
Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml new file +18 -1
+required:
+  - compatible
+  - reg
+  - shunt-resistor-micro-ohms
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        adc@7c {
+            compatible = "maxim,max9611";
+            reg = <0x7c>;
+            shunt-resistor-micro-ohms = <5000>;
+        };
+    };
+...
--

2.27.0

maintainer Reviewed-by on v1 3/3
#9 lore raw

Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions

In reply to Jonathan Cameron
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion of this binding for this current sense amplifier and ADC.

Quoted 7 lines
---
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
author maintainer
#10 lore raw

Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions

Quoted 14 lines · On Thu, 23 Jul 2020 15:22:31 -0600 Rob Herring <[email protected]> wrote:
Quoted 5 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Straight forward conversion of this binding for this current sense amplifier and ADC.

Quoted 7 lines
---
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
Quoted 1 line

Thanks

Applied with additionalProperties line added.

Jonathan

author maintainer
#11 lore raw
In reply to Jonathan Cameron
Quoted 5 lines · On Wed, 22 Jul 2020 18:12:21 +0100 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

These 3 are all fairly simple (I think) so should be uncontroversial. My biggest question is with Jacopi and Akinobu are happy to be explicitly listed as maintainers for these bindings.

I'll leave these for now, but just realised I didn't put
additionalProperties: false in the last 2 and I'm fairly sure it should be fine to do so in both of them.

Jonathan

Quoted 20 lines

Jonathan Cameron (3):
dt-bindings: iio: adc: maxim,max11100 yaml conversion
dt-bindings: iio: adc: maxim,max1118 yaml conversion
dt-bindings: iio: adc: maxim,max9611 yaml conversions

 .../devicetree/bindings/iio/adc/max11100.txt  | 18 ------
 .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ---------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++
 .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++
 6 files changed, 157 insertions(+), 66 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max11100.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max1118.txt
 delete mode 100644 Documentation/devicetree/bindings/iio/adc/max9611.txt
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml