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