xref: /linux/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml (revision 64b14a184e83eb62ea0615e31a409956049d40e7)
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: true
73
74      platform:
75        description: Holds subnode which indicates platform dai.
76        type: object
77        properties:
78          sound-dai: true
79
80      codec:
81        description: Holds subnode which indicates codec dai.
82        type: object
83        properties:
84          sound-dai: true
85
86    required:
87      - link-name
88      - cpu
89
90    additionalProperties: false
91
92required:
93  - compatible
94  - model
95
96allOf:
97  - if:
98      properties:
99        compatible:
100          contains:
101            enum:
102              - qcom,apq8016-sbc-sndcard
103              - qcom,msm8916-qdsp6-sndcard
104    then:
105      properties:
106        reg:
107          items:
108            - description: Microphone I/O mux register address
109            - description: Speaker I/O mux register address
110        reg-names:
111          items:
112            - const: mic-iomux
113            - const: spkr-iomux
114      required:
115        - compatible
116        - model
117        - reg
118        - reg-names
119    else:
120      properties:
121        reg: false
122        reg-names: false
123
124additionalProperties: false
125
126examples:
127
128  - |
129    #include <dt-bindings/sound/qcom,q6afe.h>
130    #include <dt-bindings/sound/qcom,q6asm.h>
131    sound {
132        compatible = "qcom,qrb5165-rb5-sndcard";
133        model = "Qualcomm-qrb5165-RB5-WSA8815-Speakers-DMIC0";
134        audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
135                    "SpkrRight IN", "WSA_SPK2 OUT",
136                    "VA DMIC0", "vdd-micb",
137                    "VA DMIC1", "vdd-micb";
138
139        mm1-dai-link {
140            link-name = "MultiMedia0";
141            cpu {
142                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
143            };
144        };
145
146        mm2-dai-link {
147            link-name = "MultiMedia2";
148            cpu {
149                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
150            };
151        };
152
153        mm3-dai-link {
154            link-name = "MultiMedia3";
155            cpu {
156                sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
157            };
158        };
159
160        hdmi-dai-link {
161            link-name = "HDMI Playback";
162            cpu {
163                sound-dai = <&q6afedai TERTIARY_MI2S_RX>;
164            };
165
166            platform {
167                sound-dai = <&q6routing>;
168            };
169
170            codec {
171                sound-dai = <&lt9611_codec 0>;
172            };
173        };
174
175        wsa-dai-link {
176            link-name = "WSA Playback";
177            cpu {
178                sound-dai = <&q6afedai WSA_CODEC_DMA_RX_0>;
179            };
180
181            platform {
182                sound-dai = <&q6routing>;
183            };
184
185            codec {
186                sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro>;
187            };
188        };
189
190        va-dai-link {
191            link-name = "VA Capture";
192            cpu {
193                sound-dai = <&q6afedai VA_CODEC_DMA_TX_0>;
194            };
195
196            platform {
197                sound-dai = <&q6routing>;
198            };
199
200            codec {
201                sound-dai = <&vamacro 0>;
202            };
203        };
204    };
205
206  - |
207    #include <dt-bindings/sound/qcom,lpass.h>
208    sound@7702000 {
209        compatible = "qcom,apq8016-sbc-sndcard";
210        reg = <0x07702000 0x4>, <0x07702004 0x4>;
211        reg-names = "mic-iomux", "spkr-iomux";
212
213        model = "DB410c";
214        audio-routing =
215            "AMIC2", "MIC BIAS Internal2",
216            "AMIC3", "MIC BIAS External1";
217
218        pinctrl-0 = <&cdc_pdm_lines_act &ext_sec_tlmm_lines_act &ext_mclk_tlmm_lines_act>;
219        pinctrl-1 = <&cdc_pdm_lines_sus &ext_sec_tlmm_lines_sus &ext_mclk_tlmm_lines_sus>;
220        pinctrl-names = "default", "sleep";
221
222        quaternary-dai-link {
223            link-name = "ADV7533";
224            cpu {
225                sound-dai = <&lpass MI2S_QUATERNARY>;
226            };
227            codec {
228                sound-dai = <&adv_bridge 0>;
229            };
230        };
231
232        primary-dai-link {
233            link-name = "WCD";
234            cpu {
235                sound-dai = <&lpass MI2S_PRIMARY>;
236            };
237            codec {
238                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
239            };
240        };
241
242        tertiary-dai-link {
243            link-name = "WCD-Capture";
244            cpu {
245                sound-dai = <&lpass MI2S_TERTIARY>;
246            };
247            codec {
248                sound-dai = <&lpass_codec 1>, <&wcd_codec 1>;
249            };
250        };
251    };
252
253  - |
254    #include <dt-bindings/sound/qcom,q6afe.h>
255    #include <dt-bindings/sound/qcom,q6asm.h>
256    sound@7702000 {
257        compatible = "qcom,msm8916-qdsp6-sndcard";
258        reg = <0x07702000 0x4>, <0x07702004 0x4>;
259        reg-names = "mic-iomux", "spkr-iomux";
260
261        model = "msm8916";
262        widgets =
263            "Speaker", "Speaker",
264            "Headphone", "Headphones";
265        pin-switches = "Speaker";
266        audio-routing =
267            "Speaker", "Speaker Amp OUT",
268            "Speaker Amp IN", "HPH_R",
269            "Headphones", "HPH_L",
270            "Headphones", "HPH_R",
271            "AMIC1", "MIC BIAS Internal1",
272            "AMIC2", "MIC BIAS Internal2",
273            "AMIC3", "MIC BIAS Internal3";
274        aux-devs = <&speaker_amp>;
275
276        pinctrl-names = "default", "sleep";
277        pinctrl-0 = <&cdc_pdm_lines_act>;
278        pinctrl-1 = <&cdc_pdm_lines_sus>;
279
280        mm1-dai-link {
281            link-name = "MultiMedia1";
282            cpu {
283                sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
284            };
285        };
286
287        primary-dai-link {
288            link-name = "Primary MI2S";
289            cpu {
290                sound-dai = <&q6afedai PRIMARY_MI2S_RX>;
291            };
292            platform {
293                sound-dai = <&q6routing>;
294            };
295            codec {
296                sound-dai = <&lpass_codec 0>, <&wcd_codec 0>;
297            };
298        };
299    };
300