dt-bindings: iio: adc: use spi-peripheral-props.yaml
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Tue, 16 Aug 2022 12:43:12 +0000 (15:43 +0300)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Fri, 19 Aug 2022 18:34:16 +0000 (19:34 +0100)
Instead of listing directly properties typical for SPI peripherals,
reference the spi-peripheral-props.yaml schema.  This allows using all
properties typical for SPI-connected devices, even these which device
bindings author did not tried yet.

Remove the spi-* properties which now come via spi-peripheral-props.yaml
schema, except for the cases when device schema adds some constraints
like maximum frequency.

While changing additionalProperties->unevaluatedProperties, put it in
typical place, just before example DTS.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220816124321.67817-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
30 files changed:
Documentation/devicetree/bindings/iio/adc/adi,ad7124.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7192.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7280a.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7292.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7298.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7476.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7606.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7923.yaml
Documentation/devicetree/bindings/iio/adc/adi,ad7949.yaml
Documentation/devicetree/bindings/iio/adc/holt,hi8435.yaml
Documentation/devicetree/bindings/iio/adc/lltc,ltc2496.yaml
Documentation/devicetree/bindings/iio/adc/maxim,max1027.yaml
Documentation/devicetree/bindings/iio/adc/maxim,max11100.yaml
Documentation/devicetree/bindings/iio/adc/maxim,max1118.yaml
Documentation/devicetree/bindings/iio/adc/maxim,max1241.yaml
Documentation/devicetree/bindings/iio/adc/microchip,mcp3201.yaml
Documentation/devicetree/bindings/iio/adc/microchip,mcp3911.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc0832.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc084s021.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc108s102.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc12138.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc128s052.yaml
Documentation/devicetree/bindings/iio/adc/ti,adc161s626.yaml
Documentation/devicetree/bindings/iio/adc/ti,ads124s08.yaml
Documentation/devicetree/bindings/iio/adc/ti,ads131e08.yaml
Documentation/devicetree/bindings/iio/adc/ti,ads8344.yaml
Documentation/devicetree/bindings/iio/adc/ti,ads8688.yaml
Documentation/devicetree/bindings/iio/adc/ti,tlc4541.yaml
Documentation/devicetree/bindings/iio/adc/ti,tsc2046.yaml

index fb3d0dae9bae95cf2fbad37710a5d083812b88e8..75a7184a47352d0b95bbb2db380292fca9c5ca06 100644 (file)
@@ -52,8 +52,6 @@ properties:
   avdd-supply:
     description: avdd supply can be used as reference for conversion.
 
-  spi-max-frequency: true
-
 required:
   - compatible
   - reg
@@ -106,7 +104,10 @@ patternProperties:
 
     additionalProperties: false
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 22b7ed3723f6735360f7515b722607979e13e3aa..cc347dade4ef5f099ff30405fad5c7a00c7c2790 100644 (file)
@@ -30,8 +30,6 @@ properties:
 
   spi-cpha: true
 
-  spi-max-frequency: true
-
   clocks:
     maxItems: 1
     description: phandle to the master clock (mclk)
@@ -94,7 +92,10 @@ required:
   - spi-cpol
   - spi-cpha
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index a694d5794d4a07e17f9576f1d0222853c66c1bec..dfb8f305e2f0bf8a5107d39e4faa435b9d9a3fbb 100644 (file)
@@ -28,8 +28,6 @@ properties:
     description: IRQ line for the ADC
     maxItems: 1
 
-  spi-max-frequency: true
-
   adi,voltage-alert-last-chan:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -55,7 +53,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index a3e39a40c9b3ea5df8d5b06ba00790aa69293e57..1bfbeed6f2999a091f1582c2fa55a2fb6e35fe77 100644 (file)
@@ -30,8 +30,6 @@ properties:
 
   spi-cpha: true
 
-  spi-max-frequency: true
-
   '#address-cells':
     const: 1
 
@@ -65,7 +63,10 @@ patternProperties:
 
     additionalProperties: true
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index ca414bb396c5957828183c356df59dc498294956..cd8ac5162d2759013c1762e030b82974464d27f9 100644 (file)
@@ -24,13 +24,15 @@ properties:
 
   vref-supply: true
   vdd-supply: true
-  spi-max-frequency: true
 
 required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 666414a9c0defd831e4dc561e267790ddeb61f67..44c671eeda734d6120ff53f2d22f27aa03dc9116 100644 (file)
@@ -66,8 +66,6 @@ properties:
       to the other supplies. Needed to be able to establish channel scaling
       unless there is also an internal reference available (e.g. ad7091r)
 
-  spi-max-frequency: true
-
   adi,conversion-start-gpios:
     description: A GPIO used to trigger the start of a conversion
     maxItems: 1
@@ -76,9 +74,9 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
-
 allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
   # Devices where reference is vcc
   - if:
       properties:
@@ -158,6 +156,8 @@ allOf:
       properties:
         adi,conversion-start-gpios: false
 
+unevaluatedProperties: false
+
 examples:
   - |
     spi {
index 516fc24d33468a813986d97a6d09100b7c16b6f6..ac5a47c8f070b04428766cb8615b0c69c0767897 100644 (file)
@@ -32,8 +32,6 @@ properties:
 
   spi-cpol: true
 
-  spi-max-frequency: true
-
   avcc-supply: true
 
   interrupts:
@@ -105,7 +103,10 @@ required:
   - interrupts
   - adi,conversion-start-gpios
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index a85a28145ef6b8f3f673524a52a0aa2483d7239c..3ce59d4d065f5d657404f9709df40beee3ae78a3 100644 (file)
@@ -50,8 +50,6 @@ properties:
   reset-gpios:
     maxItems: 1
 
-  spi-max-frequency: true
-
   spi-cpol: true
 
   spi-cpha: true
@@ -88,7 +86,10 @@ patternProperties:
       - reg
     additionalProperties: false
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 82168b1495eb65a89daab23e7a844beeae04448d..40b0a887db57c23471b169531346463ebe9ff366 100644 (file)
@@ -42,13 +42,14 @@ properties:
   '#size-cells':
     const: 0
 
-  spi-max-frequency: true
-
 required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 0b10ed5f74aeb52ddde457fd1c78e4d5159593cb..9ee4d977c5edfa4d07ac5954869f530f42d61406 100644 (file)
@@ -49,8 +49,6 @@ properties:
     default: 4096000
 
 
-  spi-max-frequency: true
-
   '#io-channel-cells':
     const: 1
 
@@ -64,7 +62,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 52490cbb0af08755427adc08403bd986eaafe133..56bcbe5dcd798ac4aa6be0d6d8b0f6381f9db344 100644 (file)
@@ -24,8 +24,6 @@ properties:
       GPIO used for controlling the reset pin
     maxItems: 1
 
-  spi-max-frequency: true
-
   "#io-channel-cells":
     const: 1
 
@@ -33,7 +31,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 0bd2fc0356c86476eb12dbab07244ca57bd94e83..5207c919abe0e54ab8a46eeb74d082a4bbc412f0 100644 (file)
@@ -22,15 +22,15 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency:
-    description: maximal spi bus frequency supported
-
 required:
   - compatible
   - vref-supply
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 46b7747076b9b65682f6a5bceddfd8486eed1aec..d0a7ed26d9ea78c511bc82f4e8857f7f8bbe596c 100644 (file)
@@ -45,7 +45,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 0cf87556ef823c97d1ba6d387a4774ff0ed6b9f1..4f74cb33383a4f68bec347d7fb2c031220697647 100644 (file)
@@ -26,13 +26,16 @@ properties:
     minimum: 100000
     maximum: 4800000
 
-additionalProperties: false
-
 required:
   - compatible
   - reg
   - vref-supply
 
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
+
 examples:
   - |
     spi {
index e948b3e37b0c66f16a37bfa01e67b2916fe5492e..bb336e33ebe25715b7b0c9a9bb0aafb2f6341295 100644 (file)
@@ -28,23 +28,25 @@ properties:
   vref-supply:
     description: External reference, needed to establish input scaling
 
-if:
-  properties:
-    compatible:
-      contains:
-        const: maxim,max1118
-then:
-  required:
-    - vref-supply
-else:
-  properties:
-    vref-supply: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: maxim,max1118
+    then:
+      required:
+        - vref-supply
+    else:
+      properties:
+        vref-supply: false
 
 required:
   - compatible
   - reg
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
index 4c7e0d94bff1426d68017a5b3047da08eb9477a9..58b12fe8070c9b7ad6cede0e893ef84880ade014 100644 (file)
@@ -39,15 +39,16 @@ properties:
       thus enabling power-down mode.
     maxItems: 1
 
-  spi-max-frequency: true
-
 required:
   - compatible
   - reg
   - vdd-supply
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index fcc1ba53b20d3ed4da508db521370a95eb3b2e95..18108f0f37319fe40c1be7c499a1f2727e9b858e 100644 (file)
@@ -32,7 +32,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
   spi-cpha: true
   spi-cpol: true
 
@@ -51,7 +50,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 95ab285f4eba94515efbb503a90edf02509a4a31..067a7bbadab811038239f616d5e66ab0e72a522a 100644 (file)
@@ -51,7 +51,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index f5a923cc847f46c11fc7d9b10c5042498a35672f..686721176a58c391d7ee2cc09bb7bdfaff62d7fa 100644 (file)
@@ -24,8 +24,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vref-supply:
     description: External reference, needed to establish input scaling
 
@@ -37,7 +35,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 1a113b30a4146a4b0452700f1cbc6d7d930a0619..726d2cbfa368b0eed218dfb8c207fbdfa591cd61 100644 (file)
@@ -19,8 +19,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vref-supply:
     description: External reference, needed to establish input scaling
 
@@ -37,7 +35,10 @@ required:
   - spi-cpol
   - spi-cpha
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index ae5ce60987fec2ac5372d1fd620281281d2b1da8..9b072b057f164e0a7cdb47e793da14ba45739b1f 100644 (file)
@@ -19,7 +19,6 @@ properties:
 
   reg: true
   vref-supply: true
-  spi-max-frequency: true
   "#io-channel-cells":
     const: 1
 
@@ -28,7 +27,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index ec3b2edf1fb7d95220efefa8903b91a395fe331e..076088a328c3c6d009ccd71aaa30bdc10d603a24 100644 (file)
@@ -31,8 +31,6 @@ properties:
     maxItems: 1
     description: Conversion clock input.
 
-  spi-max-frequency: true
-
   vref-p-supply:
     description: The regulator supply for positive analog voltage reference
 
@@ -62,7 +60,10 @@ required:
   - clocks
   - vref-p-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index d54a0183f024d6f8c1dfdac2e4f674650a2bbf03..775eee972b12b15d3673fef02ab3d3d157e2f433 100644 (file)
@@ -27,8 +27,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vref-supply: true
 
   "#io-channel-cells":
@@ -39,7 +37,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 3f4f334d6f73294fa9cc9f87cc870b9cb636932a..afe7825229049f3dbd552fe04b61f2c893839cf7 100644 (file)
@@ -21,8 +21,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vdda-supply: true
 
   "#io-channel-cells":
@@ -32,7 +30,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 2e6abc9d746ac325b62ee971b6d5de0ca53d1f49..56a3f1766aabe5dbf2167a875ebc42da5e0b8b67 100644 (file)
@@ -18,8 +18,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   spi-cpha: true
 
   reset-gpios:
@@ -32,7 +30,10 @@ required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 2876397fc668e35295b0b8f74874dcd01f408ca9..55c2c73626f48c042d17f124f007472d9619f17d 100644 (file)
@@ -28,8 +28,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   spi-cpha: true
 
   clocks:
@@ -120,7 +118,10 @@ patternProperties:
 
     additionalProperties: false
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index b8c398187d5cb45a4fad26fb5741f8d7bc73b228..f75b2c702986dd8afdbadb6f7caf6f6d7a8052be 100644 (file)
@@ -19,8 +19,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vref-supply:
     description: Supply the 2.5V or 5V reference voltage
 
@@ -32,7 +30,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index a0af4b24877f2af224158fb9979c23147876b6aa..f26fdbc15f84f84c90b28760b71a4df6de98fd52 100644 (file)
@@ -25,13 +25,14 @@ properties:
     description: Optional external reference.  If not supplied, assume
       REFSEL input tied low to enable the internal reference.
 
-  spi-max-frequency: true
-
 required:
   - compatible
   - reg
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 6c2539b3d7077a67d486497253827fec1e27217a..314d1d99bf738aafe9cc73faf1d105127bea95d2 100644 (file)
@@ -21,8 +21,6 @@ properties:
   reg:
     maxItems: 1
 
-  spi-max-frequency: true
-
   vref-supply: true
 
   "#io-channel-cells":
@@ -33,7 +31,10 @@ required:
   - reg
   - vref-supply
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |
index 601d69971d84a97e49b51ef21f5d6ebec94074f4..0b48814c0dc2740b8d069411d7a7be33985670ca 100644 (file)
@@ -23,8 +23,6 @@ properties:
   interrupts:
     maxItems: 1
 
-  spi-max-frequency: true
-
   "#io-channel-cells":
     const: 1
 
@@ -59,7 +57,10 @@ patternProperties:
 
     additionalProperties: false
 
-additionalProperties: false
+allOf:
+  - $ref: /schemas/spi/spi-peripheral-props.yaml#
+
+unevaluatedProperties: false
 
 examples:
   - |