1# SPDX-License-Identifier: (GPL-2.0+ OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/allwinner,sun4i-a10-i2s.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Allwinner A10 I2S Controller Device Tree Bindings
8
9maintainers:
10  - Chen-Yu Tsai <wens@csie.org>
11  - Maxime Ripard <maxime.ripard@bootlin.com>
12
13properties:
14  "#sound-dai-cells":
15    const: 0
16
17  compatible:
18    oneOf:
19      - const: allwinner,sun4i-a10-i2s
20      - const: allwinner,sun6i-a31-i2s
21      - const: allwinner,sun8i-a83t-i2s
22      - const: allwinner,sun8i-h3-i2s
23      - const: allwinner,sun50i-a64-codec-i2s
24      - items:
25          - const: allwinner,sun50i-a64-i2s
26          - const: allwinner,sun8i-h3-i2s
27
28  reg:
29    maxItems: 1
30
31  interrupts:
32    maxItems: 1
33
34  clocks:
35    items:
36      - description: Bus Clock
37      - description: Module Clock
38
39  clock-names:
40    items:
41      - const: apb
42      - const: mod
43
44  # Even though it only applies to subschemas under the conditionals,
45  # not listing them here will trigger a warning because of the
46  # additionalsProperties set to false.
47  dmas: true
48  dma-names: true
49  resets:
50    maxItems: 1
51
52allOf:
53  - if:
54      properties:
55        compatible:
56          contains:
57            enum:
58              - allwinner,sun6i-a31-i2s
59              - allwinner,sun8i-a83t-i2s
60              - allwinner,sun8i-h3-i2s
61              - allwinner,sun50i-a64-codec-i2s
62
63    then:
64      required:
65        - resets
66
67  - if:
68      properties:
69        compatible:
70          contains:
71            const: allwinner,sun8i-a83t-i2s
72
73    then:
74      properties:
75        dmas:
76          minItems: 1
77          maxItems: 2
78          items:
79            - description: RX DMA Channel
80            - description: TX DMA Channel
81          description:
82            Some controllers cannot receive but can only transmit
83            data. In such a case, the RX DMA channel is to be omitted.
84
85        dma-names:
86          oneOf:
87            - items:
88                - const: rx
89                - const: tx
90            - const: tx
91          description:
92            Some controllers cannot receive but can only transmit
93            data. In such a case, the RX name is to be omitted.
94
95    else:
96      properties:
97        dmas:
98          items:
99            - description: RX DMA Channel
100            - description: TX DMA Channel
101
102        dma-names:
103          items:
104            - const: rx
105            - const: tx
106
107required:
108  - "#sound-dai-cells"
109  - compatible
110  - reg
111  - interrupts
112  - clocks
113  - clock-names
114  - dmas
115  - dma-names
116
117additionalProperties: false
118
119examples:
120  - |
121    i2s0: i2s@1c22400 {
122        #sound-dai-cells = <0>;
123        compatible = "allwinner,sun4i-a10-i2s";
124        reg = <0x01c22400 0x400>;
125        interrupts = <0 16 4>;
126        clocks = <&apb0_gates 3>, <&i2s0_clk>;
127        clock-names = "apb", "mod";
128        dmas = <&dma 0 3>, <&dma 0 3>;
129        dma-names = "rx", "tx";
130    };
131
132...
133