Skip to contentSkip to conversation

Convert atmel-ssc.txt to YAML

PATCH Superseded Andrei Simion 3 participants 8 messages Jan 28, 2025 – Jan 30, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Convert atmel-ssc.txt to YAML

This patch set converts atmel-ssc.txt into atmel,at91-ssc.yaml and update the documentation file supported for MICROCHIP SSC DRIVER

Andrei Simion (2):
dt-bindings: misc: atmel,at91-ssc: Convert to YAML format
MAINTAINERS: Update the documentation file supported for MICROCHIP SSC
DRIVER

 .../bindings/misc/atmel,at91-ssc.yaml         | 111 ++++++++++++++++++
 .../devicetree/bindings/misc/atmel-ssc.txt    |  50 --------
 MAINTAINERS                                   |   2 +-
 3 files changed, 112 insertions(+), 51 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml
 delete mode 100644 Documentation/devicetree/bindings/misc/atmel-ssc.txt

base-commit: 9a87ce288fe30f268b3a598422fe76af9bb2c2d2

Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 dt-bindings: misc: atmel,at91-ssc: Convert to YAML format

Convert devicetree binding atmel-ssc.txt to YAML format.

---
 .../bindings/misc/atmel,at91-ssc.yaml         | 111 ++++++++++++++++++
 .../devicetree/bindings/misc/atmel-ssc.txt    |  50 --------
 2 files changed, 111 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml
 delete mode 100644 Documentation/devicetree/bindings/misc/atmel-ssc.txt
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +111 -0
new file mode 100644
index 0000000000000..a37ee5e58fa58
@@ -0,0 +1,111 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/atmel,at91-ssc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Serial Synchronous Serial (SSC)
+
+maintainers:
+  - Andrei Simion <[email protected]>
+
+description:
+  The Atmel Synchronous Serial Controller (SSC) provides a versatile
+  synchronous communication link for audio and telecom applications,
+  supporting protocols like I2S, Short Frame Sync, and Long Frame Sync.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - atmel,at91rm9200-ssc
+          - atmel,at91sam9g45-ssc
+      - items:
+          - const: microchip,sam9x7-ssc
+          - const: atmel,at91sam9g45-ssc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: pclk
+
+  dmas:
+    items:
+      - description: TX DMA Channel
+      - description: RX DMA Channel
+
+  dma-names:
+    description: Names of the DMA channels.
+    items:
+      - const: tx
+      - const: rx
+
+  atmel,clk-from-rk-pin:
+    description:
+      Specify the clock source for the SSC (Synchronous Serial Controller)
+      when operating in slave mode. By default, the clock is sourced from
+      the TK pin. Set this property to true to source the clock from
+      the RK pin instead, based on your hardware design requirements.
+    type: boolean
+
+allOf:
+  - $ref: ../sound/dai-common.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,at91sam9g45-ssc
+    then:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - dmas
+        - dma-names
+        - clocks
+        - clock-names
+    else:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - clocks
+        - clock-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    ssc@100000 {
+       compatible = "atmel,at91sam9g45-ssc";
+       reg = <0x100000 0x4000>;
+       interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+       dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                     AT91_XDMAC_DT_PERID(38))>,
+              <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                     AT91_XDMAC_DT_PERID(39))>;
+       dma-names = "tx", "rx";
+       clocks = <&pmc PMC_TYPE_PERIPHERAL 28>;
+       clock-names = "pclk";
+    };
+
+    ssc@c00000 {
+      compatible = "atmel,at91rm9200-ssc";
+      reg = <0xc00000 0x4000>;
+      interrupts = <14 IRQ_TYPE_LEVEL_HIGH 5>;
+      clocks = <&pmc PMC_TYPE_PERIPHERAL 14>;
+      clock-names = "pclk";
+    };
Documentation/devicetree/bindings/misc/atmel-ssc.txt deleted +0 -50

50 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH 1/2] dt-bindings: misc: atmel,at91-ssc: Convert to YAML format

Quoted 8 lines · Andrei Simion

Convert devicetree binding atmel-ssc.txt to YAML format.

---
 .../bindings/misc/atmel,at91-ssc.yaml         | 111 ++++++++++++++++++
 .../devicetree/bindings/misc/atmel-ssc.txt    |  50 --------
 2 files changed, 111 insertions(+), 50 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml

Please place it in sound directory. Or soc if this is not ASoC, but including dai-common is clear indication.

Quoted 22 lines
 delete mode 100644 Documentation/devicetree/bindings/misc/atmel-ssc.txt
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +14 -0
new file mode 100644
index 0000000000000..a37ee5e58fa58
@@ -0,0 +1,111 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/misc/atmel,at91-ssc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Atmel Serial Synchronous Serial (SSC)
+
+maintainers:
+  - Andrei Simion <[email protected]>
+
+description:
+  The Atmel Synchronous Serial Controller (SSC) provides a versatile
+  synchronous communication link for audio and telecom applications,

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 24

Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +10 -0
+  supporting protocols like I2S, Short Frame Sync, and Long Frame Sync.
+
+properties:
+  compatible:
+    oneOf:
+      - enum:
+          - atmel,at91rm9200-ssc
+          - atmel,at91sam9g45-ssc
+      - items:
+          - const: microchip,sam9x7-ssc

This wasn't in the binding and your commit msg is silent. You need to explain all changes done to the binding during conversion.

Quoted 12 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +12 -0
+          - const: atmel,at91sam9g45-ssc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 46

Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +10 -0
+    items:
+      - const: pclk
+
+  dmas:
+    items:
+      - description: TX DMA Channel
+      - description: RX DMA Channel
+
+  dma-names:
+    description: Names of the DMA channels.

Drop description

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 55

Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +9 -0
+    items:
+      - const: tx
+      - const: rx
+
+  atmel,clk-from-rk-pin:
+    description:
+      Specify the clock source for the SSC (Synchronous Serial Controller)
+      when operating in slave mode. By default, the clock is sourced from
+      the TK pin. Set this property to true to source the clock from

You cannot set this property to true. This can be present or can be missing

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 58

Quoted 3 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +3 -0
+      the RK pin instead, based on your hardware design requirements.
+    type: boolean
+

Missing dai-cells. Old binding said 0, now you say anything...

Missing required block

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 60

Quoted 2 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +2 -0
+allOf:
+  - $ref: ../sound/dai-common.yaml#

Full path, so /schemas/

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 73

Quoted 13 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +13 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,at91sam9g45-ssc
+    then:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - dmas
+        - dma-names

So only dmas?

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 82

Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +9 -0
+        - clocks
+        - clock-names
+    else:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - clocks
+        - clock-names

Drop entire required:

Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +10 -0
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/at91.h>
+    #include <dt-bindings/dma/at91.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+
+    ssc@100000 {

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 102

Quoted 10 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +10 -0
+       compatible = "atmel,at91sam9g45-ssc";
+       reg = <0x100000 0x4000>;
+       interrupts = <28 IRQ_TYPE_LEVEL_HIGH 5>;
+       dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                     AT91_XDMAC_DT_PERID(38))>,
+              <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
+                     AT91_XDMAC_DT_PERID(39))>;
+       dma-names = "tx", "rx";
+       clocks = <&pmc PMC_TYPE_PERIPHERAL 28>;
+       clock-names = "pclk";

Make the binding complee - dai properties.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/2] dt-bindings: misc: atmel,at91-ssc: Convert to YAML format

Hi,

Thank you for the review.

I will place this in: Documentation/devicetree/bindings/sound/ because the SSC it is used only for Audio.

Quoted 36 lines

Missing dai-cells. Old binding said 0, now you say anything...

Missing required block

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 60

Quoted 2 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +2 -0
+allOf:
+  - $ref: ../sound/dai-common.yaml#

Full path, so /schemas/

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 73

Quoted 13 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +13 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,at91sam9g45-ssc
+    then:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - dmas
+        - dma-names

So only dmas?

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 82

Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +9 -0
+        - clocks
+        - clock-names
+    else:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - clocks
+        - clock-names
Quoted 2 lines

Drop entire required:

I have a question:

1) The old binding said if "atmel,at91sam9g45-ssc": add dmas and DMA-names to the list:
- compatible, reg, interrupts, clock-names, clocks
Why do you ask: "drop entire required"?
I intended to set the required through a conditional.
case 1) dma transfer
case 2) pdc transfer

Best Regards,
Andrei Simion

#4 lore raw

Re: [PATCH 1/2] dt-bindings: misc: atmel,at91-ssc: Convert to YAML format

Quoted 43 lines · Andrei Simion

Hi,

Thank you for the review.

I will place this in: Documentation/devicetree/bindings/sound/ because the SSC it is used only for Audio.

Quoted 36 lines

Missing dai-cells. Old binding said 0, now you say anything...

Missing required block

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 60

Quoted 2 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +2 -0
+allOf:
+  - $ref: ../sound/dai-common.yaml#

Full path, so /schemas/

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 73

Quoted 13 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +13 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,at91sam9g45-ssc
+    then:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - dmas
+        - dma-names

So only dmas?

Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +9 -0
+        - clocks
+        - clock-names
+    else:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - clocks
+        - clock-names
Quoted 8 lines
Quoted 2 lines

Drop entire required:

I have a question:

1) The old binding said if "atmel,at91sam9g45-ssc": add dmas and DMA-names to the list:
- compatible, reg, interrupts, clock-names, clocks
Why do you ask: "drop entire required"?

The bits that are required in both cases can be set outside the conditional, so you can do something like

if:
foo
then:
required:
- dmas
- dma-names

required:
- compatible
- reg
- interrupts
- clocks
- clock-names

which I think captures all of what you're trying to do in the quote above.

Quoted 3 lines

I intended to set the required through a conditional.
case 1) dma transfer
case 2) pdc transfer

#5 lore raw

Re: [PATCH 1/2] dt-bindings: misc: atmel,at91-ssc: Convert to YAML format

In reply to Andrei Simion
Quoted 11 lines · Andrei Simion

Hi,

Thank you for the review.

I will place this in: Documentation/devicetree/bindings/sound/ because the SSC it is used only for Audio.

Quoted 4 lines

Missing dai-cells. Old binding said 0, now you say anything...

Missing required block

Here, look.

Quoted 35 lines
Quoted 32 lines

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 60

Quoted 3 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +2 -0
+allOf:
+  - $ref: ../sound/dai-common.yaml#

Full path, so /schemas/

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 73

Quoted 13 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +13 -0
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - atmel,at91sam9g45-ssc
+    then:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - dmas
+        - dma-names

So only dmas?

Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml line 82

Quoted 9 lines
Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml new file +9 -0
+        - clocks
+        - clock-names
+    else:
+      required:
+        - compatible
+        - reg
+        - interrupts
+        - clocks
+        - clock-names
Quoted 2 lines

Drop entire required:

Quoted 8 lines

I have a question:

1) The old binding said if "atmel,at91sam9g45-ssc": add dmas and DMA-names to the list:
- compatible, reg, interrupts, clock-names, clocks
Why do you ask: "drop entire required"?
I intended to set the required through a conditional.
case 1) dma transfer
case 2) pdc transfer

I commented earlier on missing required block in top-level.

Best regards,
Krzysztof

#6 lore raw

PATCH 2/2 MAINTAINERS: Update the documentation file supported for MICROCHIP SSC DRIVER

In reply to Andrei Simion

Replace the documentation file supported after the conversion of atmel-ssc.txt to YAML schema named atmel,at91-ssc.yaml.

---
 MAINTAINERS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
MAINTAINERS +1 -1
index 02430335012a6..113a2d17fb8bc 100644
@@ -15633,7 +15633,7 @@ M:	Claudiu Beznea <[email protected]>
 M:	Andrei Simion <[email protected]>
 L:	[email protected] (moderated for non-subscribers)
 S:	Supported
-F:	Documentation/devicetree/bindings/misc/atmel-ssc.txt
+F:	Documentation/devicetree/bindings/misc/atmel,at91-ssc.yaml
 F:	drivers/misc/atmel-ssc.c
 F:	include/linux/atmel-ssc.h
 
Signature · 1 line
2.34.1
#7 lore raw

Re: [PATCH 2/2] MAINTAINERS: Update the documentation file supported for MICROCHIP SSC DRIVER

Quoted 5 lines · Andrei Simion

Replace the documentation file supported after the conversion of atmel-ssc.txt to YAML schema named atmel,at91-ssc.yaml.

NAK

That's NEVER a separate patch. Your patchset is not bisectable.

Best regards,
Krzysztof