xref: /linux/Documentation/devicetree/bindings/sound/snps,designware-i2s.yaml (revision a1c613ae4c322ddd58d5a8539dbfba2a0380a8c0)
1bc4c9d85SConor Dooley# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2bc4c9d85SConor Dooley%YAML 1.2
3bc4c9d85SConor Dooley---
4bc4c9d85SConor Dooley$id: http://devicetree.org/schemas/sound/snps,designware-i2s.yaml#
5bc4c9d85SConor Dooley$schema: http://devicetree.org/meta-schemas/core.yaml#
6bc4c9d85SConor Dooley
7bc4c9d85SConor Dooleytitle: DesignWare I2S controller
8bc4c9d85SConor Dooley
9bc4c9d85SConor Dooleymaintainers:
10bc4c9d85SConor Dooley  - Jose Abreu <joabreu@synopsys.com>
11bc4c9d85SConor Dooley
12bc4c9d85SConor Dooleyproperties:
13bc4c9d85SConor Dooley  compatible:
14bc4c9d85SConor Dooley    oneOf:
15bc4c9d85SConor Dooley      - items:
16bc4c9d85SConor Dooley          - const: canaan,k210-i2s
17bc4c9d85SConor Dooley          - const: snps,designware-i2s
18bc4c9d85SConor Dooley      - enum:
19bc4c9d85SConor Dooley          - snps,designware-i2s
20*206110c7SXingyu Wu          - starfive,jh7110-i2stx0
21*206110c7SXingyu Wu          - starfive,jh7110-i2stx1
22*206110c7SXingyu Wu          - starfive,jh7110-i2srx
23bc4c9d85SConor Dooley
24bc4c9d85SConor Dooley  reg:
25bc4c9d85SConor Dooley    maxItems: 1
26bc4c9d85SConor Dooley
27bc4c9d85SConor Dooley  interrupts:
28bc4c9d85SConor Dooley    description: |
29bc4c9d85SConor Dooley      The interrupt line number for the I2S controller. Add this
30bc4c9d85SConor Dooley      parameter if the I2S controller that you are using does not
31bc4c9d85SConor Dooley      support DMA.
32bc4c9d85SConor Dooley    maxItems: 1
33bc4c9d85SConor Dooley
34bc4c9d85SConor Dooley  clocks:
35*206110c7SXingyu Wu    items:
36*206110c7SXingyu Wu      - description: Sampling rate reference clock
37*206110c7SXingyu Wu      - description: APB clock
38*206110c7SXingyu Wu      - description: Audio master clock
39*206110c7SXingyu Wu      - description: Inner audio master clock source
40*206110c7SXingyu Wu      - description: External audio master clock source
41*206110c7SXingyu Wu      - description: Bit clock
42*206110c7SXingyu Wu      - description: Left/right channel clock
43*206110c7SXingyu Wu      - description: External bit clock
44*206110c7SXingyu Wu      - description: External left/right channel clock
45*206110c7SXingyu Wu    minItems: 1
46bc4c9d85SConor Dooley
47bc4c9d85SConor Dooley  clock-names:
48*206110c7SXingyu Wu    items:
49*206110c7SXingyu Wu      - const: i2sclk
50*206110c7SXingyu Wu      - const: apb
51*206110c7SXingyu Wu      - const: mclk
52*206110c7SXingyu Wu      - const: mclk_inner
53*206110c7SXingyu Wu      - const: mclk_ext
54*206110c7SXingyu Wu      - const: bclk
55*206110c7SXingyu Wu      - const: lrck
56*206110c7SXingyu Wu      - const: bclk_ext
57*206110c7SXingyu Wu      - const: lrck_ext
58*206110c7SXingyu Wu    minItems: 1
59bc4c9d85SConor Dooley
60bc4c9d85SConor Dooley  resets:
6112b99ec3SMaxim Kochetkov    items:
6212b99ec3SMaxim Kochetkov      - description: Optional controller resets
63*206110c7SXingyu Wu      - description: controller reset of Sampling rate
64*206110c7SXingyu Wu    minItems: 1
65bc4c9d85SConor Dooley
66bc4c9d85SConor Dooley  dmas:
67bc4c9d85SConor Dooley    items:
68bc4c9d85SConor Dooley      - description: TX DMA Channel
69bc4c9d85SConor Dooley      - description: RX DMA Channel
70bc4c9d85SConor Dooley    minItems: 1
71bc4c9d85SConor Dooley
72bc4c9d85SConor Dooley  dma-names:
73bc4c9d85SConor Dooley    items:
74bc4c9d85SConor Dooley      - const: tx
75bc4c9d85SConor Dooley      - const: rx
76bc4c9d85SConor Dooley    minItems: 1
77bc4c9d85SConor Dooley
78*206110c7SXingyu Wu  starfive,syscon:
79*206110c7SXingyu Wu    $ref: /schemas/types.yaml#/definitions/phandle-array
80*206110c7SXingyu Wu    items:
81*206110c7SXingyu Wu      - items:
82*206110c7SXingyu Wu          - description: phandle to System Register Controller sys_syscon node.
83*206110c7SXingyu Wu          - description: I2S-rx enabled control offset of SYS_SYSCONSAIF__SYSCFG register.
84*206110c7SXingyu Wu          - description: I2S-rx enabled control mask
85*206110c7SXingyu Wu    description:
86*206110c7SXingyu Wu      The phandle to System Register Controller syscon node and the I2S-rx(ADC)
87*206110c7SXingyu Wu      enabled control offset and mask of SYS_SYSCONSAIF__SYSCFG register.
88*206110c7SXingyu Wu
8958ae9a2aSKrzysztof KozlowskiallOf:
9058ae9a2aSKrzysztof Kozlowski  - $ref: dai-common.yaml#
9158ae9a2aSKrzysztof Kozlowski  - if:
92bc4c9d85SConor Dooley      properties:
93bc4c9d85SConor Dooley        compatible:
94bc4c9d85SConor Dooley          contains:
95bc4c9d85SConor Dooley            const: canaan,k210-i2s
96bc4c9d85SConor Dooley    then:
97bc4c9d85SConor Dooley      properties:
98bc4c9d85SConor Dooley        "#sound-dai-cells":
99bc4c9d85SConor Dooley          const: 1
100bc4c9d85SConor Dooley    else:
101bc4c9d85SConor Dooley      properties:
102bc4c9d85SConor Dooley        "#sound-dai-cells":
103bc4c9d85SConor Dooley          const: 0
104*206110c7SXingyu Wu  - if:
105*206110c7SXingyu Wu      properties:
106*206110c7SXingyu Wu        compatible:
107*206110c7SXingyu Wu          contains:
108*206110c7SXingyu Wu            const: snps,designware-i2s
109*206110c7SXingyu Wu    then:
110*206110c7SXingyu Wu      properties:
111*206110c7SXingyu Wu        clocks:
112*206110c7SXingyu Wu          maxItems: 1
113*206110c7SXingyu Wu        clock-names:
114*206110c7SXingyu Wu          maxItems: 1
115*206110c7SXingyu Wu        resets:
116*206110c7SXingyu Wu          maxItems: 1
117*206110c7SXingyu Wu    else:
118*206110c7SXingyu Wu      properties:
119*206110c7SXingyu Wu        resets:
120*206110c7SXingyu Wu          minItems: 2
121*206110c7SXingyu Wu          maxItems: 2
122*206110c7SXingyu Wu  - if:
123*206110c7SXingyu Wu      properties:
124*206110c7SXingyu Wu        compatible:
125*206110c7SXingyu Wu          contains:
126*206110c7SXingyu Wu            const: starfive,jh7110-i2stx0
127*206110c7SXingyu Wu    then:
128*206110c7SXingyu Wu      properties:
129*206110c7SXingyu Wu        clocks:
130*206110c7SXingyu Wu          minItems: 5
131*206110c7SXingyu Wu          maxItems: 5
132*206110c7SXingyu Wu        clock-names:
133*206110c7SXingyu Wu          minItems: 5
134*206110c7SXingyu Wu          maxItems: 5
135*206110c7SXingyu Wu      required:
136*206110c7SXingyu Wu        - resets
137*206110c7SXingyu Wu  - if:
138*206110c7SXingyu Wu      properties:
139*206110c7SXingyu Wu        compatible:
140*206110c7SXingyu Wu          contains:
141*206110c7SXingyu Wu            const: starfive,jh7110-i2stx1
142*206110c7SXingyu Wu    then:
143*206110c7SXingyu Wu      properties:
144*206110c7SXingyu Wu        clocks:
145*206110c7SXingyu Wu          minItems: 9
146*206110c7SXingyu Wu          maxItems: 9
147*206110c7SXingyu Wu        clock-names:
148*206110c7SXingyu Wu          minItems: 9
149*206110c7SXingyu Wu          maxItems: 9
150*206110c7SXingyu Wu      required:
151*206110c7SXingyu Wu        - resets
152*206110c7SXingyu Wu  - if:
153*206110c7SXingyu Wu      properties:
154*206110c7SXingyu Wu        compatible:
155*206110c7SXingyu Wu          contains:
156*206110c7SXingyu Wu            const: starfive,jh7110-i2srx
157*206110c7SXingyu Wu    then:
158*206110c7SXingyu Wu      properties:
159*206110c7SXingyu Wu        clocks:
160*206110c7SXingyu Wu          minItems: 9
161*206110c7SXingyu Wu          maxItems: 9
162*206110c7SXingyu Wu        clock-names:
163*206110c7SXingyu Wu          minItems: 9
164*206110c7SXingyu Wu          maxItems: 9
165*206110c7SXingyu Wu      required:
166*206110c7SXingyu Wu        - resets
167*206110c7SXingyu Wu        - starfive,syscon
168*206110c7SXingyu Wu    else:
169*206110c7SXingyu Wu      properties:
170*206110c7SXingyu Wu        starfive,syscon: false
171bc4c9d85SConor Dooley
172bc4c9d85SConor Dooleyrequired:
173bc4c9d85SConor Dooley  - compatible
174bc4c9d85SConor Dooley  - reg
175bc4c9d85SConor Dooley  - clocks
176bc4c9d85SConor Dooley  - clock-names
177bc4c9d85SConor Dooley
178bc4c9d85SConor DooleyoneOf:
179bc4c9d85SConor Dooley  - required:
180bc4c9d85SConor Dooley      - dmas
181bc4c9d85SConor Dooley      - dma-names
182bc4c9d85SConor Dooley  - required:
183bc4c9d85SConor Dooley      - interrupts
184bc4c9d85SConor Dooley
185bc4c9d85SConor DooleyunevaluatedProperties: false
186bc4c9d85SConor Dooley
187bc4c9d85SConor Dooleyexamples:
188bc4c9d85SConor Dooley  - |
189bc4c9d85SConor Dooley    soc_i2s: i2s@7ff90000 {
190bc4c9d85SConor Dooley      compatible = "snps,designware-i2s";
191bc4c9d85SConor Dooley      reg = <0x7ff90000 0x1000>;
192bc4c9d85SConor Dooley      clocks = <&scpi_i2sclk 0>;
193bc4c9d85SConor Dooley      clock-names = "i2sclk";
194bc4c9d85SConor Dooley      #sound-dai-cells = <0>;
195bc4c9d85SConor Dooley      dmas = <&dma0 5>;
196bc4c9d85SConor Dooley      dma-names = "tx";
197bc4c9d85SConor Dooley    };
198