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