xref: /freebsd/sys/contrib/device-tree/Bindings/sound/qcom,sm8250.yaml (revision 058ac3e8063366dafa634d9107642e12b038bf09)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/sound/qcom,sm8250.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm Technologies Inc. ASoC sound card drivers
8
9maintainers:
10  - Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
11
12description:
13  This bindings describes Qualcomm SoC based sound cards
14  which uses LPASS internal codec for audio.
15
16properties:
17  compatible:
18    enum:
19      - lenovo,yoga-c630-sndcard
20      - qcom,apq8016-sbc-sndcard
21      - qcom,db845c-sndcard
22      - qcom,msm8916-qdsp6-sndcard
23      - qcom,sdm845-sndcard
24      - qcom,sm8250-sndcard
25      - qcom,qrb5165-rb5-sndcard
26
27  audio-routing:
28    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
29    description:
30      A list of the connections between audio components. Each entry is a
31      pair of strings, the first being the connection's sink, the second
32      being the connection's source. Valid names could be power supplies,
33      MicBias of codec and the jacks on the board.
34
35  aux-devs:
36    $ref: /schemas/types.yaml#/definitions/phandle-array
37    description: |
38      List of phandles pointing to auxiliary devices, such
39      as amplifiers, to be added to the sound card.
40
41  model:
42    $ref: /schemas/types.yaml#/definitions/string
43    description: User visible long sound card name
44
45  pin-switches:
46    description: List of widget names for which pin switches should be created.
47    $ref: /schemas/types.yaml#/definitions/string-array
48
49  widgets:
50    description: User specified audio sound widgets.
51    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
52
53  # Only valid for some compatibles (see allOf if below)
54  reg: true
55  reg-names: true
56
57patternProperties:
58  ".*-dai-link$":
59    description:
60      Each subnode represents a dai link. Subnodes of each dai links would be
61      cpu/codec dais.
62
63    type: object
64
65    properties:
66      link-name:
67        description: Indicates dai-link name and PCM stream name.
68        $ref: /schemas/types.yaml#/definitions/string
69        maxItems: 1
70
71      cpu:
72        description: Holds subnode which indicates cpu dai.
73        type: object
74        properties:
75          sound-dai:
76            maxItems: 1
77
78      platform:
79        description: Holds subnode which indicates platform dai.
80        type: object
81        properties:
82          sound-dai:
83            maxItems: 1
84
85      codec:
86        description: Holds subnode which indicates codec dai.
87        type: object
88        properties:
89          sound-dai:
90            minItems: 1
91            maxItems: 4
92
93    required:
94      - link-name
95      - cpu
96
97    additionalProperties: false
98
99required:
100  - compatible
101  - model
102
103allOf:
104  - if:
105      properties:
106        compatible:
107          contains:
108            enum:
109              - qcom,apq8016-sbc-sndcard
110              - qcom,msm8916-qdsp6-sndcard
111    then:
112      properties:
113        reg:
114          items:
115            - description: Microphone I/O mux register address
116            - description: Speaker I/O mux register address
117        reg-names:
118          items:
119            - const: mic-iomux
120            - const: spkr-iomux
121      required:
122        - compatible
123        - model
124        - reg
125        - reg-names
126    else:
127      properties:
128        reg: false
129        reg-names: false
130
131additionalProperties: false
132
133examples:
134
135  - |
136    #include <dt-bindings/sound/qcom,q6afe.h>
137    #include <dt-bindings/sound/qcom,q6asm.h>
138    sound {
139        compatible = "qcom,qrb5165-rb5-sndcard";
140        model = "Qualcomm-qrb5165-RB5-WSA8815-Speakers-DMIC0";
141        audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
142                    "SpkrRight IN", "WSA_SPK2 OUT",
143                    "VA DMIC0", "vdd-micb",
144                    "VA DMIC1", "vdd-micb";
145
146        mm1-dai-link {
147            link-name = "MultiMedia0";
148            cpu {
149                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
150            };
151        };
152
153        mm2-dai-link {
154            link-name = "MultiMedia2";
155            cpu {
156                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
157            };
158        };
159
160        mm3-dai-link {
161            link-name = "MultiMedia3";
162            cpu {
163                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
164            };
165        };
166
167        hdmi-dai-link {
168            link-name = "HDMI Playback";
169            cpu {
170                sound-dai = <&q6afedai TERTIARY_MI2S_RX>;
171            };
172
173            platform {
174                sound-dai = <&q6routing>;
175            };
176
177            codec {
178                sound-dai = <&lt9611_codec 0>;
179            };
180        };
181
182        wsa-dai-link {
183            link-name = "WSA Playback";
184            cpu {
185                sound-dai = <&q6afedai WSA_CODEC_DMA_RX_0>;
186            };
187
188            platform {
189                sound-dai = <&q6routing>;
190            };
191
192            codec {
193                sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro>;
194            };
195        };
196
197        va-dai-link {
198            link-name = "VA Capture";
199            cpu {
200                sound-dai = <&q6afedai VA_CODEC_DMA_TX_0>;
201            };
202
203            platform {
204                sound-dai = <&q6routing>;
205            };
206
207            codec {
208                sound-dai = <&vamacro 0>;
209            };
210        };
211    };
212
213  - |
214    #include <dt-bindings/sound/qcom,lpass.h>
215    sound@7702000 {
216        compatible = "qcom,apq8016-sbc-sndcard";
217        reg = <0x07702000 0x4>, <0x07702004 0x4>;
218        reg-names = "mic-iomux", "spkr-iomux";
219
220        model = "DB410c";
221        audio-routing =
222            "AMIC2", "MIC BIAS Internal2",
223            "AMIC3", "MIC BIAS External1";
224
225        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
226        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
227        pinctrl-names = "default", "sleep";
228
229        quaternary-dai-link {
230            link-name = "ADV7533";
231            cpu {
232                sound-dai = <&lpass MI2S_QUATERNARY>;
233            };
234            codec {
235                sound-dai = <&adv_bridge 0>;
236            };
237        };
238
239        primary-dai-link {
240            link-name = "WCD";
241            cpu {
242                sound-dai = <&lpass MI2S_PRIMARY>;
243            };
244            codec {
245                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
246            };
247        };
248
249        tertiary-dai-link {
250            link-name = "WCD-Capture";
251            cpu {
252                sound-dai = <&lpass MI2S_TERTIARY>;
253            };
254            codec {
255                sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
256            };
257        };
258    };
259
260  - |
261    #include <dt-bindings/sound/qcom,q6afe.h>
262    #include <dt-bindings/sound/qcom,q6asm.h>
263    sound@7702000 {
264        compatible = "qcom,msm8916-qdsp6-sndcard";
265        reg = <0x07702000 0x4>, <0x07702004 0x4>;
266        reg-names = "mic-iomux", "spkr-iomux";
267
268        model = "msm8916";
269        widgets =
270            "Speaker", "Speaker",
271            "Headphone", "Headphones";
272        pin-switches = "Speaker";
273        audio-routing =
274            "Speaker", "Speaker Amp OUT",
275            "Speaker Amp IN", "HPH_R",
276            "Headphones", "HPH_L",
277            "Headphones", "HPH_R",
278            "AMIC1", "MIC BIAS Internal1",
279            "AMIC2", "MIC BIAS Internal2",
280            "AMIC3", "MIC BIAS Internal3";
281        aux-devs = <&speaker_amp>;
282
283        pinctrl-names = "default", "sleep";
284        pinctrl-0 = <&cdc_pdm_lines_act>;
285        pinctrl-1 = <&cdc_pdm_lines_sus>;
286
287        mm1-dai-link {
288            link-name = "MultiMedia1";
289            cpu {
290                sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
291            };
292        };
293
294        primary-dai-link {
295            link-name = "Primary MI2S";
296            cpu {
297                sound-dai = <&q6afedai PRIMARY_MI2S_RX>;
298            };
299            platform {
300                sound-dai = <&q6routing>;
301            };
302            codec {
303                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
304            };
305        };
306    };
307