xref: /linux/arch/arm64/boot/dts/qcom/msm8996-oneplus-common.dtsi (revision 9f2c9170934eace462499ba0bfe042cc72900173)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2022, Harry Austen <hpausten@protonmail.com>
4 */
5
6#include "msm8996.dtsi"
7#include "pm8994.dtsi"
8#include "pmi8994.dtsi"
9#include "pmi8996.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
12#include <dt-bindings/sound/qcom,q6afe.h>
13#include <dt-bindings/sound/qcom,q6asm.h>
14#include <dt-bindings/sound/qcom,wcd9335.h>
15
16/ {
17	aliases {
18		serial0 = &blsp1_uart2;
19		serial1 = &blsp2_uart2;
20	};
21
22	battery: battery {
23		compatible = "simple-battery";
24
25		constant-charge-current-max-microamp = <3000000>;
26		voltage-min-design-microvolt = <3400000>;
27	};
28
29	chosen {
30		stdout-path = "serial1:115200n8";
31	};
32
33	clocks {
34		div1_mclk: div1-clk {
35			compatible = "gpio-gate-clock";
36			pinctrl-names = "default";
37			pinctrl-0 = <&audio_mclk>;
38			#clock-cells = <0>;
39			clocks = <&rpmcc RPM_SMD_DIV_CLK1>;
40			enable-gpios = <&pm8994_gpios 15 GPIO_ACTIVE_HIGH>;
41		};
42
43		divclk4: div4-clk {
44			compatible = "fixed-clock";
45			pinctrl-names = "default";
46			pinctrl-0 = <&divclk4_pin_a>;
47			#clock-cells = <0>;
48			clock-frequency = <32768>;
49			clock-output-names = "divclk4";
50		};
51	};
52
53	reserved-memory {
54		ramoops@ac000000 {
55			compatible = "ramoops";
56			reg = <0 0xac000000 0 0x200000>;
57			record-size = <0x20000>;
58			console-size = <0x100000>;
59			pmsg-size = <0x80000>;
60		};
61	};
62
63	vph_pwr: vph-pwr-regulator {
64		compatible = "regulator-fixed";
65		regulator-name = "vph_pwr";
66		regulator-min-microvolt = <3700000>;
67		regulator-max-microvolt = <3700000>;
68		regulator-always-on;
69		regulator-boot-on;
70	};
71
72	wlan_en: wlan-en-regulator {
73		compatible = "regulator-fixed";
74		pinctrl-names = "default";
75		pinctrl-0 = <&wlan_en_gpios>;
76		regulator-name = "wlan-en-regulator";
77		regulator-min-microvolt = <1800000>;
78		regulator-max-microvolt = <1800000>;
79
80		gpio = <&pm8994_gpios 8 GPIO_ACTIVE_HIGH>;
81
82		/* WLAN card specific delay */
83		startup-delay-us = <70000>;
84		enable-active-high;
85	};
86};
87
88&adsp_pil {
89	status = "okay";
90};
91
92&blsp1_i2c3 {
93	status = "okay";
94
95	tfa9890_amp: audio-codec@36 {
96		compatible = "nxp,tfa9890";
97		reg = <0x36>;
98		#sound-dai-cells = <0>;
99	};
100};
101
102&blsp1_i2c6 {
103	status = "okay";
104
105	bq27541: fuel-gauge@55 {
106		compatible = "ti,bq27541";
107		reg = <0x55>;
108	};
109};
110
111&blsp1_uart2 {
112	label = "BT-UART";
113	uart-has-rtscts;
114	status = "okay";
115
116	bluetooth {
117		compatible = "qcom,qca6174-bt";
118		pinctrl-names = "default";
119		pinctrl-0 = <&bt_en_gpios>;
120		enable-gpios = <&pm8994_gpios 19 GPIO_ACTIVE_HIGH>;
121		clocks = <&divclk4>;
122	};
123};
124
125&blsp2_i2c1 {
126	status = "okay";
127};
128
129&blsp2_i2c6 {
130	status = "okay";
131
132	synaptics_rmi4_i2c: touchscreen@20 {
133		compatible = "syna,rmi4-i2c";
134		reg = <0x20>;
135		#address-cells = <1>;
136		#size-cells = <0>;
137		interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
138		pinctrl-names = "default", "sleep";
139		pinctrl-0 = <&touch_default>;
140		pinctrl-1 = <&touch_suspend>;
141		vdd-supply = <&vreg_l22a_3p0>;
142		vio-supply = <&vreg_s4a_1p8>;
143		syna,reset-delay-ms = <200>;
144		syna,startup-delay-ms = <200>;
145
146		rmi4-f01@1 {
147			reg = <0x1>;
148			syna,nosleep-mode = <1>;
149		};
150
151		rmi4-f12@12 {
152			reg = <0x12>;
153			syna,sensor-type = <1>;
154			touchscreen-x-mm = <68>;
155			touchscreen-y-mm = <122>;
156		};
157	};
158};
159
160&blsp2_uart2 {
161	pinctrl-names = "default", "sleep";
162	pinctrl-0 = <&blsp2_uart2_2pins_default>;
163	pinctrl-1 = <&blsp2_uart2_2pins_sleep>;
164	status = "okay";
165};
166
167&camss {
168	vdda-supply = <&vreg_l2a_1p25>;
169};
170
171&dsi0 {
172	vdda-supply = <&vreg_l2a_1p25>;
173	vcca-supply = <&vreg_l22a_3p0>;
174	status = "okay";
175};
176
177&dsi0_out {
178	data-lanes = <0 1 2 3>;
179};
180
181&dsi0_phy {
182	vdda-supply = <&vreg_l2a_1p25>;
183	vcca-supply = <&vreg_l28a_0p925>;
184	status = "okay";
185};
186
187&gpu {
188	status = "okay";
189};
190
191&hsusb_phy1 {
192	vdd-supply = <&vreg_l28a_0p925>;
193	vdda-pll-supply = <&vreg_l12a_1p8>;
194	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
195	status = "okay";
196};
197
198&hsusb_phy2 {
199	vdd-supply = <&vreg_l28a_0p925>;
200	vdda-pll-supply = <&vreg_l12a_1p8>;
201	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
202	status = "okay";
203};
204
205&mdp {
206	status = "okay";
207};
208
209&mdss {
210	status = "okay";
211};
212
213&mmcc {
214	vdd-gfx-supply = <&vdd_gfx>;
215};
216
217&mss_pil {
218	pll-supply = <&vreg_l12a_1p8>;
219	status = "okay";
220};
221
222&pcie0 {
223	perst-gpios = <&tlmm 35 GPIO_ACTIVE_LOW>;
224	vddpe-3v3-supply = <&wlan_en>;
225	vdda-supply = <&vreg_l28a_0p925>;
226	status = "okay";
227};
228
229&pcie_phy {
230	vdda-phy-supply = <&vreg_l28a_0p925>;
231	vdda-pll-supply = <&vreg_l12a_1p8>;
232	status = "okay";
233};
234
235&pm8994_gpios {
236	bt_en_gpios: bt-en-gpios-state {
237		pins = "gpio19";
238		function = PMIC_GPIO_FUNC_NORMAL;
239		output-low;
240		power-source = <PM8994_GPIO_S4>;
241		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
242		bias-pull-down;
243	};
244
245	wlan_en_gpios: wlan-en-gpios-state {
246		pins = "gpio8";
247		function = PMIC_GPIO_FUNC_NORMAL;
248		output-low;
249		power-source = <PM8994_GPIO_S4>;
250		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
251		bias-pull-down;
252	};
253
254	audio_mclk: divclk1-state {
255		pins = "gpio15";
256		function = PMIC_GPIO_FUNC_FUNC1;
257		power-source = <PM8994_GPIO_S4>;
258	};
259
260	divclk4_pin_a: divclk4-state {
261		pins = "gpio18";
262		function = PMIC_GPIO_FUNC_FUNC2;
263		bias-disable;
264		power-source = <PM8994_GPIO_S4>;
265	};
266};
267
268&pm8994_spmi_regulators {
269	qcom,saw-reg = <&saw3>;
270
271	s9 {
272		qcom,saw-slave;
273	};
274
275	s10 {
276		qcom,saw-slave;
277	};
278
279	s11 {
280		qcom,saw-leader;
281		regulator-min-microvolt = <1140000>;
282		regulator-max-microvolt = <1140000>;
283		regulator-max-step-microvolt = <150000>;
284		regulator-always-on;
285	};
286};
287
288&pmi8994_spmi_regulators {
289	vdd_gfx: s2 {
290		regulator-name = "vdd-gfx";
291		regulator-min-microvolt = <980000>;
292		regulator-max-microvolt = <1230000>;
293	};
294};
295
296&q6asmdai {
297	#address-cells = <1>;
298	#size-cells = <0>;
299
300	dai@0 {
301		reg = <0>;
302	};
303
304	dai@1 {
305		reg = <1>;
306	};
307
308	dai@2 {
309		reg = <2>;
310	};
311};
312
313&rpm_requests {
314	regulators {
315		compatible = "qcom,rpm-pm8994-regulators";
316
317		vreg_s3a_1p3: s3 {
318			regulator-name = "vreg_s3a_1p3";
319			regulator-min-microvolt = <1300000>;
320			regulator-max-microvolt = <1300000>;
321		};
322
323		vreg_s4a_1p8: s4 {
324			regulator-name = "vreg_s4a_1p8";
325			regulator-min-microvolt = <1800000>;
326			regulator-max-microvolt = <1800000>;
327			regulator-always-on;
328		};
329
330		vreg_s5a_2p15: s5 {
331			regulator-name = "vreg_s5a_2p15";
332			regulator-min-microvolt = <2150000>;
333			regulator-max-microvolt = <2150000>;
334		};
335
336		vreg_s7a_0p8: s7 {
337			regulator-name = "vreg_s7a_0p8";
338			regulator-min-microvolt = <800000>;
339			regulator-max-microvolt = <800000>;
340		};
341
342		vreg_l1a_1p0: l1 {
343			regulator-name = "vreg_l1a_1p0";
344			regulator-min-microvolt = <1000000>;
345			regulator-max-microvolt = <1000000>;
346		};
347
348		vreg_l2a_1p25: l2 {
349			regulator-name = "vreg_l2a_1p25";
350			regulator-min-microvolt = <1250000>;
351			regulator-max-microvolt = <1250000>;
352			regulator-allow-set-load;
353		};
354
355		vreg_l3a_1p1: l3 {
356			regulator-name = "vreg_l3a_1p1";
357			regulator-min-microvolt = <1100000>;
358			regulator-max-microvolt = <1100000>;
359		};
360
361		vreg_l4a_1p225: l4 {
362			regulator-name = "vreg_l4a_1p225";
363			regulator-min-microvolt = <1225000>;
364			regulator-max-microvolt = <1225000>;
365		};
366
367		vreg_l6a_1p2: l6 {
368			regulator-name = "vreg_l6a_1p2";
369			regulator-min-microvolt = <1200000>;
370			regulator-max-microvolt = <1200000>;
371		};
372
373		vreg_l7a_1p8: l7 {
374			regulator-name = "vreg_l7a_1p8";
375			regulator-min-microvolt = <1800000>;
376			regulator-max-microvolt = <1800000>;
377		};
378
379		vreg_l9a_1p8: l9 {
380			regulator-name = "vreg_l9a_1p8";
381			regulator-min-microvolt = <1800000>;
382			regulator-max-microvolt = <1800000>;
383		};
384
385		vreg_l10a_1p8: l10 {
386			regulator-name = "vreg_l10a_1p8";
387			regulator-min-microvolt = <1800000>;
388			regulator-max-microvolt = <1800000>;
389		};
390
391		vreg_l11a_1p15: l11 {
392			regulator-name = "vreg_l11a_1p15";
393			regulator-min-microvolt = <1150000>;
394			regulator-max-microvolt = <1150000>;
395		};
396
397		vreg_l12a_1p8: l12 {
398			regulator-name = "vreg_l12a_1p8";
399			regulator-min-microvolt = <1800000>;
400			regulator-max-microvolt = <1800000>;
401			regulator-allow-set-load;
402		};
403
404		vreg_l13a_2p95: l13 {
405			regulator-name = "vreg_l13a_2p95";
406			regulator-min-microvolt = <2950000>;
407			regulator-max-microvolt = <2950000>;
408		};
409
410		vreg_l16a_2p7: l16 {
411			regulator-name = "vreg_l16a_2p7";
412			regulator-min-microvolt = <2700000>;
413			regulator-max-microvolt = <2700000>;
414		};
415
416		vreg_l17a_2p6: l17 {
417			regulator-name = "vreg_l17a_2p6";
418			regulator-min-microvolt = <2600000>;
419			regulator-max-microvolt = <2600000>;
420		};
421
422		vreg_l18a_3p3: l18 {
423			regulator-name = "vreg_l18a_3p3";
424			regulator-min-microvolt = <3300000>;
425			regulator-max-microvolt = <3300000>;
426		};
427
428		vreg_l19a_3p0: l19 {
429			regulator-name = "vreg_l19a_3p0";
430			regulator-min-microvolt = <3000000>;
431			regulator-max-microvolt = <3000000>;
432		};
433
434		vreg_l20a_2p95: l20 {
435			regulator-name = "vreg_l20a_2p95";
436			regulator-min-microvolt = <2950000>;
437			regulator-max-microvolt = <2950000>;
438			regulator-allow-set-load;
439		};
440
441		vreg_l21a_2p95: l21 {
442			regulator-name = "vreg_l21a_2p95";
443			regulator-min-microvolt = <2950000>;
444			regulator-max-microvolt = <2950000>;
445			regulator-allow-set-load;
446			regulator-system-load = <200000>;
447		};
448
449		vreg_l22a_3p0: l22 {
450			regulator-name = "vreg_l22a_3p0";
451			regulator-min-microvolt = <3000000>;
452			regulator-max-microvolt = <3300000>;
453		};
454
455		vreg_l23a_2p8: l23 {
456			regulator-name = "vreg_l23a_2p8";
457			regulator-min-microvolt = <2800000>;
458			regulator-max-microvolt = <2800000>;
459		};
460
461		vreg_l24a_3p075: l24 {
462			regulator-name = "vreg_l24a_3p075";
463			regulator-min-microvolt = <3075000>;
464			regulator-max-microvolt = <3075000>;
465		};
466
467		vreg_l25a_1p2: l25 {
468			regulator-name = "vreg_l25a_1p2";
469			regulator-min-microvolt = <1200000>;
470			regulator-max-microvolt = <1200000>;
471			regulator-allow-set-load;
472			regulator-always-on;
473		};
474
475		vreg_l27a_1p2: l27 {
476			regulator-name = "vreg_l27a_1p2";
477			regulator-min-microvolt = <1200000>;
478			regulator-max-microvolt = <1200000>;
479		};
480
481		vreg_l28a_0p925: l28 {
482			regulator-name = "vreg_l28a_0p925";
483			regulator-min-microvolt = <925000>;
484			regulator-max-microvolt = <925000>;
485			regulator-allow-set-load;
486		};
487
488		vreg_l29a_2p8: l29 {
489			regulator-name = "vreg_l29a_2p8";
490			regulator-min-microvolt = <2800000>;
491			regulator-max-microvolt = <2800000>;
492		};
493
494		vreg_l30a_1p8: l30 {
495			regulator-name = "vreg_l30a_1p8";
496			regulator-min-microvolt = <1800000>;
497			regulator-max-microvolt = <1800000>;
498		};
499
500		vreg_l32a_1p8: l32 {
501			regulator-name = "vreg_l32a_1p8";
502			regulator-min-microvolt = <1800000>;
503			regulator-max-microvolt = <1800000>;
504		};
505	};
506};
507
508&slpi_pil {
509	status = "okay";
510};
511
512&sound {
513	compatible = "qcom,apq8096-sndcard";
514	model = "OnePlus3";
515	audio-routing = "RX_BIAS", "MCLK",
516			"AMIC2", "MIC BIAS2",
517			"MIC BIAS2", "Headset Mic",
518			"AMIC4", "MIC BIAS1",
519			"MIC BIAS1", "Primary Mic",
520			"AMIC5", "MIC BIAS3",
521			"MIC BIAS3", "Noise Mic";
522
523	mm1-dai-link {
524		link-name = "MultiMedia1";
525
526		cpu {
527			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
528		};
529	};
530
531	mm2-dai-link {
532		link-name = "MultiMedia2";
533
534		cpu {
535			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
536		};
537	};
538
539	mm3-dai-link {
540		link-name = "MultiMedia3";
541
542		cpu {
543			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
544		};
545	};
546
547	mm4-dai-link {
548		link-name = "MultiMedia4";
549
550		cpu {
551			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>;
552		};
553	};
554
555	mm5-dai-link {
556		link-name = "MultiMedia5";
557
558		cpu {
559			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA5>;
560		};
561	};
562
563	mm6-dai-link {
564		link-name = "MultiMedia6";
565
566		cpu {
567			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA6>;
568		};
569	};
570
571	mm7-dai-link {
572		link-name = "MultiMedia7";
573
574		cpu {
575			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA7>;
576		};
577	};
578
579	mm8-dai-link {
580		link-name = "MultiMedia8";
581
582		cpu {
583			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA8>;
584		};
585	};
586
587	mm9-dai-link {
588		link-name = "MultiMedia9";
589
590		cpu {
591			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA9>;
592		};
593	};
594
595	mm10-dai-link {
596		link-name = "MultiMedia10";
597
598		cpu {
599			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA10>;
600		};
601	};
602
603	mm11-dai-link {
604		link-name = "MultiMedia11";
605
606		cpu {
607			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA11>;
608		};
609	};
610
611	mm12-dai-link {
612		link-name = "MultiMedia12";
613
614		cpu {
615			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA12>;
616		};
617	};
618
619	mm13-dai-link {
620		link-name = "MultiMedia13";
621
622		cpu {
623			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA13>;
624		};
625	};
626
627	mm14-dai-link {
628		link-name = "MultiMedia14";
629
630		cpu {
631			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA14>;
632		};
633	};
634
635	mm15-dai-link {
636		link-name = "MultiMedia15";
637
638		cpu {
639			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA15>;
640		};
641	};
642
643	mm16-dai-link {
644		link-name = "MultiMedia16";
645
646		cpu {
647			sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA16>;
648		};
649	};
650
651	slim-dai-link {
652		link-name = "SLIM Playback";
653
654		cpu {
655			sound-dai = <&q6afedai SLIMBUS_6_RX>;
656		};
657
658		platform {
659			sound-dai = <&q6routing>;
660		};
661
662		codec {
663			sound-dai = <&wcd9335 AIF4_PB>;
664		};
665	};
666
667	slimcap-dai-link {
668		link-name = "SLIM Capture";
669
670		cpu {
671			sound-dai = <&q6afedai SLIMBUS_0_TX>;
672		};
673
674		platform {
675			sound-dai = <&q6routing>;
676		};
677
678		codec {
679			sound-dai = <&wcd9335 AIF1_CAP>;
680		};
681	};
682
683	speaker-dai-link {
684		link-name = "Speaker";
685
686		cpu {
687			sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
688		};
689
690		codec {
691			sound-dai = <&tfa9890_amp>;
692		};
693	};
694};
695
696&tlmm {
697	gpio-reserved-ranges = <81 4>;
698
699	mdss_dsi_active: mdss-dsi-active-state {
700		pins = "gpio8";
701		function = "gpio";
702		drive-strength = <8>;
703		bias-disable;
704	};
705
706	mdss_dsi_suspend: mdss-dsi-suspend-state {
707		pins = "gpio8";
708		function = "gpio";
709		drive-strength = <2>;
710		bias-pull-down;
711	};
712
713	mdss_te_active: mdss-te-active-state {
714		pins = "gpio10";
715		function = "mdp_vsync";
716		drive-strength = <2>;
717		bias-pull-down;
718	};
719
720	mdss_te_suspend: mdss-te-suspend-state {
721		pins = "gpio10";
722		function = "mdp_vsync";
723		drive-strength = <2>;
724		bias-pull-down;
725	};
726
727	touch_default: touch-default-state {
728		pins = "gpio89", "gpio125", "gpio49";
729		function = "gpio";
730		drive-strength = <16>;
731		bias-pull-up;
732	};
733
734	touch_suspend: touch-suspend-state {
735		pins = "gpio89", "gpio125", "gpio49";
736		function = "gpio";
737		drive-strength = <2>;
738		bias-disable;
739	};
740};
741
742&ufsphy {
743	vdda-phy-supply = <&vreg_l28a_0p925>;
744	vdda-pll-supply = <&vreg_l12a_1p8>;
745	vddp-ref-clk-supply = <&vreg_l25a_1p2>;
746
747	status = "okay";
748};
749
750&ufshc {
751	vcc-supply = <&vreg_l20a_2p95>;
752	vccq-supply = <&vreg_l25a_1p2>;
753	vccq2-supply = <&vreg_s4a_1p8>;
754
755	vcc-max-microamp = <600000>;
756	vccq-max-microamp = <450000>;
757	vccq2-max-microamp = <450000>;
758
759	status = "okay";
760};
761
762&usb3 {
763	status = "okay";
764};
765
766&usb3_dwc3 {
767	phys = <&hsusb_phy1>;
768	phy-names = "usb2-phy";
769
770	maximum-speed = "high-speed";
771};
772
773&venus {
774	status = "okay";
775};
776
777&wcd9335 {
778	clock-names = "mclk", "slimbus";
779	clocks = <&div1_mclk>,
780		 <&rpmcc RPM_SMD_BB_CLK1>;
781
782	vdd-buck-supply = <&vreg_s4a_1p8>;
783	vdd-buck-sido-supply = <&vreg_s4a_1p8>;
784	vdd-tx-supply = <&vreg_s4a_1p8>;
785	vdd-rx-supply = <&vreg_s4a_1p8>;
786	vdd-io-supply = <&vreg_s4a_1p8>;
787};
788