Commit 80137388 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jonathan Cameron

dt-bindings: iio: adc: use spi-peripheral-props.yaml

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20220816124321.67817-2-krzysztof.kozlowski@linaro.orgSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 59d1c811
...@@ -52,8 +52,6 @@ properties: ...@@ -52,8 +52,6 @@ properties:
avdd-supply: avdd-supply:
description: avdd supply can be used as reference for conversion. description: avdd supply can be used as reference for conversion.
spi-max-frequency: true
required: required:
- compatible - compatible
- reg - reg
...@@ -106,7 +104,10 @@ patternProperties: ...@@ -106,7 +104,10 @@ patternProperties:
additionalProperties: false additionalProperties: false
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -30,8 +30,6 @@ properties: ...@@ -30,8 +30,6 @@ properties:
spi-cpha: true spi-cpha: true
spi-max-frequency: true
clocks: clocks:
maxItems: 1 maxItems: 1
description: phandle to the master clock (mclk) description: phandle to the master clock (mclk)
...@@ -94,7 +92,10 @@ required: ...@@ -94,7 +92,10 @@ required:
- spi-cpol - spi-cpol
- spi-cpha - spi-cpha
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -28,8 +28,6 @@ properties: ...@@ -28,8 +28,6 @@ properties:
description: IRQ line for the ADC description: IRQ line for the ADC
maxItems: 1 maxItems: 1
spi-max-frequency: true
adi,voltage-alert-last-chan: adi,voltage-alert-last-chan:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
description: description:
...@@ -55,7 +53,10 @@ required: ...@@ -55,7 +53,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -30,8 +30,6 @@ properties: ...@@ -30,8 +30,6 @@ properties:
spi-cpha: true spi-cpha: true
spi-max-frequency: true
'#address-cells': '#address-cells':
const: 1 const: 1
...@@ -65,7 +63,10 @@ patternProperties: ...@@ -65,7 +63,10 @@ patternProperties:
additionalProperties: true additionalProperties: true
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -24,13 +24,15 @@ properties: ...@@ -24,13 +24,15 @@ properties:
vref-supply: true vref-supply: true
vdd-supply: true vdd-supply: true
spi-max-frequency: true
required: required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -66,8 +66,6 @@ properties: ...@@ -66,8 +66,6 @@ properties:
to the other supplies. Needed to be able to establish channel scaling to the other supplies. Needed to be able to establish channel scaling
unless there is also an internal reference available (e.g. ad7091r) unless there is also an internal reference available (e.g. ad7091r)
spi-max-frequency: true
adi,conversion-start-gpios: adi,conversion-start-gpios:
description: A GPIO used to trigger the start of a conversion description: A GPIO used to trigger the start of a conversion
maxItems: 1 maxItems: 1
...@@ -76,9 +74,9 @@ required: ...@@ -76,9 +74,9 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false
allOf: allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
# Devices where reference is vcc # Devices where reference is vcc
- if: - if:
properties: properties:
...@@ -158,6 +156,8 @@ allOf: ...@@ -158,6 +156,8 @@ allOf:
properties: properties:
adi,conversion-start-gpios: false adi,conversion-start-gpios: false
unevaluatedProperties: false
examples: examples:
- | - |
spi { spi {
......
...@@ -32,8 +32,6 @@ properties: ...@@ -32,8 +32,6 @@ properties:
spi-cpol: true spi-cpol: true
spi-max-frequency: true
avcc-supply: true avcc-supply: true
interrupts: interrupts:
...@@ -105,7 +103,10 @@ required: ...@@ -105,7 +103,10 @@ required:
- interrupts - interrupts
- adi,conversion-start-gpios - adi,conversion-start-gpios
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -50,8 +50,6 @@ properties: ...@@ -50,8 +50,6 @@ properties:
reset-gpios: reset-gpios:
maxItems: 1 maxItems: 1
spi-max-frequency: true
spi-cpol: true spi-cpol: true
spi-cpha: true spi-cpha: true
...@@ -88,7 +86,10 @@ patternProperties: ...@@ -88,7 +86,10 @@ patternProperties:
- reg - reg
additionalProperties: false additionalProperties: false
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -42,13 +42,14 @@ properties: ...@@ -42,13 +42,14 @@ properties:
'#size-cells': '#size-cells':
const: 0 const: 0
spi-max-frequency: true
required: required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -49,8 +49,6 @@ properties: ...@@ -49,8 +49,6 @@ properties:
default: 4096000 default: 4096000
spi-max-frequency: true
'#io-channel-cells': '#io-channel-cells':
const: 1 const: 1
...@@ -64,7 +62,10 @@ required: ...@@ -64,7 +62,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -24,8 +24,6 @@ properties: ...@@ -24,8 +24,6 @@ properties:
GPIO used for controlling the reset pin GPIO used for controlling the reset pin
maxItems: 1 maxItems: 1
spi-max-frequency: true
"#io-channel-cells": "#io-channel-cells":
const: 1 const: 1
...@@ -33,7 +31,10 @@ required: ...@@ -33,7 +31,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -22,15 +22,15 @@ properties: ...@@ -22,15 +22,15 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency:
description: maximal spi bus frequency supported
required: required:
- compatible - compatible
- vref-supply - vref-supply
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -45,7 +45,10 @@ required: ...@@ -45,7 +45,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -26,13 +26,16 @@ properties: ...@@ -26,13 +26,16 @@ properties:
minimum: 100000 minimum: 100000
maximum: 4800000 maximum: 4800000
additionalProperties: false
required: required:
- compatible - compatible
- reg - reg
- vref-supply - vref-supply
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
spi { spi {
......
...@@ -28,23 +28,25 @@ properties: ...@@ -28,23 +28,25 @@ properties:
vref-supply: vref-supply:
description: External reference, needed to establish input scaling description: External reference, needed to establish input scaling
if: allOf:
properties: - $ref: /schemas/spi/spi-peripheral-props.yaml#
compatible: - if:
contains: properties:
const: maxim,max1118 compatible:
then: contains:
required: const: maxim,max1118
- vref-supply then:
else: required:
properties: - vref-supply
vref-supply: false else:
properties:
vref-supply: false
required: required:
- compatible - compatible
- reg - reg
additionalProperties: false unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -39,15 +39,16 @@ properties: ...@@ -39,15 +39,16 @@ properties:
thus enabling power-down mode. thus enabling power-down mode.
maxItems: 1 maxItems: 1
spi-max-frequency: true
required: required:
- compatible - compatible
- reg - reg
- vdd-supply - vdd-supply
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -32,7 +32,6 @@ properties: ...@@ -32,7 +32,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
spi-cpha: true spi-cpha: true
spi-cpol: true spi-cpol: true
...@@ -51,7 +50,10 @@ required: ...@@ -51,7 +50,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -51,7 +51,10 @@ required: ...@@ -51,7 +51,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -24,8 +24,6 @@ properties: ...@@ -24,8 +24,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vref-supply: vref-supply:
description: External reference, needed to establish input scaling description: External reference, needed to establish input scaling
...@@ -37,7 +35,10 @@ required: ...@@ -37,7 +35,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -19,8 +19,6 @@ properties: ...@@ -19,8 +19,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vref-supply: vref-supply:
description: External reference, needed to establish input scaling description: External reference, needed to establish input scaling
...@@ -37,7 +35,10 @@ required: ...@@ -37,7 +35,10 @@ required:
- spi-cpol - spi-cpol
- spi-cpha - spi-cpha
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -19,7 +19,6 @@ properties: ...@@ -19,7 +19,6 @@ properties:
reg: true reg: true
vref-supply: true vref-supply: true
spi-max-frequency: true
"#io-channel-cells": "#io-channel-cells":
const: 1 const: 1
...@@ -28,7 +27,10 @@ required: ...@@ -28,7 +27,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -31,8 +31,6 @@ properties: ...@@ -31,8 +31,6 @@ properties:
maxItems: 1 maxItems: 1
description: Conversion clock input. description: Conversion clock input.
spi-max-frequency: true
vref-p-supply: vref-p-supply:
description: The regulator supply for positive analog voltage reference description: The regulator supply for positive analog voltage reference
...@@ -62,7 +60,10 @@ required: ...@@ -62,7 +60,10 @@ required:
- clocks - clocks
- vref-p-supply - vref-p-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -27,8 +27,6 @@ properties: ...@@ -27,8 +27,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vref-supply: true vref-supply: true
"#io-channel-cells": "#io-channel-cells":
...@@ -39,7 +37,10 @@ required: ...@@ -39,7 +37,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -21,8 +21,6 @@ properties: ...@@ -21,8 +21,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vdda-supply: true vdda-supply: true
"#io-channel-cells": "#io-channel-cells":
...@@ -32,7 +30,10 @@ required: ...@@ -32,7 +30,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -18,8 +18,6 @@ properties: ...@@ -18,8 +18,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
spi-cpha: true spi-cpha: true
reset-gpios: reset-gpios:
...@@ -32,7 +30,10 @@ required: ...@@ -32,7 +30,10 @@ required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -28,8 +28,6 @@ properties: ...@@ -28,8 +28,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
spi-cpha: true spi-cpha: true
clocks: clocks:
...@@ -120,7 +118,10 @@ patternProperties: ...@@ -120,7 +118,10 @@ patternProperties:
additionalProperties: false additionalProperties: false
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -19,8 +19,6 @@ properties: ...@@ -19,8 +19,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vref-supply: vref-supply:
description: Supply the 2.5V or 5V reference voltage description: Supply the 2.5V or 5V reference voltage
...@@ -32,7 +30,10 @@ required: ...@@ -32,7 +30,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -25,13 +25,14 @@ properties: ...@@ -25,13 +25,14 @@ properties:
description: Optional external reference. If not supplied, assume description: Optional external reference. If not supplied, assume
REFSEL input tied low to enable the internal reference. REFSEL input tied low to enable the internal reference.
spi-max-frequency: true
required: required:
- compatible - compatible
- reg - reg
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -21,8 +21,6 @@ properties: ...@@ -21,8 +21,6 @@ properties:
reg: reg:
maxItems: 1 maxItems: 1
spi-max-frequency: true
vref-supply: true vref-supply: true
"#io-channel-cells": "#io-channel-cells":
...@@ -33,7 +31,10 @@ required: ...@@ -33,7 +31,10 @@ required:
- reg - reg
- vref-supply - vref-supply
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
...@@ -23,8 +23,6 @@ properties: ...@@ -23,8 +23,6 @@ properties:
interrupts: interrupts:
maxItems: 1 maxItems: 1
spi-max-frequency: true
"#io-channel-cells": "#io-channel-cells":
const: 1 const: 1
...@@ -59,7 +57,10 @@ patternProperties: ...@@ -59,7 +57,10 @@ patternProperties:
additionalProperties: false additionalProperties: false
additionalProperties: false allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples: examples:
- | - |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment