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