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