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