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