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