xref: /freebsd/sys/contrib/device-tree/Bindings/sound/allwinner,sun4i-a10-codec.yaml (revision 8bab661a3316d8bd9b9fbd11a3b4371b91507bd2)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/sound/allwinner,sun4i-a10-codec.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
77ef62cebSEmmanuel Vadottitle: Allwinner A10 Codec
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Chen-Yu Tsai <wens@csie.org>
11c66ec88fSEmmanuel Vadot  - Maxime Ripard <mripard@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotproperties:
14c66ec88fSEmmanuel Vadot  "#sound-dai-cells":
15c66ec88fSEmmanuel Vadot    const: 0
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadot  compatible:
18c66ec88fSEmmanuel Vadot    enum:
19c66ec88fSEmmanuel Vadot      - allwinner,sun4i-a10-codec
20c66ec88fSEmmanuel Vadot      - allwinner,sun6i-a31-codec
21c66ec88fSEmmanuel Vadot      - allwinner,sun7i-a20-codec
22c66ec88fSEmmanuel Vadot      - allwinner,sun8i-a23-codec
23c66ec88fSEmmanuel Vadot      - allwinner,sun8i-h3-codec
24c66ec88fSEmmanuel Vadot      - allwinner,sun8i-v3s-codec
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  reg:
27c66ec88fSEmmanuel Vadot    maxItems: 1
28c66ec88fSEmmanuel Vadot
29c66ec88fSEmmanuel Vadot  interrupts:
30c66ec88fSEmmanuel Vadot    maxItems: 1
31c66ec88fSEmmanuel Vadot
32c66ec88fSEmmanuel Vadot  clocks:
33c66ec88fSEmmanuel Vadot    items:
34c66ec88fSEmmanuel Vadot      - description: Bus Clock
35c66ec88fSEmmanuel Vadot      - description: Module Clock
36c66ec88fSEmmanuel Vadot
37c66ec88fSEmmanuel Vadot  clock-names:
38c66ec88fSEmmanuel Vadot    items:
39c66ec88fSEmmanuel Vadot      - const: apb
40c66ec88fSEmmanuel Vadot      - const: codec
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel Vadot  dmas:
43c66ec88fSEmmanuel Vadot    items:
44c66ec88fSEmmanuel Vadot      - description: RX DMA Channel
45c66ec88fSEmmanuel Vadot      - description: TX DMA Channel
46c66ec88fSEmmanuel Vadot
47c66ec88fSEmmanuel Vadot  dma-names:
48c66ec88fSEmmanuel Vadot    items:
49c66ec88fSEmmanuel Vadot      - const: rx
50c66ec88fSEmmanuel Vadot      - const: tx
51c66ec88fSEmmanuel Vadot
52c66ec88fSEmmanuel Vadot  resets:
53c66ec88fSEmmanuel Vadot    maxItems: 1
54c66ec88fSEmmanuel Vadot
55c66ec88fSEmmanuel Vadot  allwinner,audio-routing:
56c66ec88fSEmmanuel Vadot    description: |-
57c66ec88fSEmmanuel Vadot      A list of the connections between audio components.  Each entry
58c66ec88fSEmmanuel Vadot      is a pair of strings, the first being the connection's sink, the
59c66ec88fSEmmanuel Vadot      second being the connection's source.
605def4c47SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
61c66ec88fSEmmanuel Vadot    minItems: 2
62c66ec88fSEmmanuel Vadot    maxItems: 18
63c66ec88fSEmmanuel Vadot    items:
64c66ec88fSEmmanuel Vadot      enum:
65c66ec88fSEmmanuel Vadot        # Audio Pins on the SoC
66c66ec88fSEmmanuel Vadot        - HP
67c66ec88fSEmmanuel Vadot        - HPCOM
68c66ec88fSEmmanuel Vadot        - LINEIN
69c66ec88fSEmmanuel Vadot        - LINEOUT
70c66ec88fSEmmanuel Vadot        - MIC1
71c66ec88fSEmmanuel Vadot        - MIC2
72c66ec88fSEmmanuel Vadot        - MIC3
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot        # Microphone Biases from the SoC
75c66ec88fSEmmanuel Vadot        - HBIAS
76c66ec88fSEmmanuel Vadot        - MBIAS
77c66ec88fSEmmanuel Vadot
78c66ec88fSEmmanuel Vadot        # Board Connectors
79c66ec88fSEmmanuel Vadot        - Headphone
80c66ec88fSEmmanuel Vadot        - Headset Mic
81c66ec88fSEmmanuel Vadot        - Line In
82c66ec88fSEmmanuel Vadot        - Line Out
83c66ec88fSEmmanuel Vadot        - Mic
84c66ec88fSEmmanuel Vadot        - Speaker
85c66ec88fSEmmanuel Vadot
86c66ec88fSEmmanuel Vadot  allwinner,codec-analog-controls:
87c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle
88c66ec88fSEmmanuel Vadot    description: Phandle to the codec analog controls in the PRCM
89c66ec88fSEmmanuel Vadot
90c66ec88fSEmmanuel Vadot  allwinner,pa-gpios:
915def4c47SEmmanuel Vadot    maxItems: 1
92c66ec88fSEmmanuel Vadot    description: GPIO to enable the external amplifier
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadotrequired:
95c66ec88fSEmmanuel Vadot  - "#sound-dai-cells"
96c66ec88fSEmmanuel Vadot  - compatible
97c66ec88fSEmmanuel Vadot  - reg
98c66ec88fSEmmanuel Vadot  - interrupts
99c66ec88fSEmmanuel Vadot  - clocks
100c66ec88fSEmmanuel Vadot  - clock-names
101c66ec88fSEmmanuel Vadot  - dmas
102c66ec88fSEmmanuel Vadot  - dma-names
103c66ec88fSEmmanuel Vadot
104c66ec88fSEmmanuel VadotallOf:
105*8bab661aSEmmanuel Vadot  - $ref: dai-common.yaml#
106c66ec88fSEmmanuel Vadot  - if:
107c66ec88fSEmmanuel Vadot      properties:
108c66ec88fSEmmanuel Vadot        compatible:
109c66ec88fSEmmanuel Vadot          enum:
110c66ec88fSEmmanuel Vadot            - allwinner,sun6i-a31-codec
111c66ec88fSEmmanuel Vadot            - allwinner,sun8i-a23-codec
112c66ec88fSEmmanuel Vadot            - allwinner,sun8i-h3-codec
113c66ec88fSEmmanuel Vadot            - allwinner,sun8i-v3s-codec
114c66ec88fSEmmanuel Vadot
115c66ec88fSEmmanuel Vadot    then:
116c66ec88fSEmmanuel Vadot      if:
117c66ec88fSEmmanuel Vadot        properties:
118c66ec88fSEmmanuel Vadot          compatible:
119c66ec88fSEmmanuel Vadot            const: allwinner,sun6i-a31-codec
120c66ec88fSEmmanuel Vadot
121c66ec88fSEmmanuel Vadot      then:
122c66ec88fSEmmanuel Vadot        required:
123c66ec88fSEmmanuel Vadot          - resets
124c66ec88fSEmmanuel Vadot          - allwinner,audio-routing
125c66ec88fSEmmanuel Vadot
126c66ec88fSEmmanuel Vadot      else:
127c66ec88fSEmmanuel Vadot        required:
128c66ec88fSEmmanuel Vadot          - resets
129c66ec88fSEmmanuel Vadot          - allwinner,audio-routing
130c66ec88fSEmmanuel Vadot          - allwinner,codec-analog-controls
131c66ec88fSEmmanuel Vadot
132c66ec88fSEmmanuel Vadot  - if:
133c66ec88fSEmmanuel Vadot      properties:
134c66ec88fSEmmanuel Vadot        compatible:
135c66ec88fSEmmanuel Vadot          enum:
136c66ec88fSEmmanuel Vadot            - allwinner,sun6i-a31-codec
137c66ec88fSEmmanuel Vadot
138c66ec88fSEmmanuel Vadot    then:
139c66ec88fSEmmanuel Vadot      properties:
140c66ec88fSEmmanuel Vadot        allwinner,audio-routing:
141c66ec88fSEmmanuel Vadot          items:
142c66ec88fSEmmanuel Vadot            enum:
143c66ec88fSEmmanuel Vadot              - HP
144c66ec88fSEmmanuel Vadot              - HPCOM
145c66ec88fSEmmanuel Vadot              - LINEIN
146c66ec88fSEmmanuel Vadot              - LINEOUT
147c66ec88fSEmmanuel Vadot              - MIC1
148c66ec88fSEmmanuel Vadot              - MIC2
149c66ec88fSEmmanuel Vadot              - MIC3
150c66ec88fSEmmanuel Vadot              - HBIAS
151c66ec88fSEmmanuel Vadot              - MBIAS
152c66ec88fSEmmanuel Vadot              - Headphone
153c66ec88fSEmmanuel Vadot              - Headset Mic
154c66ec88fSEmmanuel Vadot              - Line In
155c66ec88fSEmmanuel Vadot              - Line Out
156c66ec88fSEmmanuel Vadot              - Mic
157c66ec88fSEmmanuel Vadot              - Speaker
158c66ec88fSEmmanuel Vadot
159c66ec88fSEmmanuel Vadot  - if:
160c66ec88fSEmmanuel Vadot      properties:
161c66ec88fSEmmanuel Vadot        compatible:
162c66ec88fSEmmanuel Vadot          enum:
163c66ec88fSEmmanuel Vadot            - allwinner,sun8i-a23-codec
164c66ec88fSEmmanuel Vadot
165c66ec88fSEmmanuel Vadot    then:
166c66ec88fSEmmanuel Vadot      properties:
167c66ec88fSEmmanuel Vadot        allwinner,audio-routing:
168c66ec88fSEmmanuel Vadot          items:
169c66ec88fSEmmanuel Vadot            enum:
170c66ec88fSEmmanuel Vadot              - HP
171c66ec88fSEmmanuel Vadot              - HPCOM
172c66ec88fSEmmanuel Vadot              - LINEIN
173c66ec88fSEmmanuel Vadot              - MIC1
174c66ec88fSEmmanuel Vadot              - MIC2
175c66ec88fSEmmanuel Vadot              - HBIAS
176c66ec88fSEmmanuel Vadot              - MBIAS
177c66ec88fSEmmanuel Vadot              - Headphone
178c66ec88fSEmmanuel Vadot              - Headset Mic
179c66ec88fSEmmanuel Vadot              - Line In
180c66ec88fSEmmanuel Vadot              - Line Out
181c66ec88fSEmmanuel Vadot              - Mic
182c66ec88fSEmmanuel Vadot              - Speaker
183c66ec88fSEmmanuel Vadot
184c66ec88fSEmmanuel Vadot  - if:
185c66ec88fSEmmanuel Vadot      properties:
186c66ec88fSEmmanuel Vadot        compatible:
187c66ec88fSEmmanuel Vadot          enum:
188c66ec88fSEmmanuel Vadot            - allwinner,sun8i-h3-codec
189c66ec88fSEmmanuel Vadot
190c66ec88fSEmmanuel Vadot    then:
191c66ec88fSEmmanuel Vadot      properties:
192c66ec88fSEmmanuel Vadot        allwinner,audio-routing:
193c66ec88fSEmmanuel Vadot          items:
194c66ec88fSEmmanuel Vadot            enum:
195c66ec88fSEmmanuel Vadot              - HP
196c66ec88fSEmmanuel Vadot              - HPCOM
197c66ec88fSEmmanuel Vadot              - LINEIN
198c66ec88fSEmmanuel Vadot              - LINEOUT
199c66ec88fSEmmanuel Vadot              - MIC1
200c66ec88fSEmmanuel Vadot              - MIC2
201c66ec88fSEmmanuel Vadot              - HBIAS
202c66ec88fSEmmanuel Vadot              - MBIAS
203c66ec88fSEmmanuel Vadot              - Headphone
204c66ec88fSEmmanuel Vadot              - Headset Mic
205c66ec88fSEmmanuel Vadot              - Line In
206c66ec88fSEmmanuel Vadot              - Line Out
207c66ec88fSEmmanuel Vadot              - Mic
208c66ec88fSEmmanuel Vadot              - Speaker
209c66ec88fSEmmanuel Vadot
210c66ec88fSEmmanuel Vadot  - if:
211c66ec88fSEmmanuel Vadot      properties:
212c66ec88fSEmmanuel Vadot        compatible:
213c66ec88fSEmmanuel Vadot          enum:
214c66ec88fSEmmanuel Vadot            - allwinner,sun8i-v3s-codec
215c66ec88fSEmmanuel Vadot
216c66ec88fSEmmanuel Vadot    then:
217c66ec88fSEmmanuel Vadot      properties:
218c66ec88fSEmmanuel Vadot        allwinner,audio-routing:
219c66ec88fSEmmanuel Vadot          items:
220c66ec88fSEmmanuel Vadot            enum:
221c66ec88fSEmmanuel Vadot              - HP
222c66ec88fSEmmanuel Vadot              - HPCOM
223c66ec88fSEmmanuel Vadot              - MIC1
224c66ec88fSEmmanuel Vadot              - HBIAS
225c66ec88fSEmmanuel Vadot              - Headphone
226c66ec88fSEmmanuel Vadot              - Headset Mic
227c66ec88fSEmmanuel Vadot              - Line In
228c66ec88fSEmmanuel Vadot              - Line Out
229c66ec88fSEmmanuel Vadot              - Mic
230c66ec88fSEmmanuel Vadot              - Speaker
231c66ec88fSEmmanuel Vadot
232*8bab661aSEmmanuel VadotunevaluatedProperties: false
233c66ec88fSEmmanuel Vadot
234c66ec88fSEmmanuel Vadotexamples:
235c66ec88fSEmmanuel Vadot  - |
236c66ec88fSEmmanuel Vadot    codec@1c22c00 {
237c66ec88fSEmmanuel Vadot        #sound-dai-cells = <0>;
238c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun7i-a20-codec";
239c66ec88fSEmmanuel Vadot        reg = <0x01c22c00 0x40>;
240c66ec88fSEmmanuel Vadot        interrupts = <0 30 4>;
241c66ec88fSEmmanuel Vadot        clocks = <&apb0_gates 0>, <&codec_clk>;
242c66ec88fSEmmanuel Vadot        clock-names = "apb", "codec";
243c66ec88fSEmmanuel Vadot        dmas = <&dma 0 19>, <&dma 0 19>;
244c66ec88fSEmmanuel Vadot        dma-names = "rx", "tx";
245c66ec88fSEmmanuel Vadot    };
246c66ec88fSEmmanuel Vadot
247c66ec88fSEmmanuel Vadot  - |
248c66ec88fSEmmanuel Vadot    codec@1c22c00 {
249c66ec88fSEmmanuel Vadot        #sound-dai-cells = <0>;
250c66ec88fSEmmanuel Vadot        compatible = "allwinner,sun6i-a31-codec";
251c66ec88fSEmmanuel Vadot        reg = <0x01c22c00 0x98>;
252c66ec88fSEmmanuel Vadot        interrupts = <0 29 4>;
253c66ec88fSEmmanuel Vadot        clocks = <&ccu 61>, <&ccu 135>;
254c66ec88fSEmmanuel Vadot        clock-names = "apb", "codec";
255c66ec88fSEmmanuel Vadot        resets = <&ccu 42>;
256c66ec88fSEmmanuel Vadot        dmas = <&dma 15>, <&dma 15>;
257c66ec88fSEmmanuel Vadot        dma-names = "rx", "tx";
258c66ec88fSEmmanuel Vadot        allwinner,audio-routing =
259c66ec88fSEmmanuel Vadot            "Headphone", "HP",
260c66ec88fSEmmanuel Vadot            "Speaker", "LINEOUT",
261c66ec88fSEmmanuel Vadot            "LINEIN", "Line In",
262c66ec88fSEmmanuel Vadot            "MIC1", "MBIAS",
263c66ec88fSEmmanuel Vadot            "MIC1", "Mic",
264c66ec88fSEmmanuel Vadot            "MIC2", "HBIAS",
265c66ec88fSEmmanuel Vadot            "MIC2", "Headset Mic";
266c66ec88fSEmmanuel Vadot    };
267c66ec88fSEmmanuel Vadot
268c66ec88fSEmmanuel Vadot...
269