All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions
@ 2020-07-22 17:12 Jonathan Cameron
  2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-07-22 17:12 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jacopo Mondi, Akinobu Mita, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

-- 
2.27.0


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

* [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion
  2020-07-22 17:12 [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions Jonathan Cameron
@ 2020-07-22 17:12 ` Jonathan Cameron
  2020-07-23  9:31   ` Jacopo Mondi
  2020-07-23 21:21   ` Rob Herring
  2020-07-22 17:12 ` [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 " Jonathan Cameron
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-07-22 17:12 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jacopo Mondi, Akinobu Mita, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

Cc: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
 .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 18 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/max11100.txt b/Documentation/devicetree/bindings/iio/adc/max11100.txt
deleted file mode 100644
index b7f7177b8aca..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/max11100.txt
+++ /dev/null
@@ -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>;
-};
diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
new file mode 100644
index 000000000000..0cf87556ef82
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
@@ -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 <jacopo@jmondi.org>
+
+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


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

* [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 yaml conversion
  2020-07-22 17:12 [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions Jonathan Cameron
  2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
@ 2020-07-22 17:12 ` Jonathan Cameron
  2020-07-23 21:21   ` Rob Herring
  2020-07-22 17:12 ` [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions Jonathan Cameron
  2020-07-22 17:18 ` [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC " Jonathan Cameron
  3 siblings, 1 reply; 12+ messages in thread
From: Jonathan Cameron @ 2020-07-22 17:12 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jacopo Mondi, Akinobu Mita, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

Cc: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
 .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 21 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/max1118.txt b/Documentation/devicetree/bindings/iio/adc/max1118.txt
deleted file mode 100644
index cf33d0b15a6d..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/max1118.txt
+++ /dev/null
@@ -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>;
-};
diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
new file mode 100644
index 000000000000..ca24b8b23cde
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
@@ -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 <akinobu.mita@gmail.com>
+
+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
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+           const: maxim,max1118
+    then:
+      properties:
+        vref-supply:
+          description: External reference, needed to establish input scaling
+
+      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>;
+        };
+    };
+...
-- 
2.27.0


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

* [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions
  2020-07-22 17:12 [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions Jonathan Cameron
  2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
  2020-07-22 17:12 ` [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 " Jonathan Cameron
@ 2020-07-22 17:12 ` Jonathan Cameron
  2020-07-23  9:30   ` Jacopo Mondi
  2020-07-23 21:22   ` Rob Herring
  2020-07-22 17:18 ` [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC " Jonathan Cameron
  3 siblings, 2 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-07-22 17:12 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jacopo Mondi, Akinobu Mita, Jonathan Cameron

From: Jonathan Cameron <Jonathan.Cameron@huawei.com>

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

Cc: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
---
 .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
 .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/max9611.txt b/Documentation/devicetree/bindings/iio/adc/max9611.txt
deleted file mode 100644
index ab4f43145ae5..000000000000
--- a/Documentation/devicetree/bindings/iio/adc/max9611.txt
+++ /dev/null
@@ -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.
diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
new file mode 100644
index 000000000000..a9fc05e6b62c
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
@@ -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 <jacopo@jmondi.org>
+
+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
+      - 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
+      the scaling of the measured current.
+
+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


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

* Re: [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions
  2020-07-22 17:12 [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions Jonathan Cameron
                   ` (2 preceding siblings ...)
  2020-07-22 17:12 ` [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions Jonathan Cameron
@ 2020-07-22 17:18 ` Jonathan Cameron
  3 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-07-22 17:18 UTC (permalink / raw)
  To: linux-iio, Rob Herring, devicetree
  Cc: Jacopo Mondi, Akinobu Mita, Jonathan Cameron

On Wed, 22 Jul 2020 18:12:21 +0100
Jonathan Cameron <jic23@kernel.org> wrote:

> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> 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


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


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

* Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions
  2020-07-22 17:12 ` [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions Jonathan Cameron
@ 2020-07-23  9:30   ` Jacopo Mondi
  2020-07-23 21:22   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Jacopo Mondi @ 2020-07-23  9:30 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring, devicetree, Akinobu Mita, Jonathan Cameron

On Wed, Jul 22, 2020 at 06:12:24PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Straight forward conversion of this binding for this
> current sense amplifier and ADC.
>
> Cc: Jacopo Mondi <jacopo@jmondi.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
>  .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 27 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/max9611.txt b/Documentation/devicetree/bindings/iio/adc/max9611.txt
> deleted file mode 100644
> index ab4f43145ae5..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/max9611.txt
> +++ /dev/null
> @@ -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.
> diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
> new file mode 100644
> index 000000000000..a9fc05e6b62c
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max9611.yaml
> @@ -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 <jacopo@jmondi.org>
> +
> +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
> +      - 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
> +      the scaling of the measured current.
> +

With additionalProperties added
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j
> +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
>

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

* Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion
  2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
@ 2020-07-23  9:31   ` Jacopo Mondi
  2020-07-23 21:21   ` Rob Herring
  1 sibling, 0 replies; 12+ messages in thread
From: Jacopo Mondi @ 2020-07-23  9:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, Rob Herring, devicetree, Akinobu Mita, Jonathan Cameron

Hi Jonathan,

On Wed, Jul 22, 2020 at 06:12:22PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
>
> Straight forward conversion for this SPI ADC.
> Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)
>
> Cc: Jacopo Mondi <jacopo@jmondi.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

> ---
>  .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
>  .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 18 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/iio/adc/max11100.txt b/Documentation/devicetree/bindings/iio/adc/max11100.txt
> deleted file mode 100644
> index b7f7177b8aca..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/max11100.txt
> +++ /dev/null
> @@ -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>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
> new file mode 100644
> index 000000000000..0cf87556ef82
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
> @@ -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 <jacopo@jmondi.org>
> +
> +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
>

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

* Re: [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 yaml conversion
  2020-07-22 17:12 ` [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 " Jonathan Cameron
@ 2020-07-23 21:21   ` Rob Herring
  0 siblings, 0 replies; 12+ messages in thread
From: Rob Herring @ 2020-07-23 21:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: linux-iio, devicetree, Jacopo Mondi, Akinobu Mita, Jonathan Cameron

On Wed, Jul 22, 2020 at 06:12:23PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Simple device with a simple conversion.  Special handling needed
> for the max1118 which is the only supported part that has an external
> reference voltage.
> 
> Cc: Akinobu Mita <akinobu.mita@gmail.com>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../devicetree/bindings/iio/adc/max1118.txt   | 21 -------
>  .../bindings/iio/adc/maxim,max1118.yaml       | 59 +++++++++++++++++++
>  2 files changed, 59 insertions(+), 21 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/max1118.txt b/Documentation/devicetree/bindings/iio/adc/max1118.txt
> deleted file mode 100644
> index cf33d0b15a6d..000000000000
> --- a/Documentation/devicetree/bindings/iio/adc/max1118.txt
> +++ /dev/null
> @@ -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>;
> -};
> diff --git a/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml b/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
> new file mode 100644
> index 000000000000..ca24b8b23cde
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
> @@ -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 <akinobu.mita@gmail.com>
> +
> +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
> +
> +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

> +
> +      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>;
> +        };
> +    };
> +...
> -- 
> 2.27.0
> 

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

* Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion
  2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
  2020-07-23  9:31   ` Jacopo Mondi
@ 2020-07-23 21:21   ` Rob Herring
  2020-08-01 16:38     ` Jonathan Cameron
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2020-07-23 21:21 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: devicetree, Akinobu Mita, Jacopo Mondi, Jonathan Cameron,
	linux-iio, Rob Herring

On Wed, 22 Jul 2020 18:12:22 +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Straight forward conversion for this SPI ADC.
> Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)
> 
> Cc: Jacopo Mondi <jacopo@jmondi.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
>  .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 18 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions
  2020-07-22 17:12 ` [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions Jonathan Cameron
  2020-07-23  9:30   ` Jacopo Mondi
@ 2020-07-23 21:22   ` Rob Herring
  2020-08-01 16:42     ` Jonathan Cameron
  1 sibling, 1 reply; 12+ messages in thread
From: Rob Herring @ 2020-07-23 21:22 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: devicetree, Jonathan Cameron, Jacopo Mondi, Rob Herring,
	Akinobu Mita, linux-iio

On Wed, 22 Jul 2020 18:12:24 +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Straight forward conversion of this binding for this
> current sense amplifier and ADC.
> 
> Cc: Jacopo Mondi <jacopo@jmondi.org>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> ---
>  .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
>  .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
>  2 files changed, 49 insertions(+), 27 deletions(-)
> 

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion
  2020-07-23 21:21   ` Rob Herring
@ 2020-08-01 16:38     ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-08-01 16:38 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Akinobu Mita, Jacopo Mondi, Jonathan Cameron,
	linux-iio, Rob Herring

On Thu, 23 Jul 2020 15:21:59 -0600
Rob Herring <robh@kernel.org> wrote:

> On Wed, 22 Jul 2020 18:12:22 +0100, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Straight forward conversion for this SPI ADC.
> > Added limits on spi-max-frequency from datasheet (0.1 to 4.8MHz)
> > 
> > Cc: Jacopo Mondi <jacopo@jmondi.org>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  .../devicetree/bindings/iio/adc/max11100.txt  | 18 -------
> >  .../bindings/iio/adc/maxim,max11100.yaml      | 49 +++++++++++++++++++
> >  2 files changed, 49 insertions(+), 18 deletions(-)
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.

Thanks,

Jonathan



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

* Re: [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions
  2020-07-23 21:22   ` Rob Herring
@ 2020-08-01 16:42     ` Jonathan Cameron
  0 siblings, 0 replies; 12+ messages in thread
From: Jonathan Cameron @ 2020-08-01 16:42 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Jonathan Cameron, Jacopo Mondi, Rob Herring,
	Akinobu Mita, linux-iio

On Thu, 23 Jul 2020 15:22:31 -0600
Rob Herring <robh@kernel.org> wrote:

> On Wed, 22 Jul 2020 18:12:24 +0100, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Straight forward conversion of this binding for this
> > current sense amplifier and ADC.
> > 
> > Cc: Jacopo Mondi <jacopo@jmondi.org>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  .../devicetree/bindings/iio/adc/max9611.txt   | 27 ----------
> >  .../bindings/iio/adc/maxim,max9611.yaml       | 49 +++++++++++++++++++
> >  2 files changed, 49 insertions(+), 27 deletions(-)
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Thanks

Applied with additionalProperties line added.

Jonathan


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

end of thread, other threads:[~2020-08-01 16:42 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 17:12 [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC yaml conversions Jonathan Cameron
2020-07-22 17:12 ` [PATCH 1/3] dt-bindings: iio: adc: maxim,max11100 yaml conversion Jonathan Cameron
2020-07-23  9:31   ` Jacopo Mondi
2020-07-23 21:21   ` Rob Herring
2020-08-01 16:38     ` Jonathan Cameron
2020-07-22 17:12 ` [PATCH 2/3] dt-bindings: iio: adc: maxim,max1118 " Jonathan Cameron
2020-07-23 21:21   ` Rob Herring
2020-07-22 17:12 ` [PATCH 3/3] dt-bindings: iio: adc: maxim,max9611 yaml conversions Jonathan Cameron
2020-07-23  9:30   ` Jacopo Mondi
2020-07-23 21:22   ` Rob Herring
2020-08-01 16:42     ` Jonathan Cameron
2020-07-22 17:18 ` [PATCH 0/3] dt-bindings: iio: adc: Maxim ADC " Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.