All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] dt-bindings:iio:yaml conversions with xor condition
@ 2021-04-01 14:09 Jonathan Cameron
  2021-04-01 14:09 ` [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion Jonathan Cameron
  2021-04-01 14:09 ` [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion Jonathan Cameron
  0 siblings, 2 replies; 6+ messages in thread
From: Jonathan Cameron @ 2021-04-01 14:09 UTC (permalink / raw)
  To: linux-iio, Rob Herring; +Cc: devicetree, Jonathan Cameron

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

These two binding conversions are left from last year because I couldn't
figure out how to do the XOR between spi-cpha and spi-cpol without
using a $ref.  Rob suggested it should work by lifting the $ref block
and putting it inline but that ran into a restriction the dt-schema that
a oneOf is not allowed directly under an allOf.

Line 34 of schema/base.yaml
  allOf:
    items:
      propertyNames:
        enum:
          - $ref
          - if
          - then
          - else
  anyOf: true

I was just about to send a pull request to relax that constraint when I
realized that a top level oneOf was sufficient for this XoR condition
because it rules out more than one of the options being true at the same
time.  Hence the simplified version given here constrains things correctly.

oneOf:
  - required:
      - spi-cpha
  - required:
      - spi-cpol

We don't need to also specify
not:
  required: [spi-cpha, spi-cpol]
as done in earlier versions of these bindings.

One other minor change in patch 2 to make Should -> Must to avoid
confusion.

Jonathan Cameron (2):
  dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  dt-bindings:iio:dac:ti,dac082s085 yaml conversion

 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 -------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 171 ++++++++++++++++++
 .../bindings/iio/dac/ti,dac082s085.yaml       |  72 ++++++++
 .../bindings/iio/dac/ti-dac082s085.txt        |  34 ----
 4 files changed, 243 insertions(+), 158 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ad5755.txt
 create mode 100644 Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
 create mode 100644 Documentation/devicetree/bindings/iio/dac/ti,dac082s085.yaml
 delete mode 100644 Documentation/devicetree/bindings/iio/dac/ti-dac082s085.txt

-- 
2.31.1


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

* [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2021-04-01 14:09 [PATCH 0/2] dt-bindings:iio:yaml conversions with xor condition Jonathan Cameron
@ 2021-04-01 14:09 ` Jonathan Cameron
  2021-04-09 14:30   ` Rob Herring
  2021-04-01 14:09 ` [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion Jonathan Cameron
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2021-04-01 14:09 UTC (permalink / raw)
  To: linux-iio, Rob Herring; +Cc: devicetree, Jonathan Cameron, Sean Nyekjaer

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

Straight forward conversion.  Only fiddly bit is the XOR of
spi-cpol and spi-cpha.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
Link: https://lore.kernel.org/r/20201031184854.745828-40-jic23@kernel.org
---
 .../devicetree/bindings/iio/dac/ad5755.txt    | 124 -------------
 .../bindings/iio/dac/adi,ad5755.yaml          | 171 ++++++++++++++++++
 2 files changed, 171 insertions(+), 124 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/ad5755.txt b/Documentation/devicetree/bindings/iio/dac/ad5755.txt
deleted file mode 100644
index 502e1e55adbd..000000000000
--- a/Documentation/devicetree/bindings/iio/dac/ad5755.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-* Analog Devices AD5755 IIO Multi-Channel DAC Linux Driver
-
-Required properties:
- - compatible: Has to contain one of the following:
-	adi,ad5755
-	adi,ad5755-1
-	adi,ad5757
-	adi,ad5735
-	adi,ad5737
-
- - reg: spi chip select number for the device
- - spi-cpha or spi-cpol: is the only modes that is supported
-
-Recommended properties:
- - spi-max-frequency: Definition as per
-		Documentation/devicetree/bindings/spi/spi-bus.txt
-
-Optional properties:
-See include/dt-bindings/iio/ad5755.h
- - adi,ext-dc-dc-compenstation-resistor: boolean set if the hardware have an
-					 external resistor and thereby bypasses
-					 the internal compensation resistor.
- - adi,dc-dc-phase:
-	Valid values for DC DC Phase control is:
-	0: All dc-to-dc converters clock on the same edge.
-	1: Channel A and Channel B clock on the same edge,
-	   Channel C and Channel D clock on opposite edges.
-	2: Channel A and Channel C clock on the same edge,
-	   Channel B and Channel D clock on opposite edges.
-	3: Channel A, Channel B, Channel C, and Channel D
-	   clock 90 degrees out of phase from each other.
- - adi,dc-dc-freq-hz:
-	Valid values for DC DC frequency is [Hz]:
-	250000
-	410000
-	650000
- - adi,dc-dc-max-microvolt:
-	Valid values for the maximum allowed Vboost voltage supplied by
-	the dc-to-dc converter is:
-	23000000
-	24500000
-	27000000
-	29500000
-
-Optional for every channel:
- - adi,mode:
-	Valid values for DAC modes is:
-	0: 0 V to 5 V voltage range.
-	1: 0 V to 10 V voltage range.
-	2: Plus minus 5 V voltage range.
-	3: Plus minus 10 V voltage range.
-	4: 4 mA to 20 mA current range.
-	5: 0 mA to 20 mA current range.
-	6: 0 mA to 24 mA current range.
- - adi,ext-current-sense-resistor: boolean set if the hardware a external
-				   current sense resistor.
- - adi,enable-voltage-overrange: boolean enable voltage overrange
- - adi,slew: Array of slewrate settings should contain 3 fields:
-	1: Should be either 0 or 1 in order to enable or disable slewrate.
-	2: Slew rate settings:
-		Valid values for the slew rate update frequency:
-		64000
-		32000
-		16000
-		8000
-		4000
-		2000
-		1000
-		500
-		250
-		125
-		64
-		32
-		16
-		8
-		4
-		0
-	3: Slew step size:
-		Valid values for the step size LSBs:
-		1
-		2
-		4
-		16
-		32
-		64
-		128
-		256
-
-Example:
-dac@0 {
-	#address-cells = <1>;
-	#size-cells = <0>;
-	compatible = "adi,ad5755";
-	reg = <0>;
-	spi-max-frequency = <1000000>;
-	spi-cpha;
-	adi,dc-dc-phase = <0>;
-	adi,dc-dc-freq-hz = <410000>;
-	adi,dc-dc-max-microvolt = <23000000>;
-	channel@0 {
-		reg = <0>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@1 {
-		reg = <1>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@2 {
-		reg = <2>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-	channel@3 {
-		reg = <3>;
-		adi,mode = <4>;
-		adi,ext-current-sense-resistor;
-		adi,slew = <0 64000 1>;
-	};
-};
diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
new file mode 100644
index 000000000000..5d6a87f28b12
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
@@ -0,0 +1,171 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices AD5755 Multi-Channel DAC
+
+maintainers:
+  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
+
+properties:
+  compatible:
+    enum:
+      - adi,ad5755
+      - adi,ad5755-1
+      - adi,ad5757
+      - adi,ad5735
+      - adi,ad5737
+
+  reg:
+    maxItems: 1
+
+  spi-cpha:
+    description: Either this or spi-cpol but not both.
+  spi-cpol: true
+
+  spi-max-frequency: true
+
+  adi,ext-dc-dc-compenstation-resistor:
+    $ref: /schemas/types.yaml#/definitions/flag
+    description:
+      Set if the hardware have an external resistor and thereby bypasses
+      the internal compensation resistor.
+
+  adi,dc-dc-phase:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [0, 1, 2, 3]
+    description: |
+      Valid values for DC DC Phase control is:
+      0: All dc-to-dc converters clock on the same edge.
+      1: Channel A and Channel B clock on the same edge,
+         Channel C and Channel D clock on opposite edges.
+      2: Channel A and Channel C clock on the same edge,
+         Channel B and Channel D clock on opposite edges.
+      3: Channel A, Channel B, Channel C, and Channel D
+         clock 90 degrees out of phase from each other.
+
+  adi,dc-dc-freq-hz:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [250000, 410000, 650000]
+
+  adi,dc-dc-max-microvolt:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
+    enum: [23000000, 24500000, 27000000, 29500000]
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  "#io-channel-cells":
+    const: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+patternProperties:
+  "^(channel@)[0-7]$":
+    type: object
+    description: Child node to describe a channel
+    properties:
+      reg:
+        maxItems: 1
+
+      adi,mode:
+        $ref: /schemas/types.yaml#/definitions/uint32
+        minimum: 0
+        maximum: 6
+        description: |
+          Valid values for DAC modes is:
+          0: 0 V to 5 V voltage range.
+          1: 0 V to 10 V voltage range.
+          2: Plus minus 5 V voltage range.
+          3: Plus minus 10 V voltage range.
+          4: 4 mA to 20 mA current range.
+          5: 0 mA to 20 mA current range.
+          6: 0 mA to 24 mA current range.
+
+      adi,ext-current-sense-resistor:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description:
+          Set if the hardware has an external current sense resistor
+
+      adi,enable-voltage-overrange:
+        $ref: /schemas/types.yaml#/definitions/flag
+        description: Enable voltage overrange
+
+      adi,slew:
+        $ref: /schemas/types.yaml#/definitions/uint32-array
+        description: |
+          Array of slewrate settings should contain 3 fields:
+          1: Should be either 0 or 1 in order to enable or disable slewrate.
+          2: Slew rate update frequency
+          3: Slew step size
+        items:
+          - enum: [0, 1]
+          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
+          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
+
+    required:
+      - reg
+
+    additionalProperties: false
+
+oneOf:
+  - required:
+      - spi-cpha
+  - required:
+      - spi-cpol
+
+examples:
+  - |
+    #include <dt-bindings/iio/adi,ad5592r.h>
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            #address-cells = <1>;
+            #size-cells = <0>;
+            compatible = "adi,ad5755";
+            reg = <0>;
+            spi-max-frequency = <1000000>;
+            spi-cpha;
+            adi,dc-dc-phase = <0>;
+            adi,dc-dc-freq-hz = <410000>;
+            adi,dc-dc-max-microvolt = <23000000>;
+            channel@0 {
+                reg = <0>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@1 {
+                reg = <1>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@2 {
+                reg = <2>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+            channel@3 {
+                reg = <3>;
+                adi,mode = <4>;
+                adi,ext-current-sense-resistor;
+                adi,slew = <0 64000 1>;
+            };
+        };
+    };
+...
-- 
2.31.1


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

* [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion
  2021-04-01 14:09 [PATCH 0/2] dt-bindings:iio:yaml conversions with xor condition Jonathan Cameron
  2021-04-01 14:09 ` [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion Jonathan Cameron
@ 2021-04-01 14:09 ` Jonathan Cameron
  2021-04-09 14:31   ` Rob Herring
  1 sibling, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2021-04-01 14:09 UTC (permalink / raw)
  To: linux-iio, Rob Herring; +Cc: devicetree, Jonathan Cameron, Lukas Wunner

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

Fairly simple conversion with the exception of the XOR between
spi-cpha and spi-cpol.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lukas Wunner <lukas@wunner.de>
Link: https://lore.kernel.org/r/20201031134110.724233-17-jic23@kernel.org
---
 .../bindings/iio/dac/ti,dac082s085.yaml       | 72 +++++++++++++++++++
 .../bindings/iio/dac/ti-dac082s085.txt        | 34 ---------
 2 files changed, 72 insertions(+), 34 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/dac/ti,dac082s085.yaml b/Documentation/devicetree/bindings/iio/dac/ti,dac082s085.yaml
new file mode 100644
index 000000000000..b0157050f1ee
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/dac/ti,dac082s085.yaml
@@ -0,0 +1,72 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/dac/ti,dac082s085.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Texas Instruments DAC082s085 and similar DACs
+
+description:
+  A family of Texas Instruments 8/10/12-bit 2/4-channel DACs
+
+maintainers:
+  - Lukas Wunner <lukas@wunner.de>
+
+properties:
+  compatible:
+    enum:
+      - ti,dac082s085
+      - ti,dac102s085
+      - ti,dac122s085
+      - ti,dac084s085
+      - ti,dac104s085
+      - ti,dac124s085
+
+  reg:
+    maxItems: 1
+
+  spi-cpha: true
+  spi-cpol:
+    description:
+      Must be either spi-cpha, or spi-cpol but not both.
+
+  vref-supply:
+    description: Needed to provide output scaling.
+
+  spi-max-frequency: true
+
+required:
+  - compatible
+  - reg
+  - vref-supply
+
+additionalProperties: false
+
+oneOf:
+  - required:
+      - spi-cpha
+  - required:
+      - spi-cpol
+
+examples:
+  - |
+    vref_2v5_reg: regulator-vref {
+        compatible = "regulator-fixed";
+        regulator-name = "2v5";
+        regulator-min-microvolt = <2500000>;
+        regulator-max-microvolt = <2500000>;
+        regulator-always-on;
+    };
+    spi {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        dac@0 {
+            compatible = "ti,dac082s085";
+            reg = <0>;
+            spi-max-frequency = <40000000>;
+            spi-cpol;
+            vref-supply = <&vref_2v5_reg>;
+        };
+    };
+...
diff --git a/Documentation/devicetree/bindings/iio/dac/ti-dac082s085.txt b/Documentation/devicetree/bindings/iio/dac/ti-dac082s085.txt
deleted file mode 100644
index 9cb0e10df704..000000000000
--- a/Documentation/devicetree/bindings/iio/dac/ti-dac082s085.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-Texas Instruments 8/10/12-bit 2/4-channel DAC driver
-
-Required properties:
- - compatible:		Must be one of:
-			"ti,dac082s085"
-			"ti,dac102s085"
-			"ti,dac122s085"
-			"ti,dac084s085"
-			"ti,dac104s085"
-			"ti,dac124s085"
- - reg: 		Chip select number.
- - spi-cpha, spi-cpol:	SPI mode (0,1) or (1,0) must be used, so specify
-			either spi-cpha or spi-cpol (but not both).
- - vref-supply: 	Phandle to the external reference voltage supply.
-
-For other required and optional properties of SPI slave nodes please refer to
-../../spi/spi-bus.txt.
-
-Example:
-	vref_2v5_reg: regulator-vref {
-		compatible = "regulator-fixed";
-		regulator-name = "2v5";
-		regulator-min-microvolt = <2500000>;
-		regulator-max-microvolt = <2500000>;
-		regulator-always-on;
-	};
-
-	dac@0 {
-		compatible = "ti,dac082s085";
-		reg = <0>;
-		spi-max-frequency = <40000000>;
-		spi-cpol;
-		vref-supply = <&vref_2v5_reg>;
-	};
-- 
2.31.1


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

* Re: [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion.
  2021-04-01 14:09 ` [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion Jonathan Cameron
@ 2021-04-09 14:30   ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-04-09 14:30 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, devicetree, Jonathan Cameron, Sean Nyekjaer

On Thu, Apr 01, 2021 at 03:09:55PM +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Straight forward conversion.  Only fiddly bit is the XOR of
> spi-cpol and spi-cpha.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> Link: https://lore.kernel.org/r/20201031184854.745828-40-jic23@kernel.org
> ---
>  .../devicetree/bindings/iio/dac/ad5755.txt    | 124 -------------
>  .../bindings/iio/dac/adi,ad5755.yaml          | 171 ++++++++++++++++++
>  2 files changed, 171 insertions(+), 124 deletions(-)


> diff --git a/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> new file mode 100644
> index 000000000000..5d6a87f28b12
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/dac/adi,ad5755.yaml
> @@ -0,0 +1,171 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/iio/dac/adi,ad5755.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Analog Devices AD5755 Multi-Channel DAC
> +
> +maintainers:
> +  - Sean Nyekjaer <sean.nyekjaer@prevas.dk>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,ad5755
> +      - adi,ad5755-1
> +      - adi,ad5757
> +      - adi,ad5735
> +      - adi,ad5737
> +
> +  reg:
> +    maxItems: 1
> +
> +  spi-cpha:
> +    description: Either this or spi-cpol but not both.
> +  spi-cpol: true
> +
> +  spi-max-frequency: true
> +
> +  adi,ext-dc-dc-compenstation-resistor:
> +    $ref: /schemas/types.yaml#/definitions/flag
> +    description:
> +      Set if the hardware have an external resistor and thereby bypasses
> +      the internal compensation resistor.
> +
> +  adi,dc-dc-phase:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [0, 1, 2, 3]
> +    description: |
> +      Valid values for DC DC Phase control is:
> +      0: All dc-to-dc converters clock on the same edge.
> +      1: Channel A and Channel B clock on the same edge,
> +         Channel C and Channel D clock on opposite edges.
> +      2: Channel A and Channel C clock on the same edge,
> +         Channel B and Channel D clock on opposite edges.
> +      3: Channel A, Channel B, Channel C, and Channel D
> +         clock 90 degrees out of phase from each other.
> +
> +  adi,dc-dc-freq-hz:
> +    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type ref.

> +    enum: [250000, 410000, 650000]
> +
> +  adi,dc-dc-max-microvolt:
> +    $ref: /schemas/types.yaml#/definitions/uint32

Don't need a type ref.

> +    description:
> +      Maximum allowed Vboost voltage supplied by the dc-to-dc converter.
> +    enum: [23000000, 24500000, 27000000, 29500000]
> +
> +  "#address-cells":
> +    const: 1
> +
> +  "#size-cells":
> +    const: 0
> +
> +  "#io-channel-cells":
> +    const: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +patternProperties:
> +  "^(channel@)[0-7]$":

Don't need ().

> +    type: object
> +    description: Child node to describe a channel
> +    properties:
> +      reg:
> +        maxItems: 1
> +
> +      adi,mode:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        minimum: 0
> +        maximum: 6
> +        description: |
> +          Valid values for DAC modes is:
> +          0: 0 V to 5 V voltage range.
> +          1: 0 V to 10 V voltage range.
> +          2: Plus minus 5 V voltage range.
> +          3: Plus minus 10 V voltage range.
> +          4: 4 mA to 20 mA current range.
> +          5: 0 mA to 20 mA current range.
> +          6: 0 mA to 24 mA current range.
> +
> +      adi,ext-current-sense-resistor:
> +        $ref: /schemas/types.yaml#/definitions/flag
> +        description:
> +          Set if the hardware has an external current sense resistor
> +
> +      adi,enable-voltage-overrange:
> +        $ref: /schemas/types.yaml#/definitions/flag
> +        description: Enable voltage overrange
> +
> +      adi,slew:
> +        $ref: /schemas/types.yaml#/definitions/uint32-array
> +        description: |
> +          Array of slewrate settings should contain 3 fields:
> +          1: Should be either 0 or 1 in order to enable or disable slewrate.
> +          2: Slew rate update frequency
> +          3: Slew step size
> +        items:
> +          - enum: [0, 1]
> +          - enum: [64000, 32000, 16000, 8000, 4000, 2000, 1000, 500, 250, 125, 64, 32, 16, 8, 4, 0]
> +          - enum: [1, 2, 4, 16, 32, 64, 128, 256]
> +
> +    required:
> +      - reg
> +
> +    additionalProperties: false
> +
> +oneOf:
> +  - required:
> +      - spi-cpha
> +  - required:
> +      - spi-cpol
> +
> +examples:
> +  - |
> +    #include <dt-bindings/iio/adi,ad5592r.h>
> +    spi {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        dac@0 {
> +            #address-cells = <1>;
> +            #size-cells = <0>;
> +            compatible = "adi,ad5755";
> +            reg = <0>;
> +            spi-max-frequency = <1000000>;
> +            spi-cpha;
> +            adi,dc-dc-phase = <0>;
> +            adi,dc-dc-freq-hz = <410000>;
> +            adi,dc-dc-max-microvolt = <23000000>;
> +            channel@0 {
> +                reg = <0>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@1 {
> +                reg = <1>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@2 {
> +                reg = <2>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +            channel@3 {
> +                reg = <3>;
> +                adi,mode = <4>;
> +                adi,ext-current-sense-resistor;
> +                adi,slew = <0 64000 1>;
> +            };
> +        };
> +    };
> +...
> -- 
> 2.31.1
> 

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

* Re: [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion
  2021-04-01 14:09 ` [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion Jonathan Cameron
@ 2021-04-09 14:31   ` Rob Herring
  2021-04-24 17:23     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Rob Herring @ 2021-04-09 14:31 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: devicetree, Lukas Wunner, Jonathan Cameron, Rob Herring, linux-iio

On Thu, 01 Apr 2021 15:09:56 +0100, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> Fairly simple conversion with the exception of the XOR between
> spi-cpha and spi-cpol.
> 
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Lukas Wunner <lukas@wunner.de>
> Link: https://lore.kernel.org/r/20201031134110.724233-17-jic23@kernel.org
> ---
>  .../bindings/iio/dac/ti,dac082s085.yaml       | 72 +++++++++++++++++++
>  .../bindings/iio/dac/ti-dac082s085.txt        | 34 ---------
>  2 files changed, 72 insertions(+), 34 deletions(-)
> 

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

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

* Re: [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion
  2021-04-09 14:31   ` Rob Herring
@ 2021-04-24 17:23     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2021-04-24 17:23 UTC (permalink / raw)
  To: Rob Herring
  Cc: devicetree, Lukas Wunner, Jonathan Cameron, Rob Herring, linux-iio

On Fri, 9 Apr 2021 09:31:15 -0500
Rob Herring <robh@kernel.org> wrote:

> On Thu, 01 Apr 2021 15:09:56 +0100, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > 
> > Fairly simple conversion with the exception of the XOR between
> > spi-cpha and spi-cpol.
> > 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > Cc: Lukas Wunner <lukas@wunner.de>
> > Link: https://lore.kernel.org/r/20201031134110.724233-17-jic23@kernel.org
> > ---
> >  .../bindings/iio/dac/ti,dac082s085.yaml       | 72 +++++++++++++++++++
> >  .../bindings/iio/dac/ti-dac082s085.txt        | 34 ---------
> >  2 files changed, 72 insertions(+), 34 deletions(-)
> >   
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied to the togreg branch of iio.git and pushed out as testing for
all the normal reasons.

Thanks,

Jonathan


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

end of thread, other threads:[~2021-04-24 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 14:09 [PATCH 0/2] dt-bindings:iio:yaml conversions with xor condition Jonathan Cameron
2021-04-01 14:09 ` [PATCH 1/2] dt-bindings:iio:dac:ad5755: txt to yaml format conversion Jonathan Cameron
2021-04-09 14:30   ` Rob Herring
2021-04-01 14:09 ` [PATCH 2/2] dt-bindings:iio:dac:ti,dac082s085 yaml conversion Jonathan Cameron
2021-04-09 14:31   ` Rob Herring
2021-04-24 17:23     ` 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.