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 <mripard@kernel.org>
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      - const: allwinner,sun50i-h6-i2s
28
29  reg:
30    maxItems: 1
31
32  interrupts:
33    maxItems: 1
34
35  clocks:
36    items:
37      - description: Bus Clock
38      - description: Module Clock
39
40  clock-names:
41    items:
42      - const: apb
43      - const: mod
44
45  # Even though it only applies to subschemas under the conditionals,
46  # not listing them here will trigger a warning because of the
47  # additionalsProperties set to false.
48  dmas: true
49  dma-names: true
50  resets:
51    maxItems: 1
52
53allOf:
54  - if:
55      properties:
56        compatible:
57          contains:
58            enum:
59              - allwinner,sun6i-a31-i2s
60              - allwinner,sun8i-a83t-i2s
61              - allwinner,sun8i-h3-i2s
62              - allwinner,sun50i-a64-codec-i2s
63              - allwinner,sun50i-h6-i2s
64
65    then:
66      required:
67        - resets
68
69  - if:
70      properties:
71        compatible:
72          contains:
73            enum:
74              - allwinner,sun8i-a83t-i2s
75              - allwinner,sun8i-h3-i2s
76
77    then:
78      properties:
79        dmas:
80          minItems: 1
81          maxItems: 2
82          items:
83            - description: RX DMA Channel
84            - description: TX DMA Channel
85          description:
86            Some controllers cannot receive but can only transmit
87            data. In such a case, the RX DMA channel is to be omitted.
88
89        dma-names:
90          oneOf:
91            - items:
92                - const: rx
93                - const: tx
94            - const: tx
95          description:
96            Some controllers cannot receive but can only transmit
97            data. In such a case, the RX name is to be omitted.
98
99    else:
100      properties:
101        dmas:
102          items:
103            - description: RX DMA Channel
104            - description: TX DMA Channel
105
106        dma-names:
107          items:
108            - const: rx
109            - const: tx
110
111required:
112  - "#sound-dai-cells"
113  - compatible
114  - reg
115  - interrupts
116  - clocks
117  - clock-names
118  - dmas
119  - dma-names
120
121additionalProperties: false
122
123examples:
124  - |
125    i2s0: i2s@1c22400 {
126        #sound-dai-cells = <0>;
127        compatible = "allwinner,sun4i-a10-i2s";
128        reg = <0x01c22400 0x400>;
129        interrupts = <0 16 4>;
130        clocks = <&apb0_gates 3>, <&i2s0_clk>;
131        clock-names = "apb", "mod";
132        dmas = <&dma 0 3>, <&dma 0 3>;
133        dma-names = "rx", "tx";
134    };
135
136...
137