blob: 58c290d40588f7e95ebc64efe8059c7436613854 [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 Kumarcb1d7db2017-09-18 07:52:03 +053053 asoc-codec = <&stub_codec>;
54 asoc-codec-names = "msm-stub-codec.1";
55 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>,
103 <&pmic_analog_codec>, <&msm_sdw_codec>;
104 asoc-codec-names = "msm-stub-codec.1", "msm-dig-codec",
105 "analog-codec", "msm_sdw_codec";
106
107 qcom,wsa-max-devs = <2>;
108 qcom,wsa-devs = <&wsa881x_211_en>, <&wsa881x_212_en>,
109 <&wsa881x_213_en>, <&wsa881x_214_en>;
110 qcom,wsa-aux-dev-prefix = "SpkrLeft", "SpkrRight",
111 "SpkrLeft", "SpkrRight";
112};
113
114&soc {
115 wcd_usbc_analog_en1_gpio: msm_cdc_pinctrl_usbc_audio_en1 {
116 compatible = "qcom,msm-cdc-pinctrl";
117 pinctrl-names = "aud_active", "aud_sleep";
118 pinctrl-0 = <&wcd_usbc_analog_en1_active>;
119 pinctrl-1 = <&wcd_usbc_analog_en1_idle>;
120 };
121
122 cdc_pdm_gpios: cdc_pdm_pinctrl {
123 compatible = "qcom,msm-cdc-pinctrl";
124 pinctrl-names = "aud_active", "aud_sleep";
125 pinctrl-0 = <&cdc_pdm_clk_active &cdc_pdm_sync_active
126 &cdc_pdm_rx0_active &cdc_pdm_rx1_2_active
127 &cdc_pdm_2_gpios_active>;
128 pinctrl-1 = <&cdc_pdm_clk_sleep &cdc_pdm_sync_sleep
129 &cdc_pdm_rx0_sleep &cdc_pdm_rx1_2_sleep
130 &cdc_pdm_2_gpios_sleep>;
131 qcom,lpi-gpios;
132 };
133
134 cdc_comp_gpios: cdc_comp_pinctrl {
135 compatible = "qcom,msm-cdc-pinctrl";
136 pinctrl-names = "aud_active", "aud_sleep";
137 pinctrl-0 = <&cdc_rx0_comp_active &cdc_rx1_comp_active>;
138 pinctrl-1 = <&cdc_rx0_comp_sleep &cdc_rx1_comp_sleep>;
139 qcom,lpi-gpios;
140 };
141
142 cdc_dmic_gpios: cdc_dmic_pinctrl {
143 compatible = "qcom,msm-cdc-pinctrl";
144 pinctrl-names = "aud_active", "aud_sleep";
145 pinctrl-0 = <&cdc_dmic12_gpios_active
146 &cdc_dmic34_gpios_active>;
147 pinctrl-1 = <&cdc_dmic12_gpios_sleep
148 &cdc_dmic34_gpios_sleep>;
149 qcom,lpi-gpios;
150 };
151
152 cdc_sdw_gpios: sdw_clk_data_pinctrl {
153 compatible = "qcom,msm-cdc-pinctrl";
154 pinctrl-names = "aud_active", "aud_sleep";
155 pinctrl-0 = <&sdw_clk_active &sdw_data_active>;
156 pinctrl-1 = <&sdw_clk_sleep &sdw_data_sleep>;
157 };
158
159 wsa_spkr_en1: wsa_spkr_en1_pinctrl {
160 compatible = "qcom,msm-cdc-pinctrl";
161 pinctrl-names = "aud_active", "aud_sleep";
162 pinctrl-0 = <&spkr_1_sd_n_active>;
163 pinctrl-1 = <&spkr_1_sd_n_sleep>;
164 };
165
166 wsa_spkr_en2: wsa_spkr_en2_pinctrl {
167 compatible = "qcom,msm-cdc-pinctrl";
168 pinctrl-names = "aud_active", "aud_sleep";
169 pinctrl-0 = <&spkr_2_sd_n_active>;
170 pinctrl-1 = <&spkr_2_sd_n_sleep>;
171 };
172
173 msm_sdw_codec: msm-sdw-codec@62ec1000 {
174 status = "okay";
175 compatible = "qcom,msm-sdw-codec";
176 reg = <0x62ec1000 0x0>;
Rohit Kumar1aca30a62017-09-20 13:11:35 +0530177 interrupts = <0 88 0>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530178 interrupt-names = "swr_master_irq";
179 qcom,cdc-sdw-gpios = <&cdc_sdw_gpios>;
180
181 swr_master {
182 compatible = "qcom,swr-wcd";
183 #address-cells = <2>;
184 #size-cells = <0>;
185
186 wsa881x_211_en: wsa881x_en@20170211 {
187 compatible = "qcom,wsa881x";
188 reg = <0x0 0x20170211>;
189 qcom,spkr-sd-n-node = <&wsa_spkr_en1>;
190 };
191
192 wsa881x_212_en: wsa881x_en@20170212 {
193 compatible = "qcom,wsa881x";
194 reg = <0x0 0x20170212>;
195 qcom,spkr-sd-n-node = <&wsa_spkr_en2>;
196 };
197
198 wsa881x_213_en: wsa881x_en@21170213 {
199 compatible = "qcom,wsa881x";
200 reg = <0x0 0x21170213>;
201 qcom,spkr-sd-n-node = <&wsa_spkr_en1>;
202 };
203
204 wsa881x_214_en: wsa881x_en@21170214 {
205 compatible = "qcom,wsa881x";
206 reg = <0x0 0x21170214>;
207 qcom,spkr-sd-n-node = <&wsa_spkr_en2>;
208 };
209 };
210 };
211
212 wcd9xxx_intc: wcd9xxx-irq {
213 status = "disabled";
214 compatible = "qcom,wcd9xxx-irq";
215 interrupt-controller;
216 #interrupt-cells = <1>;
217 interrupt-parent = <&tlmm>;
218 qcom,gpio-connect = <&tlmm 80 0>;
219 pinctrl-names = "default";
220 pinctrl-0 = <&wcd_intr_default>;
221 };
222
223 clock_audio_lnbb: audio_ext_clk_lnbb {
224 status = "disabled";
225 compatible = "qcom,audio-ref-clk";
226 clock-names = "osr_clk";
227 clocks = <&clock_rpmh RPMH_LN_BB_CLK2>;
228 qcom,node_has_rpm_clock;
229 #clock-cells = <1>;
230 };
231
232 wcd_rst_gpio: msm_cdc_pinctrl@64 {
233 status = "disabled";
234 compatible = "qcom,msm-cdc-pinctrl";
235 pinctrl-names = "aud_active", "aud_sleep";
236 pinctrl-0 = <&lpi_cdc_reset_active>;
237 pinctrl-1 = <&lpi_cdc_reset_sleep>;
238 qcom,lpi-gpios;
239 };
240
241 wdsp_mgr: qcom,wcd-dsp-mgr {
242 compatible = "qcom,wcd-dsp-mgr";
243 qcom,wdsp-components = <&wcd934x_cdc 0>,
244 <&wcd_spi_0 1>,
245 <&glink_spi_xprt_wdsp 2>;
246 qcom,img-filename = "cpe_9340";
247 };
248
249 wdsp_glink: qcom,wcd-dsp-glink {
250 compatible = "qcom,wcd-dsp-glink";
251 };
252};
253
254&slim_aud {
255 wcd934x_cdc: tavil_codec {
256 status = "disabled";
257 compatible = "qcom,tavil-slim-pgd";
258 elemental-addr = [00 01 50 02 17 02];
259
260 interrupt-parent = <&wcd9xxx_intc>;
261 interrupts = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
262 17 18 19 20 21 22 23 24 25 26 27 28 29
263 30 31>;
264
265 qcom,wcd-rst-gpio-node = <&wcd_rst_gpio>;
266
267 clock-names = "wcd_clk";
268 clocks = <&clock_audio_lnbb AUDIO_PMIC_LNBB_CLK>;
269
270 cdc-vdd-mic-bias-supply = <&pm660l_bob>;
271 qcom,cdc-vdd-mic-bias-voltage = <3312000 3312000>;
272 qcom,cdc-vdd-mic-bias-current = <30400>;
273
274 qcom,cdc-static-supplies = "cdc-vdd-mic-bias";
275
276 qcom,cdc-micbias1-mv = <1800>;
277 qcom,cdc-micbias2-mv = <1800>;
278 qcom,cdc-micbias3-mv = <1800>;
279 qcom,cdc-micbias4-mv = <1800>;
280
281 qcom,cdc-mclk-clk-rate = <9600000>;
282 qcom,cdc-slim-ifd = "tavil-slim-ifd";
283 qcom,cdc-slim-ifd-elemental-addr = [00 00 50 02 17 02];
284 qcom,cdc-dmic-sample-rate = <4800000>;
285 qcom,cdc-mad-dmic-rate = <600000>;
286
287 qcom,wdsp-cmpnt-dev-name = "tavil_codec";
288
289 wcd_spi_0: wcd_spi {
290 compatible = "qcom,wcd-spi-v2";
Rohit Kumar1aca30a62017-09-20 13:11:35 +0530291 qcom,master-bus-num = <0>;
Rohit Kumarcb1d7db2017-09-18 07:52:03 +0530292 qcom,chip-select = <0>;
293 qcom,max-frequency = <24000000>;
294 qcom,mem-base-addr = <0x100000>;
295 };
296 };
297};
298
299&pm660l_3 {
300 pmic_analog_codec: analog-codec@f000 {
301 status = "okay";
302 compatible = "qcom,pmic-analog-codec";
303 reg = <0xf000 0x200>;
304 #address-cells = <2>;
305 #size-cells = <0>;
306 interrupt-parent = <&spmi_bus>;
307 interrupts = <0x3 0xf0 0x0 IRQ_TYPE_NONE>,
308 <0x3 0xf0 0x1 IRQ_TYPE_NONE>,
309 <0x3 0xf0 0x2 IRQ_TYPE_NONE>,
310 <0x3 0xf0 0x3 IRQ_TYPE_NONE>,
311 <0x3 0xf0 0x4 IRQ_TYPE_NONE>,
312 <0x3 0xf0 0x5 IRQ_TYPE_NONE>,
313 <0x3 0xf0 0x6 IRQ_TYPE_NONE>,
314 <0x3 0xf0 0x7 IRQ_TYPE_NONE>,
315 <0x3 0xf1 0x0 IRQ_TYPE_NONE>,
316 <0x3 0xf1 0x1 IRQ_TYPE_NONE>,
317 <0x3 0xf1 0x2 IRQ_TYPE_NONE>,
318 <0x3 0xf1 0x3 IRQ_TYPE_NONE>,
319 <0x3 0xf1 0x4 IRQ_TYPE_NONE>,
320 <0x3 0xf1 0x5 IRQ_TYPE_NONE>;
321 interrupt-names = "spk_cnp_int",
322 "spk_clip_int",
323 "spk_ocp_int",
324 "ins_rem_det1",
325 "but_rel_det",
326 "but_press_det",
327 "ins_rem_det",
328 "mbhc_int",
329 "ear_ocp_int",
330 "hphr_ocp_int",
331 "hphl_ocp_det",
332 "ear_cnp_int",
333 "hphr_cnp_int",
334 "hphl_cnp_int";
335
336 cdc-vdda-cp-supply = <&pm660_s4>;
337 qcom,cdc-vdda-cp-voltage = <1900000 2050000>;
338 qcom,cdc-vdda-cp-current = <50000>;
339
340 cdc-vdd-pa-supply = <&pm660_s4>;
341 qcom,cdc-vdd-pa-voltage = <2040000 2040000>;
342 qcom,cdc-vdd-pa-current = <260000>;
343
344 cdc-vdd-mic-bias-supply = <&pm660l_l7>;
345 qcom,cdc-vdd-mic-bias-voltage = <3088000 3088000>;
346 qcom,cdc-vdd-mic-bias-current = <5000>;
347
348 qcom,cdc-mclk-clk-rate = <9600000>;
349
350 qcom,cdc-static-supplies = "cdc-vdda-cp",
351 "cdc-vdd-pa";
352
353 qcom,cdc-on-demand-supplies = "cdc-vdd-mic-bias";
354
355 /*
356 * Not marking address @ as driver searches this child
357 * with name msm-dig-codec
358 */
359 msm_digital_codec: msm-dig-codec {
360 compatible = "qcom,msm-digital-codec";
361 reg = <0x62ec0000 0x0>;
362 };
363 };
364};