blob: 5dd5c0df3cf306694be602ec7b907233d5cd1690 [file] [log] [blame]
Rohit Kumarcb1d7db2017-09-18 07:52:03 +05301/*
2 * Copyright (c) 2017, The Linux Foundation. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#include "sdm670-wcd.dtsi"
14#include "sdm670-wsa881x.dtsi"
15#include <dt-bindings/clock/qcom,audio-ext-clk.h>
16
17&tavil_snd {
Rohit Kumardf038552017-09-22 15:14:09 +053018 qcom,msm-mi2s-master = <1>, <1>, <1>, <1>, <1>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +053019 qcom,audio-routing =
20 "AIF4 VI", "MCLK",
21 "RX_BIAS", "MCLK",
22 "MADINPUT", "MCLK",
23 "hifi amp", "LINEOUT1",
24 "hifi amp", "LINEOUT2",
25 "AMIC2", "MIC BIAS2",
26 "MIC BIAS2", "Headset Mic",
27 "AMIC3", "MIC BIAS2",
28 "MIC BIAS2", "ANCRight Headset Mic",
29 "AMIC4", "MIC BIAS2",
30 "MIC BIAS2", "ANCLeft Headset Mic",
31 "AMIC5", "MIC BIAS3",
32 "MIC BIAS3", "Handset Mic",
33 "DMIC0", "MIC BIAS1",
34 "MIC BIAS1", "Digital Mic0",
35 "DMIC1", "MIC BIAS1",
36 "MIC BIAS1", "Digital Mic1",
37 "DMIC2", "MIC BIAS3",
38 "MIC BIAS3", "Digital Mic2",
39 "DMIC3", "MIC BIAS3",
40 "MIC BIAS3", "Digital Mic3",
41 "DMIC4", "MIC BIAS4",
42 "MIC BIAS4", "Digital Mic4",
43 "DMIC5", "MIC BIAS4",
44 "MIC BIAS4", "Digital Mic5",
45 "SpkrLeft IN", "SPK1 OUT",
46 "SpkrRight IN", "SPK2 OUT";
47
48 qcom,msm-mbhc-hphl-swh = <1>;
49 qcom,msm-mbhc-gnd-swh = <1>;
50 qcom,hph-en0-gpio = <&tavil_hph_en0>;
51 qcom,hph-en1-gpio = <&tavil_hph_en1>;
52 qcom,msm-mclk-freq = <9600000>;
Rohit kumar344bd2a2017-10-18 13:11:05 +053053 asoc-codec = <&stub_codec>, <&ext_disp_audio_codec>;
54 asoc-codec-names = "msm-stub-codec.1", "msm-ext-disp-audio-codec-rx";
Rohit Kumarcb1d7db2017-09-18 07:52:03 +053055 qcom,wsa-max-devs = <2>;
56 qcom,wsa-devs = <&wsa881x_0211>, <&wsa881x_0212>,
57 <&wsa881x_0213>, <&wsa881x_0214>;
58 qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
59 "SpkrLeft", "SpkrRight";
60};
61
62&int_codec {
63 qcom,audio-routing =
64 "RX_BIAS", "INT_MCLK0",
65 "SPK_RX_BIAS", "INT_MCLK0",
66 "INT_LDO_H", "INT_MCLK0",
Vatsal Bucha796b8602017-10-24 17:49:24 +053067 "RX_I2S_CLK", "INT_MCLK0",
68 "TX_I2S_CLK", "INT_MCLK0",
Rohit Kumarcb1d7db2017-09-18 07:52:03 +053069 "MIC BIAS External", "Handset Mic",
70 "MIC BIAS External2", "Headset Mic",
71 "MIC BIAS External", "Secondary Mic",
72 "AMIC1", "MIC BIAS External",
73 "AMIC2", "MIC BIAS External2",
74 "AMIC3", "MIC BIAS External",
75 "DMIC1", "MIC BIAS External",
76 "MIC BIAS External", "Digital Mic1",
77 "DMIC2", "MIC BIAS External",
78 "MIC BIAS External", "Digital Mic2",
79 "DMIC3", "MIC BIAS External",
80 "MIC BIAS External", "Digital Mic3",
81 "DMIC4", "MIC BIAS External",
82 "MIC BIAS External", "Digital Mic4",
83 "SpkrLeft IN", "SPK1 OUT",
84 "SpkrRight IN", "SPK2 OUT",
85 "PDM_IN_RX1", "PDM_OUT_RX1",
86 "PDM_IN_RX2", "PDM_OUT_RX2",
87 "PDM_IN_RX3", "PDM_OUT_RX3",
88 "ADC1_IN", "ADC1_OUT",
89 "ADC2_IN", "ADC2_OUT",
90 "ADC3_IN", "ADC3_OUT";
91
Rohit Kumardf038552017-09-22 15:14:09 +053092 qcom,msm-mi2s-master = <1>, <1>, <1>, <1>, <1>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +053093 qcom,msm-mclk-freq = <9600000>;
94 qcom,msm-mbhc-hphl-swh = <1>;
95 qcom,msm-mbhc-gnd-swh = <1>;
96 qcom,msm-micbias2-ext-cap;
97 qcom,msm-hs-micbias-type = "external";
98 qcom,cdc-pdm-gpios = <&cdc_pdm_gpios>;
99 qcom,cdc-comp-gpios = <&cdc_comp_gpios>;
100 qcom,cdc-dmic-gpios = <&cdc_dmic_gpios>;
101
102 asoc-codec = <&stub_codec>, <&msm_digital_codec>,
Rohit kumar344bd2a2017-10-18 13:11:05 +0530103 <&pmic_analog_codec>, <&msm_sdw_codec>,
104 <&ext_disp_audio_codec>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530105 asoc-codec-names = "msm-stub-codec.1", "msm-dig-codec",
Rohit kumar344bd2a2017-10-18 13:11:05 +0530106 "analog-codec", "msm_sdw_codec",
107 "msm-ext-disp-audio-codec-rx";
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530108
109 qcom,wsa-max-devs = <2>;
110 qcom,wsa-devs = <&wsa881x_211_en>, <&wsa881x_212_en>,
111 <&wsa881x_213_en>, <&wsa881x_214_en>;
112 qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
113 "SpkrLeft", "SpkrRight";
114};
115
116&soc {
117 wcd_usbc_analog_en1_gpio: msm_cdc_pinctrl_usbc_audio_en1 {
118 compatible = "qcom,msm-cdc-pinctrl";
119 pinctrl-names = "aud_active", "aud_sleep";
120 pinctrl-0 = <&wcd_usbc_analog_en1_active>;
121 pinctrl-1 = <&wcd_usbc_analog_en1_idle>;
122 };
123
124 cdc_pdm_gpios: cdc_pdm_pinctrl {
125 compatible = "qcom,msm-cdc-pinctrl";
126 pinctrl-names = "aud_active", "aud_sleep";
127 pinctrl-0 = <&cdc_pdm_clk_active &cdc_pdm_sync_active
128 &cdc_pdm_rx0_active &cdc_pdm_rx1_2_active
129 &cdc_pdm_2_gpios_active>;
130 pinctrl-1 = <&cdc_pdm_clk_sleep &cdc_pdm_sync_sleep
131 &cdc_pdm_rx0_sleep &cdc_pdm_rx1_2_sleep
132 &cdc_pdm_2_gpios_sleep>;
133 qcom,lpi-gpios;
134 };
135
136 cdc_comp_gpios: cdc_comp_pinctrl {
137 compatible = "qcom,msm-cdc-pinctrl";
138 pinctrl-names = "aud_active", "aud_sleep";
139 pinctrl-0 = <&cdc_rx0_comp_active &cdc_rx1_comp_active>;
140 pinctrl-1 = <&cdc_rx0_comp_sleep &cdc_rx1_comp_sleep>;
141 qcom,lpi-gpios;
142 };
143
144 cdc_dmic_gpios: cdc_dmic_pinctrl {
145 compatible = "qcom,msm-cdc-pinctrl";
146 pinctrl-names = "aud_active", "aud_sleep";
147 pinctrl-0 = <&cdc_dmic12_gpios_active
148 &cdc_dmic34_gpios_active>;
149 pinctrl-1 = <&cdc_dmic12_gpios_sleep
150 &cdc_dmic34_gpios_sleep>;
151 qcom,lpi-gpios;
152 };
153
154 cdc_sdw_gpios: sdw_clk_data_pinctrl {
155 compatible = "qcom,msm-cdc-pinctrl";
156 pinctrl-names = "aud_active", "aud_sleep";
157 pinctrl-0 = <&sdw_clk_active &sdw_data_active>;
158 pinctrl-1 = <&sdw_clk_sleep &sdw_data_sleep>;
159 };
160
161 wsa_spkr_en1: wsa_spkr_en1_pinctrl {
162 compatible = "qcom,msm-cdc-pinctrl";
163 pinctrl-names = "aud_active", "aud_sleep";
164 pinctrl-0 = <&spkr_1_sd_n_active>;
165 pinctrl-1 = <&spkr_1_sd_n_sleep>;
166 };
167
168 wsa_spkr_en2: wsa_spkr_en2_pinctrl {
169 compatible = "qcom,msm-cdc-pinctrl";
170 pinctrl-names = "aud_active", "aud_sleep";
171 pinctrl-0 = <&spkr_2_sd_n_active>;
172 pinctrl-1 = <&spkr_2_sd_n_sleep>;
173 };
174
175 msm_sdw_codec: msm-sdw-codec@62ec1000 {
176 status = "okay";
177 compatible = "qcom,msm-sdw-codec";
178 reg = <0x62ec1000 0x0>;
Rohit Kumar1aca30a62017-09-20 13:11:35 +0530179 interrupts = <0 88 0>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530180 interrupt-names = "swr_master_irq";
181 qcom,cdc-sdw-gpios = <&cdc_sdw_gpios>;
182
183 swr_master {
184 compatible = "qcom,swr-wcd";
185 #address-cells = <2>;
186 #size-cells = <0>;
187
188 wsa881x_211_en: wsa881x_en@20170211 {
189 compatible = "qcom,wsa881x";
190 reg = <0x0 0x20170211>;
191 qcom,spkr-sd-n-node = <&wsa_spkr_en1>;
192 };
193
194 wsa881x_212_en: wsa881x_en@20170212 {
195 compatible = "qcom,wsa881x";
196 reg = <0x0 0x20170212>;
197 qcom,spkr-sd-n-node = <&wsa_spkr_en2>;
198 };
199
200 wsa881x_213_en: wsa881x_en@21170213 {
201 compatible = "qcom,wsa881x";
202 reg = <0x0 0x21170213>;
203 qcom,spkr-sd-n-node = <&wsa_spkr_en1>;
204 };
205
206 wsa881x_214_en: wsa881x_en@21170214 {
207 compatible = "qcom,wsa881x";
208 reg = <0x0 0x21170214>;
209 qcom,spkr-sd-n-node = <&wsa_spkr_en2>;
210 };
211 };
212 };
213
214 wcd9xxx_intc: wcd9xxx-irq {
215 status = "disabled";
216 compatible = "qcom,wcd9xxx-irq";
217 interrupt-controller;
218 #interrupt-cells = <1>;
219 interrupt-parent = <&tlmm>;
220 qcom,gpio-connect = <&tlmm 80 0>;
221 pinctrl-names = "default";
222 pinctrl-0 = <&wcd_intr_default>;
223 };
224
225 clock_audio_lnbb: audio_ext_clk_lnbb {
226 status = "disabled";
227 compatible = "qcom,audio-ref-clk";
228 clock-names = "osr_clk";
229 clocks = <&clock_rpmh RPMH_LN_BB_CLK2>;
230 qcom,node_has_rpm_clock;
231 #clock-cells = <1>;
232 };
233
234 wcd_rst_gpio: msm_cdc_pinctrl@64 {
235 status = "disabled";
236 compatible = "qcom,msm-cdc-pinctrl";
237 pinctrl-names = "aud_active", "aud_sleep";
238 pinctrl-0 = <&lpi_cdc_reset_active>;
239 pinctrl-1 = <&lpi_cdc_reset_sleep>;
240 qcom,lpi-gpios;
241 };
242
243 wdsp_mgr: qcom,wcd-dsp-mgr {
244 compatible = "qcom,wcd-dsp-mgr";
245 qcom,wdsp-components = <&wcd934x_cdc 0>,
246 <&wcd_spi_0 1>,
247 <&glink_spi_xprt_wdsp 2>;
248 qcom,img-filename = "cpe_9340";
249 };
250
251 wdsp_glink: qcom,wcd-dsp-glink {
252 compatible = "qcom,wcd-dsp-glink";
253 };
254};
255
256&slim_aud {
257 wcd934x_cdc: tavil_codec {
258 status = "disabled";
259 compatible = "qcom,tavil-slim-pgd";
260 elemental-addr = [00 01 50 02 17 02];
261
262 interrupt-parent = <&wcd9xxx_intc>;
263 interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
264 17 18 19 20 21 22 23 24 25 26 27 28 29
265 30 31>;
266
267 qcom,wcd-rst-gpio-node = <&wcd_rst_gpio>;
268
269 clock-names = "wcd_clk";
270 clocks = <&clock_audio_lnbb AUDIO_PMIC_LNBB_CLK>;
271
272 cdc-vdd-mic-bias-supply = <&pm660l_bob>;
273 qcom,cdc-vdd-mic-bias-voltage = <3312000 3312000>;
274 qcom,cdc-vdd-mic-bias-current = <30400>;
275
276 qcom,cdc-static-supplies = "cdc-vdd-mic-bias";
277
278 qcom,cdc-micbias1-mv = <1800>;
279 qcom,cdc-micbias2-mv = <1800>;
280 qcom,cdc-micbias3-mv = <1800>;
281 qcom,cdc-micbias4-mv = <1800>;
282
283 qcom,cdc-mclk-clk-rate = <9600000>;
284 qcom,cdc-slim-ifd = "tavil-slim-ifd";
285 qcom,cdc-slim-ifd-elemental-addr = [00 00 50 02 17 02];
286 qcom,cdc-dmic-sample-rate = <4800000>;
287 qcom,cdc-mad-dmic-rate = <600000>;
288
289 qcom,wdsp-cmpnt-dev-name = "tavil_codec";
290
291 wcd_spi_0: wcd_spi {
292 compatible = "qcom,wcd-spi-v2";
Rohit Kumar1aca30a62017-09-20 13:11:35 +0530293 qcom,master-bus-num = <0>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530294 qcom,chip-select = <0>;
295 qcom,max-frequency = <24000000>;
296 qcom,mem-base-addr = <0x100000>;
297 };
298 };
299};
300
301&pm660l_3 {
302 pmic_analog_codec: analog-codec@f000 {
303 status = "okay";
304 compatible = "qcom,pmic-analog-codec";
305 reg = <0xf000 0x200>;
306 #address-cells = <2>;
307 #size-cells = <0>;
308 interrupt-parent = <&spmi_bus>;
309 interrupts = <0x3 0xf0 0x0 IRQ_TYPE_NONE>,
310 <0x3 0xf0 0x1 IRQ_TYPE_NONE>,
311 <0x3 0xf0 0x2 IRQ_TYPE_NONE>,
312 <0x3 0xf0 0x3 IRQ_TYPE_NONE>,
313 <0x3 0xf0 0x4 IRQ_TYPE_NONE>,
314 <0x3 0xf0 0x5 IRQ_TYPE_NONE>,
315 <0x3 0xf0 0x6 IRQ_TYPE_NONE>,
316 <0x3 0xf0 0x7 IRQ_TYPE_NONE>,
317 <0x3 0xf1 0x0 IRQ_TYPE_NONE>,
318 <0x3 0xf1 0x1 IRQ_TYPE_NONE>,
319 <0x3 0xf1 0x2 IRQ_TYPE_NONE>,
320 <0x3 0xf1 0x3 IRQ_TYPE_NONE>,
321 <0x3 0xf1 0x4 IRQ_TYPE_NONE>,
322 <0x3 0xf1 0x5 IRQ_TYPE_NONE>;
323 interrupt-names = "spk_cnp_int",
324 "spk_clip_int",
325 "spk_ocp_int",
326 "ins_rem_det1",
327 "but_rel_det",
328 "but_press_det",
329 "ins_rem_det",
330 "mbhc_int",
331 "ear_ocp_int",
332 "hphr_ocp_int",
333 "hphl_ocp_det",
334 "ear_cnp_int",
335 "hphr_cnp_int",
336 "hphl_cnp_int";
337
338 cdc-vdda-cp-supply = <&pm660_s4>;
339 qcom,cdc-vdda-cp-voltage = <1900000 2050000>;
340 qcom,cdc-vdda-cp-current = <50000>;
341
342 cdc-vdd-pa-supply = <&pm660_s4>;
343 qcom,cdc-vdd-pa-voltage = <2040000 2040000>;
344 qcom,cdc-vdd-pa-current = <260000>;
345
346 cdc-vdd-mic-bias-supply = <&pm660l_l7>;
347 qcom,cdc-vdd-mic-bias-voltage = <3088000 3088000>;
348 qcom,cdc-vdd-mic-bias-current = <5000>;
349
350 qcom,cdc-mclk-clk-rate = <9600000>;
351
352 qcom,cdc-static-supplies = "cdc-vdda-cp",
353 "cdc-vdd-pa";
354
355 qcom,cdc-on-demand-supplies = "cdc-vdd-mic-bias";
356
357 /*
358 * Not marking address @ as driver searches this child
359 * with name msm-dig-codec
360 */
361 msm_digital_codec: msm-dig-codec {
362 compatible = "qcom,msm-digital-codec";
363 reg = <0x62ec0000 0x0>;
364 };
365 };
366};