1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2019, Linaro Ltd.
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/leds/common.h>
9#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
10#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
11#include <dt-bindings/sound/qcom,q6afe.h>
12#include <dt-bindings/sound/qcom,q6asm.h>
13#include "sdm845.dtsi"
14#include "sdm845-wcd9340.dtsi"
15#include "pm8998.dtsi"
16#include "pmi8998.dtsi"
17
18/ {
19	model = "Thundercomm Dragonboard 845c";
20	compatible = "thundercomm,db845c", "qcom,sdm845";
21	qcom,msm-id = <341 0x20001>;
22	qcom,board-id = <8 0>;
23
24	aliases {
25		serial0 = &uart9;
26		serial1 = &uart6;
27	};
28
29	chosen {
30		stdout-path = "serial0:115200n8";
31	};
32
33	/* Fixed crystal oscillator dedicated to MCP2517FD */
34	clk40M: can-clock {
35		compatible = "fixed-clock";
36		#clock-cells = <0>;
37		clock-frequency = <40000000>;
38	};
39
40	dc12v: dc12v-regulator {
41		compatible = "regulator-fixed";
42		regulator-name = "DC12V";
43		regulator-min-microvolt = <12000000>;
44		regulator-max-microvolt = <12000000>;
45		regulator-always-on;
46	};
47
48	gpio-keys {
49		compatible = "gpio-keys";
50		autorepeat;
51
52		pinctrl-names = "default";
53		pinctrl-0 = <&vol_up_pin_a>;
54
55		key-vol-up {
56			label = "Volume Up";
57			linux,code = <KEY_VOLUMEUP>;
58			gpios = <&pm8998_gpios 6 GPIO_ACTIVE_LOW>;
59		};
60	};
61
62	leds {
63		compatible = "gpio-leds";
64
65		led-0 {
66			label = "green:user4";
67			function = LED_FUNCTION_INDICATOR;
68			color = <LED_COLOR_ID_GREEN>;
69			gpios = <&pm8998_gpios 13 GPIO_ACTIVE_HIGH>;
70			linux,default-trigger = "panic-indicator";
71			default-state = "off";
72		};
73
74		led-1 {
75			label = "yellow:wlan";
76			function = LED_FUNCTION_WLAN;
77			color = <LED_COLOR_ID_YELLOW>;
78			gpios = <&pm8998_gpios 9 GPIO_ACTIVE_HIGH>;
79			linux,default-trigger = "phy0tx";
80			default-state = "off";
81		};
82
83		led-2 {
84			label = "blue:bt";
85			function = LED_FUNCTION_BLUETOOTH;
86			color = <LED_COLOR_ID_BLUE>;
87			gpios = <&pm8998_gpios 5 GPIO_ACTIVE_HIGH>;
88			linux,default-trigger = "bluetooth-power";
89			default-state = "off";
90		};
91	};
92
93	hdmi-out {
94		compatible = "hdmi-connector";
95		type = "a";
96
97		port {
98			hdmi_con: endpoint {
99				remote-endpoint = <&lt9611_out>;
100			};
101		};
102	};
103
104	lt9611_1v8: lt9611-vdd18-regulator {
105		compatible = "regulator-fixed";
106		regulator-name = "LT9611_1V8";
107
108		vin-supply = <&vdc_5v>;
109		regulator-min-microvolt = <1800000>;
110		regulator-max-microvolt = <1800000>;
111
112		gpio = <&tlmm 89 GPIO_ACTIVE_HIGH>;
113		enable-active-high;
114	};
115
116	lt9611_3v3: lt9611-3v3 {
117		compatible = "regulator-fixed";
118		regulator-name = "LT9611_3V3";
119
120		vin-supply = <&vdc_3v3>;
121		regulator-min-microvolt = <3300000>;
122		regulator-max-microvolt = <3300000>;
123
124		/*
125		 * TODO: make it possible to drive same GPIO from two clients
126		 * gpio = <&tlmm 89 GPIO_ACTIVE_HIGH>;
127		 * enable-active-high;
128		 */
129	};
130
131	pcie0_1p05v: pcie-0-1p05v-regulator {
132		compatible = "regulator-fixed";
133		regulator-name = "PCIE0_1.05V";
134
135		vin-supply = <&vbat>;
136		regulator-min-microvolt = <1050000>;
137		regulator-max-microvolt = <1050000>;
138
139		/*
140		 * TODO: make it possible to drive same GPIO from two clients
141		 * gpio = <&tlmm 90 GPIO_ACTIVE_HIGH>;
142		 * enable-active-high;
143		 */
144	};
145
146	cam0_dvdd_1v2: cam0-dvdd-1v2-regulator {
147		compatible = "regulator-fixed";
148		regulator-name = "CAM0_DVDD_1V2";
149		regulator-min-microvolt = <1200000>;
150		regulator-max-microvolt = <1200000>;
151		enable-active-high;
152		gpio = <&pm8998_gpios 12 GPIO_ACTIVE_HIGH>;
153		pinctrl-names = "default";
154		pinctrl-0 = <&cam0_dvdd_1v2_en_default>;
155		vin-supply = <&vbat>;
156	};
157
158	cam0_avdd_2v8: cam0-avdd-2v8-regulator {
159		compatible = "regulator-fixed";
160		regulator-name = "CAM0_AVDD_2V8";
161		regulator-min-microvolt = <2800000>;
162		regulator-max-microvolt = <2800000>;
163		enable-active-high;
164		gpio = <&pm8998_gpios 10 GPIO_ACTIVE_HIGH>;
165		pinctrl-names = "default";
166		pinctrl-0 = <&cam0_avdd_2v8_en_default>;
167		vin-supply = <&vbat>;
168	};
169
170	/* This regulator is enabled when the VREG_LVS1A_1P8 trace is enabled */
171	cam3_avdd_2v8: cam3-avdd-2v8-regulator {
172		compatible = "regulator-fixed";
173		regulator-name = "CAM3_AVDD_2V8";
174		regulator-min-microvolt = <2800000>;
175		regulator-max-microvolt = <2800000>;
176		regulator-always-on;
177		vin-supply = <&vbat>;
178	};
179
180	pcie0_3p3v_dual: vldo-3v3-regulator {
181		compatible = "regulator-fixed";
182		regulator-name = "VLDO_3V3";
183
184		vin-supply = <&vbat>;
185		regulator-min-microvolt = <3300000>;
186		regulator-max-microvolt = <3300000>;
187
188		gpio = <&tlmm 90 GPIO_ACTIVE_HIGH>;
189		enable-active-high;
190
191		pinctrl-names = "default";
192		pinctrl-0 = <&pcie0_pwren_state>;
193	};
194
195	v5p0_hdmiout: v5p0-hdmiout-regulator {
196		compatible = "regulator-fixed";
197		regulator-name = "V5P0_HDMIOUT";
198
199		vin-supply = <&vdc_5v>;
200		regulator-min-microvolt = <500000>;
201		regulator-max-microvolt = <500000>;
202
203		/*
204		 * TODO: make it possible to drive same GPIO from two clients
205		 * gpio = <&tlmm 89 GPIO_ACTIVE_HIGH>;
206		 * enable-active-high;
207		 */
208	};
209
210	vbat: vbat-regulator {
211		compatible = "regulator-fixed";
212		regulator-name = "VBAT";
213
214		vin-supply = <&dc12v>;
215		regulator-min-microvolt = <4200000>;
216		regulator-max-microvolt = <4200000>;
217		regulator-always-on;
218	};
219
220	vbat_som: vbat-som-regulator {
221		compatible = "regulator-fixed";
222		regulator-name = "VBAT_SOM";
223
224		vin-supply = <&dc12v>;
225		regulator-min-microvolt = <4200000>;
226		regulator-max-microvolt = <4200000>;
227		regulator-always-on;
228	};
229
230	vdc_3v3: vdc-3v3-regulator {
231		compatible = "regulator-fixed";
232		regulator-name = "VDC_3V3";
233		vin-supply = <&dc12v>;
234		regulator-min-microvolt = <3300000>;
235		regulator-max-microvolt = <3300000>;
236		regulator-always-on;
237	};
238
239	vdc_5v: vdc-5v-regulator {
240		compatible = "regulator-fixed";
241		regulator-name = "VDC_5V";
242
243		vin-supply = <&dc12v>;
244		regulator-min-microvolt = <500000>;
245		regulator-max-microvolt = <500000>;
246		regulator-always-on;
247	};
248
249	vreg_s4a_1p8: vreg-s4a-1p8 {
250		compatible = "regulator-fixed";
251		regulator-name = "vreg_s4a_1p8";
252
253		regulator-min-microvolt = <1800000>;
254		regulator-max-microvolt = <1800000>;
255		regulator-always-on;
256	};
257
258	vph_pwr: vph-pwr-regulator {
259		compatible = "regulator-fixed";
260		regulator-name = "vph_pwr";
261
262		vin-supply = <&vbat_som>;
263	};
264};
265
266&adsp_pas {
267	status = "okay";
268
269	firmware-name = "qcom/sdm845/adsp.mbn";
270};
271
272&apps_rsc {
273	regulators-0 {
274		compatible = "qcom,pm8998-rpmh-regulators";
275		qcom,pmic-id = "a";
276		vdd-s1-supply = <&vph_pwr>;
277		vdd-s2-supply = <&vph_pwr>;
278		vdd-s3-supply = <&vph_pwr>;
279		vdd-s4-supply = <&vph_pwr>;
280		vdd-s5-supply = <&vph_pwr>;
281		vdd-s6-supply = <&vph_pwr>;
282		vdd-s7-supply = <&vph_pwr>;
283		vdd-s8-supply = <&vph_pwr>;
284		vdd-s9-supply = <&vph_pwr>;
285		vdd-s10-supply = <&vph_pwr>;
286		vdd-s11-supply = <&vph_pwr>;
287		vdd-s12-supply = <&vph_pwr>;
288		vdd-s13-supply = <&vph_pwr>;
289		vdd-l1-l27-supply = <&vreg_s7a_1p025>;
290		vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>;
291		vdd-l3-l11-supply = <&vreg_s7a_1p025>;
292		vdd-l4-l5-supply = <&vreg_s7a_1p025>;
293		vdd-l6-supply = <&vph_pwr>;
294		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>;
295		vdd-l9-supply = <&vreg_bob>;
296		vdd-l10-l23-l25-supply = <&vreg_bob>;
297		vdd-l13-l19-l21-supply = <&vreg_bob>;
298		vdd-l16-l28-supply = <&vreg_bob>;
299		vdd-l18-l22-supply = <&vreg_bob>;
300		vdd-l20-l24-supply = <&vreg_bob>;
301		vdd-l26-supply = <&vreg_s3a_1p35>;
302		vin-lvs-1-2-supply = <&vreg_s4a_1p8>;
303
304		vreg_s3a_1p35: smps3 {
305			regulator-min-microvolt = <1352000>;
306			regulator-max-microvolt = <1352000>;
307		};
308
309		vreg_s5a_2p04: smps5 {
310			regulator-min-microvolt = <1904000>;
311			regulator-max-microvolt = <2040000>;
312		};
313
314		vreg_s7a_1p025: smps7 {
315			regulator-min-microvolt = <900000>;
316			regulator-max-microvolt = <1028000>;
317		};
318
319		vreg_l1a_0p875: ldo1 {
320			regulator-min-microvolt = <880000>;
321			regulator-max-microvolt = <880000>;
322			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
323		};
324
325		vreg_l5a_0p8: ldo5 {
326			regulator-min-microvolt = <800000>;
327			regulator-max-microvolt = <800000>;
328			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
329		};
330
331		vreg_l12a_1p8: ldo12 {
332			regulator-min-microvolt = <1800000>;
333			regulator-max-microvolt = <1800000>;
334			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
335		};
336
337		vreg_l7a_1p8: ldo7 {
338			regulator-min-microvolt = <1800000>;
339			regulator-max-microvolt = <1800000>;
340			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
341		};
342
343		vreg_l13a_2p95: ldo13 {
344			regulator-min-microvolt = <1800000>;
345			regulator-max-microvolt = <2960000>;
346			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
347		};
348
349		vreg_l17a_1p3: ldo17 {
350			regulator-min-microvolt = <1304000>;
351			regulator-max-microvolt = <1304000>;
352			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
353		};
354
355		vreg_l20a_2p95: ldo20 {
356			regulator-min-microvolt = <2960000>;
357			regulator-max-microvolt = <2968000>;
358			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
359		};
360
361		vreg_l21a_2p95: ldo21 {
362			regulator-min-microvolt = <2960000>;
363			regulator-max-microvolt = <2968000>;
364			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
365		};
366
367		vreg_l24a_3p075: ldo24 {
368			regulator-min-microvolt = <3088000>;
369			regulator-max-microvolt = <3088000>;
370			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
371		};
372
373		vreg_l25a_3p3: ldo25 {
374			regulator-min-microvolt = <3300000>;
375			regulator-max-microvolt = <3312000>;
376			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
377		};
378
379		vreg_l26a_1p2: ldo26 {
380			regulator-min-microvolt = <1200000>;
381			regulator-max-microvolt = <1200000>;
382			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
383		};
384
385		vreg_lvs1a_1p8: lvs1 {
386			regulator-min-microvolt = <1800000>;
387			regulator-max-microvolt = <1800000>;
388			regulator-always-on;
389		};
390
391		vreg_lvs2a_1p8: lvs2 {
392			regulator-min-microvolt = <1800000>;
393			regulator-max-microvolt = <1800000>;
394			regulator-always-on;
395		};
396	};
397
398	regulators-1 {
399		compatible = "qcom,pmi8998-rpmh-regulators";
400		qcom,pmic-id = "b";
401
402		vdd-bob-supply = <&vph_pwr>;
403
404		vreg_bob: bob {
405			regulator-min-microvolt = <3312000>;
406			regulator-max-microvolt = <3600000>;
407			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
408			regulator-allow-bypass;
409		};
410	};
411};
412
413&cdsp_pas {
414	status = "okay";
415	firmware-name = "qcom/sdm845/cdsp.mbn";
416};
417
418&dsi0 {
419	status = "okay";
420	vdda-supply = <&vreg_l26a_1p2>;
421
422	ports {
423		port@1 {
424			endpoint {
425				remote-endpoint = <&lt9611_a>;
426				data-lanes = <0 1 2 3>;
427			};
428		};
429	};
430};
431
432&dsi0_phy {
433	status = "okay";
434	vdds-supply = <&vreg_l1a_0p875>;
435};
436
437&gcc {
438	protected-clocks = <GCC_QSPI_CORE_CLK>,
439			   <GCC_QSPI_CORE_CLK_SRC>,
440			   <GCC_QSPI_CNOC_PERIPH_AHB_CLK>,
441			   <GCC_LPASS_Q6_AXI_CLK>,
442			   <GCC_LPASS_SWAY_CLK>;
443};
444
445&gmu {
446	status = "okay";
447};
448
449&gpi_dma0 {
450	status = "okay";
451};
452
453&gpi_dma1 {
454	status = "okay";
455};
456
457&gpu {
458	status = "okay";
459	zap-shader {
460		memory-region = <&gpu_mem>;
461		firmware-name = "qcom/sdm845/a630_zap.mbn";
462	};
463};
464
465&i2c10 {
466	status = "okay";
467	clock-frequency = <400000>;
468
469	lt9611_codec: hdmi-bridge@3b {
470		compatible = "lontium,lt9611";
471		reg = <0x3b>;
472		#sound-dai-cells = <1>;
473
474		interrupts-extended = <&tlmm 84 IRQ_TYPE_EDGE_FALLING>;
475
476		reset-gpios = <&tlmm 128 GPIO_ACTIVE_HIGH>;
477
478		vdd-supply = <&lt9611_1v8>;
479		vcc-supply = <&lt9611_3v3>;
480
481		pinctrl-names = "default";
482		pinctrl-0 = <&lt9611_irq_pin>, <&dsi_sw_sel>;
483
484		ports {
485			#address-cells = <1>;
486			#size-cells = <0>;
487
488			port@0 {
489				reg = <0>;
490
491				lt9611_a: endpoint {
492					remote-endpoint = <&dsi0_out>;
493				};
494			};
495
496			port@2 {
497				reg = <2>;
498
499				lt9611_out: endpoint {
500					remote-endpoint = <&hdmi_con>;
501				};
502			};
503		};
504	};
505};
506
507&i2c11 {
508	/* On Low speed expansion */
509	clock-frequency = <100000>;
510	status = "okay";
511};
512
513&i2c14 {
514	/* On Low speed expansion */
515	clock-frequency = <100000>;
516	status = "okay";
517};
518
519&mdss {
520	status = "okay";
521};
522
523&mss_pil {
524	status = "okay";
525	firmware-name = "qcom/sdm845/mba.mbn", "qcom/sdm845/modem.mbn";
526};
527
528&pcie0 {
529	status = "okay";
530	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
531	enable-gpio = <&tlmm 134 GPIO_ACTIVE_HIGH>;
532
533	vddpe-3v3-supply = <&pcie0_3p3v_dual>;
534
535	pinctrl-names = "default";
536	pinctrl-0 = <&pcie0_default_state>;
537};
538
539&pcie0_phy {
540	status = "okay";
541
542	vdda-phy-supply = <&vreg_l1a_0p875>;
543	vdda-pll-supply = <&vreg_l26a_1p2>;
544};
545
546&pcie1 {
547	status = "okay";
548	perst-gpios = <&tlmm 102 GPIO_ACTIVE_LOW>;
549
550	pinctrl-names = "default";
551	pinctrl-0 = <&pcie1_default_state>;
552};
553
554&pcie1_phy {
555	status = "okay";
556
557	vdda-phy-supply = <&vreg_l1a_0p875>;
558	vdda-pll-supply = <&vreg_l26a_1p2>;
559};
560
561&pm8998_gpios {
562	gpio-line-names =
563		"NC",
564		"NC",
565		"WLAN_SW_CTRL",
566		"NC",
567		"PM_GPIO5_BLUE_BT_LED",
568		"VOL_UP_N",
569		"NC",
570		"ADC_IN1",
571		"PM_GPIO9_YEL_WIFI_LED",
572		"CAM0_AVDD_EN",
573		"NC",
574		"CAM0_DVDD_EN",
575		"PM_GPIO13_GREEN_U4_LED",
576		"DIV_CLK2",
577		"NC",
578		"NC",
579		"NC",
580		"SMB_STAT",
581		"NC",
582		"NC",
583		"ADC_IN2",
584		"OPTION1",
585		"WCSS_PWR_REQ",
586		"PM845_GPIO24",
587		"OPTION2",
588		"PM845_SLB";
589
590	cam0_dvdd_1v2_en_default: cam0-dvdd-1v2-en-state {
591		pins = "gpio12";
592		function = "normal";
593
594		bias-pull-up;
595		drive-push-pull;
596		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
597	};
598
599	cam0_avdd_2v8_en_default: cam0-avdd-2v8-en-state {
600		pins = "gpio10";
601		function = "normal";
602
603		bias-pull-up;
604		drive-push-pull;
605		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
606	};
607
608	vol_up_pin_a: vol-up-active-state {
609		pins = "gpio6";
610		function = "normal";
611		input-enable;
612		bias-pull-up;
613		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
614	};
615};
616
617&pm8998_resin {
618	linux,code = <KEY_VOLUMEDOWN>;
619	status = "okay";
620};
621
622&pmi8998_lpg {
623	status = "okay";
624
625	qcom,power-source = <1>;
626
627	led@3 {
628		reg = <3>;
629		color = <LED_COLOR_ID_GREEN>;
630		function = LED_FUNCTION_HEARTBEAT;
631		function-enumerator = <3>;
632
633		linux,default-trigger = "heartbeat";
634		default-state = "on";
635	};
636
637	led@4 {
638		reg = <4>;
639		color = <LED_COLOR_ID_GREEN>;
640		function = LED_FUNCTION_INDICATOR;
641		function-enumerator = <2>;
642	};
643
644	led@5 {
645		reg = <5>;
646		color = <LED_COLOR_ID_GREEN>;
647		function = LED_FUNCTION_INDICATOR;
648		function-enumerator = <1>;
649	};
650};
651
652&pmi8998_rradc {
653	status = "okay";
654};
655
656/* QUAT I2S Uses 4 I2S SD Lines for audio on LT9611 HDMI Bridge */
657&q6afedai {
658	dai@22 {
659		reg = <QUATERNARY_MI2S_RX>;
660		qcom,sd-lines = <0 1 2 3>;
661	};
662};
663
664&q6asmdai {
665	dai@0 {
666		reg = <0>;
667	};
668
669	dai@1 {
670		reg = <1>;
671	};
672
673	dai@2 {
674		reg = <2>;
675	};
676
677	dai@3 {
678		reg = <3>;
679		direction = <2>;
680		is-compress-dai;
681	};
682};
683
684&qupv3_id_0 {
685	status = "okay";
686};
687
688&qupv3_id_1 {
689	status = "okay";
690};
691
692&sdhc_2 {
693	status = "okay";
694
695	pinctrl-names = "default";
696	pinctrl-0 = <&sdc2_default_state &sdc2_card_det_n>;
697
698	vmmc-supply = <&vreg_l21a_2p95>;
699	vqmmc-supply = <&vreg_l13a_2p95>;
700
701	bus-width = <4>;
702	cd-gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
703};
704
705&sound {
706	compatible = "qcom,db845c-sndcard", "qcom,sdm845-sndcard";
707	pinctrl-0 = <&quat_mi2s_active
708			 &quat_mi2s_sd0_active
709			 &quat_mi2s_sd1_active
710			 &quat_mi2s_sd2_active
711			 &quat_mi2s_sd3_active>;
712	pinctrl-names = "default";
713	model = "DB845c";
714	audio-routing =
715		"RX_BIAS", "MCLK",
716		"AMIC1", "MIC BIAS1",
717		"AMIC2", "MIC BIAS2",
718		"DMIC0", "MIC BIAS1",
719		"DMIC1", "MIC BIAS1",
720		"DMIC2", "MIC BIAS3",
721		"DMIC3", "MIC BIAS3",
722		"SpkrLeft IN", "SPK1 OUT",
723		"SpkrRight IN", "SPK2 OUT",
724		"MM_DL1",  "MultiMedia1 Playback",
725		"MM_DL2",  "MultiMedia2 Playback",
726		"MM_DL4",  "MultiMedia4 Playback",
727		"MultiMedia3 Capture", "MM_UL3";
728
729	mm1-dai-link {
730		link-name = "MultiMedia1";
731		cpu {
732			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA1>;
733		};
734	};
735
736	mm2-dai-link {
737		link-name = "MultiMedia2";
738		cpu {
739			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA2>;
740		};
741	};
742
743	mm3-dai-link {
744		link-name = "MultiMedia3";
745		cpu {
746			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA3>;
747		};
748	};
749
750	mm4-dai-link {
751		link-name = "MultiMedia4";
752		cpu {
753			sound-dai = <&q6asmdai  MSM_FRONTEND_DAI_MULTIMEDIA4>;
754		};
755	};
756
757	hdmi-dai-link {
758		link-name = "HDMI Playback";
759		cpu {
760			sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
761		};
762
763		platform {
764			sound-dai = <&q6routing>;
765		};
766
767		codec {
768			sound-dai = <&lt9611_codec 0>;
769		};
770	};
771
772	slim-dai-link {
773		link-name = "SLIM Playback";
774		cpu {
775			sound-dai = <&q6afedai SLIMBUS_0_RX>;
776		};
777
778		platform {
779			sound-dai = <&q6routing>;
780		};
781
782		codec {
783			sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>;
784		};
785	};
786
787	slimcap-dai-link {
788		link-name = "SLIM Capture";
789		cpu {
790			sound-dai = <&q6afedai SLIMBUS_0_TX>;
791		};
792
793		platform {
794			sound-dai = <&q6routing>;
795		};
796
797		codec {
798			sound-dai = <&wcd9340 1>;
799		};
800	};
801};
802
803&spi0 {
804	status = "okay";
805	pinctrl-names = "default";
806	pinctrl-0 = <&qup_spi0_default>;
807	cs-gpios = <&tlmm 3 GPIO_ACTIVE_LOW>;
808
809	can@0 {
810		compatible = "microchip,mcp2517fd";
811		reg = <0>;
812		clocks = <&clk40M>;
813		interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
814		spi-max-frequency = <10000000>;
815		vdd-supply = <&vdc_5v>;
816		xceiver-supply = <&vdc_5v>;
817	};
818};
819
820&spi2 {
821	/* On Low speed expansion */
822	label = "LS-SPI0";
823	status = "okay";
824};
825
826&tlmm {
827	cam0_default: cam0-default-state {
828		rst-pins {
829			pins = "gpio9";
830			function = "gpio";
831
832			drive-strength = <16>;
833			bias-disable;
834		};
835
836		mclk0-pins {
837			pins = "gpio13";
838			function = "cam_mclk";
839
840			drive-strength = <16>;
841			bias-disable;
842		};
843	};
844
845	cam3_default: cam3-default-state {
846		rst-pins {
847			function = "gpio";
848			pins = "gpio21";
849
850			drive-strength = <16>;
851			bias-disable;
852		};
853
854		mclk3-pins {
855			function = "cam_mclk";
856			pins = "gpio16";
857
858			drive-strength = <16>;
859			bias-disable;
860		};
861	};
862
863	dsi_sw_sel: dsi-sw-sel-state {
864		pins = "gpio120";
865		function = "gpio";
866
867		drive-strength = <2>;
868		bias-disable;
869		output-high;
870	};
871
872	lt9611_irq_pin: lt9611-irq-state {
873		pins = "gpio84";
874		function = "gpio";
875		bias-disable;
876	};
877
878	pcie0_default_state: pcie0-default-state {
879		clkreq-pins {
880			pins = "gpio36";
881			function = "pci_e0";
882			bias-pull-up;
883		};
884
885		reset-n-pins {
886			pins = "gpio35";
887			function = "gpio";
888
889			drive-strength = <2>;
890			output-low;
891			bias-pull-down;
892		};
893
894		wake-n-pins {
895			pins = "gpio37";
896			function = "gpio";
897
898			drive-strength = <2>;
899			bias-pull-up;
900		};
901	};
902
903	pcie0_pwren_state: pcie0-pwren-state {
904		pins = "gpio90";
905		function = "gpio";
906
907		drive-strength = <2>;
908		bias-disable;
909	};
910
911	pcie1_default_state: pcie1-default-state {
912		perst-n-pins {
913			pins = "gpio102";
914			function = "gpio";
915
916			drive-strength = <16>;
917			bias-disable;
918		};
919
920		clkreq-pins {
921			pins = "gpio103";
922			function = "pci_e1";
923			bias-pull-up;
924		};
925
926		wake-n-pins {
927			pins = "gpio11";
928			function = "gpio";
929
930			drive-strength = <2>;
931			bias-pull-up;
932		};
933
934		reset-n-pins {
935			pins = "gpio75";
936			function = "gpio";
937
938			drive-strength = <16>;
939			bias-pull-up;
940			output-high;
941		};
942	};
943
944	sdc2_default_state: sdc2-default-state {
945		clk-pins {
946			pins = "sdc2_clk";
947			bias-disable;
948
949			/*
950			 * It seems that mmc_test reports errors if drive
951			 * strength is not 16 on clk, cmd, and data pins.
952			 */
953			drive-strength = <16>;
954		};
955
956		cmd-pins {
957			pins = "sdc2_cmd";
958			bias-pull-up;
959			drive-strength = <10>;
960		};
961
962		data-pins {
963			pins = "sdc2_data";
964			bias-pull-up;
965			drive-strength = <10>;
966		};
967	};
968
969	sdc2_card_det_n: sd-card-det-n-state {
970		pins = "gpio126";
971		function = "gpio";
972		bias-pull-up;
973	};
974};
975
976&uart3 {
977	label = "LS-UART0";
978	pinctrl-0 = <&qup_uart3_4pin>;
979
980	status = "disabled";
981};
982
983&uart6 {
984	status = "okay";
985
986	pinctrl-0 = <&qup_uart6_4pin>;
987
988	bluetooth {
989		compatible = "qcom,wcn3990-bt";
990
991		vddio-supply = <&vreg_s4a_1p8>;
992		vddxo-supply = <&vreg_l7a_1p8>;
993		vddrf-supply = <&vreg_l17a_1p3>;
994		vddch0-supply = <&vreg_l25a_3p3>;
995		max-speed = <3200000>;
996	};
997};
998
999&uart9 {
1000	label = "LS-UART1";
1001	status = "okay";
1002};
1003
1004&usb_1 {
1005	status = "okay";
1006};
1007
1008&usb_1_dwc3 {
1009	dr_mode = "peripheral";
1010};
1011
1012&usb_1_hsphy {
1013	status = "okay";
1014
1015	vdd-supply = <&vreg_l1a_0p875>;
1016	vdda-pll-supply = <&vreg_l12a_1p8>;
1017	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
1018
1019	qcom,imp-res-offset-value = <8>;
1020	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
1021	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
1022	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
1023};
1024
1025&usb_1_qmpphy {
1026	status = "okay";
1027
1028	vdda-phy-supply = <&vreg_l26a_1p2>;
1029	vdda-pll-supply = <&vreg_l1a_0p875>;
1030};
1031
1032&usb_2 {
1033	status = "okay";
1034};
1035
1036&usb_2_dwc3 {
1037	dr_mode = "host";
1038};
1039
1040&usb_2_hsphy {
1041	status = "okay";
1042
1043	vdd-supply = <&vreg_l1a_0p875>;
1044	vdda-pll-supply = <&vreg_l12a_1p8>;
1045	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
1046
1047	qcom,imp-res-offset-value = <8>;
1048	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
1049};
1050
1051&usb_2_qmpphy {
1052	status = "okay";
1053
1054	vdda-phy-supply = <&vreg_l26a_1p2>;
1055	vdda-pll-supply = <&vreg_l1a_0p875>;
1056};
1057
1058&ufs_mem_hc {
1059	status = "okay";
1060
1061	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
1062
1063	vcc-supply = <&vreg_l20a_2p95>;
1064	vcc-max-microamp = <800000>;
1065};
1066
1067&ufs_mem_phy {
1068	status = "okay";
1069
1070	vdda-phy-supply = <&vreg_l1a_0p875>;
1071	vdda-pll-supply = <&vreg_l26a_1p2>;
1072};
1073
1074&venus {
1075	status = "okay";
1076};
1077
1078&wcd9340 {
1079	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
1080	vdd-buck-supply = <&vreg_s4a_1p8>;
1081	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1082	vdd-tx-supply = <&vreg_s4a_1p8>;
1083	vdd-rx-supply = <&vreg_s4a_1p8>;
1084	vdd-io-supply = <&vreg_s4a_1p8>;
1085
1086	swm: swm@c85 {
1087		left_spkr: speaker@0,1 {
1088			compatible = "sdw10217201000";
1089			reg = <0 1>;
1090			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
1091			#thermal-sensor-cells = <0>;
1092			sound-name-prefix = "SpkrLeft";
1093			#sound-dai-cells = <0>;
1094		};
1095
1096		right_spkr: speaker@0,2 {
1097			compatible = "sdw10217201000";
1098			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
1099			reg = <0 2>;
1100			#thermal-sensor-cells = <0>;
1101			sound-name-prefix = "SpkrRight";
1102			#sound-dai-cells = <0>;
1103		};
1104	};
1105};
1106
1107&wifi {
1108	status = "okay";
1109
1110	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
1111	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
1112	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
1113	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
1114
1115	qcom,snoc-host-cap-8bit-quirk;
1116	qcom,ath10k-calibration-variant = "Thundercomm_DB845C";
1117};
1118
1119/* PINCTRL - additions to nodes defined in sdm845.dtsi */
1120&qup_spi2_default {
1121	drive-strength = <16>;
1122};
1123
1124&qup_i2c10_default {
1125	drive-strength = <2>;
1126	bias-disable;
1127};
1128
1129&qup_uart9_rx {
1130	drive-strength = <2>;
1131	bias-pull-up;
1132};
1133
1134&qup_uart9_tx {
1135	drive-strength = <2>;
1136	bias-disable;
1137};
1138
1139&pm8998_gpios {
1140
1141};
1142
1143/* PINCTRL - additions to nodes defined in sdm845.dtsi */
1144&qup_spi0_default {
1145	drive-strength = <6>;
1146	bias-disable;
1147};
1148