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	status = "okay";
823};
824
825&tlmm {
826	cam0_default: cam0-default-state {
827		rst-pins {
828			pins = "gpio9";
829			function = "gpio";
830
831			drive-strength = <16>;
832			bias-disable;
833		};
834
835		mclk0-pins {
836			pins = "gpio13";
837			function = "cam_mclk";
838
839			drive-strength = <16>;
840			bias-disable;
841		};
842	};
843
844	cam3_default: cam3-default-state {
845		rst-pins {
846			function = "gpio";
847			pins = "gpio21";
848
849			drive-strength = <16>;
850			bias-disable;
851		};
852
853		mclk3-pins {
854			function = "cam_mclk";
855			pins = "gpio16";
856
857			drive-strength = <16>;
858			bias-disable;
859		};
860	};
861
862	dsi_sw_sel: dsi-sw-sel-state {
863		pins = "gpio120";
864		function = "gpio";
865
866		drive-strength = <2>;
867		bias-disable;
868		output-high;
869	};
870
871	lt9611_irq_pin: lt9611-irq-state {
872		pins = "gpio84";
873		function = "gpio";
874		bias-disable;
875	};
876
877	pcie0_default_state: pcie0-default-state {
878		clkreq-pins {
879			pins = "gpio36";
880			function = "pci_e0";
881			bias-pull-up;
882		};
883
884		reset-n-pins {
885			pins = "gpio35";
886			function = "gpio";
887
888			drive-strength = <2>;
889			output-low;
890			bias-pull-down;
891		};
892
893		wake-n-pins {
894			pins = "gpio37";
895			function = "gpio";
896
897			drive-strength = <2>;
898			bias-pull-up;
899		};
900	};
901
902	pcie0_pwren_state: pcie0-pwren-state {
903		pins = "gpio90";
904		function = "gpio";
905
906		drive-strength = <2>;
907		bias-disable;
908	};
909
910	pcie1_default_state: pcie1-default-state {
911		perst-n-pins {
912			pins = "gpio102";
913			function = "gpio";
914
915			drive-strength = <16>;
916			bias-disable;
917		};
918
919		clkreq-pins {
920			pins = "gpio103";
921			function = "pci_e1";
922			bias-pull-up;
923		};
924
925		wake-n-pins {
926			pins = "gpio11";
927			function = "gpio";
928
929			drive-strength = <2>;
930			bias-pull-up;
931		};
932
933		reset-n-pins {
934			pins = "gpio75";
935			function = "gpio";
936
937			drive-strength = <16>;
938			bias-pull-up;
939			output-high;
940		};
941	};
942
943	sdc2_default_state: sdc2-default-state {
944		clk-pins {
945			pins = "sdc2_clk";
946			bias-disable;
947
948			/*
949			 * It seems that mmc_test reports errors if drive
950			 * strength is not 16 on clk, cmd, and data pins.
951			 */
952			drive-strength = <16>;
953		};
954
955		cmd-pins {
956			pins = "sdc2_cmd";
957			bias-pull-up;
958			drive-strength = <10>;
959		};
960
961		data-pins {
962			pins = "sdc2_data";
963			bias-pull-up;
964			drive-strength = <10>;
965		};
966	};
967
968	sdc2_card_det_n: sd-card-det-n-state {
969		pins = "gpio126";
970		function = "gpio";
971		bias-pull-up;
972	};
973};
974
975&uart3 {
976	label = "LS-UART0";
977	pinctrl-0 = <&qup_uart3_4pin>;
978
979	status = "disabled";
980};
981
982&uart6 {
983	status = "okay";
984
985	pinctrl-0 = <&qup_uart6_4pin>;
986
987	bluetooth {
988		compatible = "qcom,wcn3990-bt";
989
990		vddio-supply = <&vreg_s4a_1p8>;
991		vddxo-supply = <&vreg_l7a_1p8>;
992		vddrf-supply = <&vreg_l17a_1p3>;
993		vddch0-supply = <&vreg_l25a_3p3>;
994		max-speed = <3200000>;
995	};
996};
997
998&uart9 {
999	label = "LS-UART1";
1000	status = "okay";
1001};
1002
1003&usb_1 {
1004	status = "okay";
1005};
1006
1007&usb_1_dwc3 {
1008	dr_mode = "peripheral";
1009};
1010
1011&usb_1_hsphy {
1012	status = "okay";
1013
1014	vdd-supply = <&vreg_l1a_0p875>;
1015	vdda-pll-supply = <&vreg_l12a_1p8>;
1016	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
1017
1018	qcom,imp-res-offset-value = <8>;
1019	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>;
1020	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>;
1021	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
1022};
1023
1024&usb_1_qmpphy {
1025	status = "okay";
1026
1027	vdda-phy-supply = <&vreg_l26a_1p2>;
1028	vdda-pll-supply = <&vreg_l1a_0p875>;
1029};
1030
1031&usb_2 {
1032	status = "okay";
1033};
1034
1035&usb_2_dwc3 {
1036	dr_mode = "host";
1037};
1038
1039&usb_2_hsphy {
1040	status = "okay";
1041
1042	vdd-supply = <&vreg_l1a_0p875>;
1043	vdda-pll-supply = <&vreg_l12a_1p8>;
1044	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
1045
1046	qcom,imp-res-offset-value = <8>;
1047	qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>;
1048};
1049
1050&usb_2_qmpphy {
1051	status = "okay";
1052
1053	vdda-phy-supply = <&vreg_l26a_1p2>;
1054	vdda-pll-supply = <&vreg_l1a_0p875>;
1055};
1056
1057&ufs_mem_hc {
1058	status = "okay";
1059
1060	reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>;
1061
1062	vcc-supply = <&vreg_l20a_2p95>;
1063	vcc-max-microamp = <800000>;
1064};
1065
1066&ufs_mem_phy {
1067	status = "okay";
1068
1069	vdda-phy-supply = <&vreg_l1a_0p875>;
1070	vdda-pll-supply = <&vreg_l26a_1p2>;
1071};
1072
1073&venus {
1074	status = "okay";
1075};
1076
1077&wcd9340 {
1078	reset-gpios = <&tlmm 64 GPIO_ACTIVE_HIGH>;
1079	vdd-buck-supply = <&vreg_s4a_1p8>;
1080	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
1081	vdd-tx-supply = <&vreg_s4a_1p8>;
1082	vdd-rx-supply = <&vreg_s4a_1p8>;
1083	vdd-io-supply = <&vreg_s4a_1p8>;
1084
1085	swm: swm@c85 {
1086		left_spkr: speaker@0,1 {
1087			compatible = "sdw10217201000";
1088			reg = <0 1>;
1089			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
1090			#thermal-sensor-cells = <0>;
1091			sound-name-prefix = "SpkrLeft";
1092			#sound-dai-cells = <0>;
1093		};
1094
1095		right_spkr: speaker@0,2 {
1096			compatible = "sdw10217201000";
1097			powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>;
1098			reg = <0 2>;
1099			#thermal-sensor-cells = <0>;
1100			sound-name-prefix = "SpkrRight";
1101			#sound-dai-cells = <0>;
1102		};
1103	};
1104};
1105
1106&wifi {
1107	status = "okay";
1108
1109	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
1110	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
1111	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
1112	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
1113
1114	qcom,snoc-host-cap-8bit-quirk;
1115	qcom,ath10k-calibration-variant = "Thundercomm_DB845C";
1116};
1117
1118/* PINCTRL - additions to nodes defined in sdm845.dtsi */
1119&qup_spi2_default {
1120	drive-strength = <16>;
1121};
1122
1123&qup_i2c10_default {
1124	drive-strength = <2>;
1125	bias-disable;
1126};
1127
1128&qup_uart9_rx {
1129	drive-strength = <2>;
1130	bias-pull-up;
1131};
1132
1133&qup_uart9_tx {
1134	drive-strength = <2>;
1135	bias-disable;
1136};
1137
1138/* PINCTRL - additions to nodes defined in sdm845.dtsi */
1139&qup_spi0_default {
1140	drive-strength = <6>;
1141	bias-disable;
1142};
1143