Re: [PATCH v2 2/4] spi: dt-bindings: samsung: convert to dtschema
From: Krzysztof Kozlowski
Date: Wed Jan 12 2022 - 04:53:10 EST
On 12/01/2022 03:25, Rob Herring wrote:
> On Tue, Jan 11, 2022 at 11:13:36AM +0100, Krzysztof Kozlowski wrote:
>> Convert the Samsung SoC (S3C24xx, S3C64xx, S5Pv210, Exynos) SPI
>> controller bindings to DT schema format
>>
>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
>> Reviewed-by: Sam Protsenko <semen.protsenko@xxxxxxxxxx>
>> ---
>> .../spi/samsung,spi-peripheral-props.yaml | 35 ++++
>> .../devicetree/bindings/spi/samsung,spi.yaml | 198 ++++++++++++++++++
>> .../bindings/spi/spi-peripheral-props.yaml | 1 +
>> .../devicetree/bindings/spi/spi-samsung.txt | 122 -----------
>> MAINTAINERS | 2 +-
>> 5 files changed, 235 insertions(+), 123 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
>> create mode 100644 Documentation/devicetree/bindings/spi/samsung,spi.yaml
>> delete mode 100644 Documentation/devicetree/bindings/spi/spi-samsung.txt
>>
>> diff --git a/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
>> new file mode 100644
>> index 000000000000..aa5a1f48494b
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/samsung,spi-peripheral-props.yaml
>> @@ -0,0 +1,35 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/spi/samsung,spi-peripheral-props.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Peripheral-specific properties for Samsung S3C/S5P/Exynos SoC SPI controller
>> +
>> +maintainers:
>> + - Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
>> +
>> +description:
>> + See spi-peripheral-props.yaml for more info.
>> +
>> +properties:
>> + controller-data:
>> + type: object
>> + additionalProperties: false
>> +
>> + properties:
>> + samsung,spi-feedback-delay:
>> + description: |
>> + The sampling phase shift to be applied on the miso line (to account
>> + for any lag in the miso line). Valid values:
>> + - 0: No phase shift.
>> + - 1: 90 degree phase shift sampling.
>> + - 2: 180 degree phase shift sampling.
>> + - 3: 270 degree phase shift sampling.
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + enum: [0, 1, 2, 3]
>> +
>> + required:
>> + - samsung,spi-feedback-delay
>> +
>> +additionalProperties: true
>> diff --git a/Documentation/devicetree/bindings/spi/samsung,spi.yaml b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
>> new file mode 100644
>> index 000000000000..da4533feb946
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/samsung,spi.yaml
>> @@ -0,0 +1,198 @@
>> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/spi/samsung,spi.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Samsung S3C/S5P/Exynos SoC SPI controller
>> +
>> +maintainers:
>> + - Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxxxxx>
>> +
>> +description:
>> + All the SPI controller nodes should be represented in the aliases node using
>> + the following format 'spi{n}' where n is a unique number for the alias.
>> +
>> +properties:
>> + compatible:
>> + oneOf:
>> + - enum:
>> + - samsung,s3c2443-spi # for S3C2443, S3C2416 and S3C2450
>> + - samsung,s3c6410-spi
>> + - samsung,s5pv210-spi # for S5PV210 and S5PC110
>> + - samsung,exynos5433-spi
>> + - const: samsung,exynos7-spi
>> + deprecated: true
>> +
>> + clocks:
>> + minItems: 2
>> + maxItems: 3
>> +
>> + clock-names:
>> + minItems: 2
>> + maxItems: 3
>> +
>> + cs-gpios: true
>> +
>> + dmas:
>> + minItems: 2
>> + maxItems: 2
>> +
>> + dma-names:
>> + items:
>> + - const: tx
>> + - const: rx
>> +
>> + interrupts:
>> + maxItems: 1
>> +
>> + no-cs-readback:
>> + description:
>> + The CS line is disconnected, therefore the device should not operate
>> + based on CS signalling.
>> + type: boolean
>> +
>> + num-cs:
>> + minimum: 1
>> + maximum: 4
>> + default: 1
>> +
>> + samsung,spi-src-clk:
>> + description:
>> + If the spi controller includes a internal clock mux to select the clock
>> + source for the spi bus clock, this property can be used to indicate the
>> + clock to be used for driving the spi bus clock. If not specified, the
>> + clock number 0 is used as default.
>> + $ref: /schemas/types.yaml#/definitions/uint32
>> + default: 0
>> +
>> + reg:
>> + maxItems: 1
>> +
>> +patternProperties:
>> + "^.*@[0-9a-f]+$":
>> + type: object
>> + allOf:
>> + - $ref: spi-peripheral-props.yaml
>> +
>> + required:
>> + - controller-data
>> +
>> + unevaluatedProperties: false
>
> This is wrong because the child nodes will certainly have device
> specific properties.
>
> The whole child node schema can be dropped.
The controller-data at this point is still required (this is merely
existing bindings conversion), but I guess we can skip it since next
commit will remove it anyway, right?
Best regards,
Krzysztof