xref: /linux/arch/arm/boot/dts/qcom/qcom-msm8974pro-samsung-klte-common.dtsi (revision 36ec807b627b4c0a0a382f0ae48eac7187d14b2b)
1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-msm8974pro.dtsi"
3#include "pma8084.dtsi"
4#include <dt-bindings/input/input.h>
5#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
6#include <dt-bindings/leds/common.h>
7
8/ {
9	chassis-type = "handset";
10
11	aliases {
12		serial0 = &blsp1_uart1;
13		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
14		mmc1 = &sdhc_3; /* SDC2 SD card slot */
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	gpio-keys {
22		compatible = "gpio-keys";
23
24		pinctrl-names = "default";
25		pinctrl-0 = <&gpio_keys_pin_a>;
26
27		key-volume-down {
28			label = "volume_down";
29			gpios = <&pma8084_gpios 2 GPIO_ACTIVE_LOW>;
30			linux,input-type = <1>;
31			linux,code = <KEY_VOLUMEDOWN>;
32			debounce-interval = <15>;
33		};
34
35		key-home {
36			label = "home_key";
37			gpios = <&pma8084_gpios 3 GPIO_ACTIVE_LOW>;
38			linux,input-type = <1>;
39			linux,code = <KEY_HOMEPAGE>;
40			wakeup-source;
41			debounce-interval = <15>;
42		};
43
44		key-volume-up {
45			label = "volume_up";
46			gpios = <&pma8084_gpios 5 GPIO_ACTIVE_LOW>;
47			linux,input-type = <1>;
48			linux,code = <KEY_VOLUMEUP>;
49			debounce-interval = <15>;
50		};
51	};
52
53	i2c-gpio-touchkey {
54		compatible = "i2c-gpio";
55		#address-cells = <1>;
56		#size-cells = <0>;
57		sda-gpios = <&tlmm 95 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
58		scl-gpios = <&tlmm 96 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
59		pinctrl-names = "default";
60		pinctrl-0 = <&i2c_touchkey_pins>;
61
62		touchkey@20 {
63			compatible = "cypress,tm2-touchkey";
64			reg = <0x20>;
65
66			interrupt-parent = <&pma8084_gpios>;
67			interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
68			pinctrl-names = "default";
69			pinctrl-0 = <&touchkey_pin>;
70
71			vcc-supply = <&max77826_ldo15>;
72			vdd-supply = <&pma8084_l19>;
73
74			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
75		};
76	};
77
78	i2c_led_gpio: i2c-gpio-led {
79		compatible = "i2c-gpio";
80		#address-cells = <1>;
81		#size-cells = <0>;
82		pinctrl-names = "default";
83		pinctrl-0 = <&i2c_led_gpioex_pins>;
84
85		i2c-gpio,delay-us = <2>;
86
87		gpio_expander: gpio@20 {
88			compatible = "nxp,pcal6416";
89			reg = <0x20>;
90
91			gpio-controller;
92			#gpio-cells = <2>;
93
94			vcc-supply = <&pma8084_s4>;
95
96			pinctrl-names = "default";
97			pinctrl-0 = <&gpioex_pin>;
98
99			reset-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
100		};
101
102		led-controller@30 {
103			compatible = "panasonic,an30259a";
104			reg = <0x30>;
105
106			#address-cells = <1>;
107			#size-cells = <0>;
108
109			led@1 {
110				reg = <1>;
111				function = LED_FUNCTION_STATUS;
112				color = <LED_COLOR_ID_RED>;
113			};
114
115			led@2 {
116				reg = <2>;
117				function = LED_FUNCTION_STATUS;
118				color = <LED_COLOR_ID_GREEN>;
119			};
120
121			led@3 {
122				reg = <3>;
123				function = LED_FUNCTION_STATUS;
124				color = <LED_COLOR_ID_BLUE>;
125			};
126		};
127	};
128
129	vreg_wlan: wlan-regulator {
130		compatible = "regulator-fixed";
131
132		regulator-name = "wl-reg";
133		regulator-min-microvolt = <3300000>;
134		regulator-max-microvolt = <3300000>;
135
136		gpio = <&gpio_expander 8 GPIO_ACTIVE_HIGH>;
137		enable-active-high;
138	};
139
140	vreg_panel: panel-regulator {
141		compatible = "regulator-fixed";
142
143		pinctrl-names = "default";
144		pinctrl-0 = <&panel_en_pin>;
145
146		regulator-name = "panel-vddr-reg";
147		regulator-min-microvolt = <1500000>;
148		regulator-max-microvolt = <1500000>;
149
150		gpio = <&pma8084_gpios 14 GPIO_ACTIVE_HIGH>;
151		enable-active-high;
152	};
153
154	vreg_vph_pwr: vreg-vph-pwr {
155		compatible = "regulator-fixed";
156		regulator-name = "vph-pwr";
157
158		regulator-min-microvolt = <3600000>;
159		regulator-max-microvolt = <3600000>;
160
161		regulator-always-on;
162	};
163};
164
165&blsp1_i2c2 {
166	status = "okay";
167
168	touchscreen@20 {
169		compatible = "syna,rmi4-i2c";
170		reg = <0x20>;
171
172		interrupt-parent = <&pma8084_gpios>;
173		interrupts = <8 IRQ_TYPE_EDGE_FALLING>;
174
175		vdd-supply = <&max77826_ldo13>;
176		vio-supply = <&pma8084_lvs2>;
177
178		pinctrl-names = "default";
179		pinctrl-0 = <&touch_pin>;
180
181		syna,startup-delay-ms = <100>;
182
183		#address-cells = <1>;
184		#size-cells = <0>;
185
186		rmi4-f01@1 {
187			reg = <0x1>;
188			syna,nosleep-mode = <1>;
189		};
190
191		rmi4-f12@12 {
192			reg = <0x12>;
193			syna,sensor-type = <1>;
194		};
195	};
196};
197
198&blsp1_i2c6 {
199	status = "okay";
200
201	pmic@60 {
202		reg = <0x60>;
203		compatible = "maxim,max77826";
204
205		regulators {
206			max77826_ldo1: LDO1 {
207				regulator-min-microvolt = <1200000>;
208				regulator-max-microvolt = <1200000>;
209			};
210
211			max77826_ldo2: LDO2 {
212				regulator-min-microvolt = <1000000>;
213				regulator-max-microvolt = <1000000>;
214			};
215
216			max77826_ldo3: LDO3 {
217				regulator-min-microvolt = <1200000>;
218				regulator-max-microvolt = <1200000>;
219			};
220
221			max77826_ldo4: LDO4 {
222				regulator-min-microvolt = <1800000>;
223				regulator-max-microvolt = <1800000>;
224			};
225
226			max77826_ldo5: LDO5 {
227				regulator-min-microvolt = <1800000>;
228				regulator-max-microvolt = <1800000>;
229			};
230
231			max77826_ldo6: LDO6 {
232				regulator-min-microvolt = <1800000>;
233				regulator-max-microvolt = <3300000>;
234			};
235
236			max77826_ldo7: LDO7 {
237				regulator-min-microvolt = <1800000>;
238				regulator-max-microvolt = <1800000>;
239			};
240
241			max77826_ldo8: LDO8 {
242				regulator-min-microvolt = <1800000>;
243				regulator-max-microvolt = <3300000>;
244			};
245
246			max77826_ldo9: LDO9 {
247				regulator-min-microvolt = <1800000>;
248				regulator-max-microvolt = <1800000>;
249			};
250
251			max77826_ldo10: LDO10 {
252				regulator-min-microvolt = <2800000>;
253				regulator-max-microvolt = <2950000>;
254			};
255
256			max77826_ldo11: LDO11 {
257				regulator-min-microvolt = <2700000>;
258				regulator-max-microvolt = <2950000>;
259			};
260
261			max77826_ldo12: LDO12 {
262				regulator-min-microvolt = <2500000>;
263				regulator-max-microvolt = <3300000>;
264			};
265
266			max77826_ldo13: LDO13 {
267				regulator-min-microvolt = <3300000>;
268				regulator-max-microvolt = <3300000>;
269			};
270
271			max77826_ldo14: LDO14 {
272				regulator-min-microvolt = <3300000>;
273				regulator-max-microvolt = <3300000>;
274			};
275
276			max77826_ldo15: LDO15 {
277				regulator-min-microvolt = <1800000>;
278				regulator-max-microvolt = <1800000>;
279			};
280
281			max77826_buck: BUCK {
282				regulator-min-microvolt = <1225000>;
283				regulator-max-microvolt = <1225000>;
284			};
285
286			max77826_buckboost: BUCKBOOST {
287				regulator-min-microvolt = <3400000>;
288				regulator-max-microvolt = <3400000>;
289			};
290		};
291	};
292};
293
294&blsp1_uart2 {
295	status = "okay";
296};
297
298&blsp2_i2c6 {
299	status = "okay";
300
301	fuelgauge@36 {
302		compatible = "maxim,max17048";
303		reg = <0x36>;
304
305		maxim,double-soc;
306		maxim,rcomp = /bits/ 8 <0x56>;
307
308		interrupt-parent = <&pma8084_gpios>;
309		interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
310
311		pinctrl-names = "default";
312		pinctrl-0 = <&fuelgauge_pin>;
313	};
314};
315
316&blsp2_uart2 {
317	status = "okay";
318
319	pinctrl-names = "default", "sleep";
320	pinctrl-0 = <&blsp2_uart2_pins_active>;
321	pinctrl-1 = <&blsp2_uart2_pins_sleep>;
322
323	bluetooth {
324		compatible = "brcm,bcm43540-bt";
325		max-speed = <3000000>;
326		pinctrl-names = "default";
327		pinctrl-0 = <&bt_pins>;
328		device-wakeup-gpios = <&tlmm 91 GPIO_ACTIVE_HIGH>;
329		shutdown-gpios = <&gpio_expander 9 GPIO_ACTIVE_HIGH>;
330		interrupt-parent = <&tlmm>;
331		interrupts = <75 IRQ_TYPE_LEVEL_HIGH>;
332		interrupt-names = "host-wakeup";
333	};
334};
335
336&gpu {
337	status = "okay";
338};
339
340&mdss {
341	status = "okay";
342};
343
344&mdss_dsi0 {
345	status = "okay";
346
347	vdda-supply = <&pma8084_l2>;
348	vdd-supply = <&pma8084_l22>;
349	vddio-supply = <&pma8084_l12>;
350
351	panel: panel@0 {
352		reg = <0>;
353		compatible = "samsung,s6e3fa2";
354
355		pinctrl-names = "default";
356		pinctrl-0 = <&panel_te_pin &panel_rst_pin>;
357
358		iovdd-supply = <&pma8084_lvs4>;
359		vddr-supply = <&vreg_panel>;
360
361		reset-gpios = <&pma8084_gpios 17 GPIO_ACTIVE_LOW>;
362
363		port {
364			panel_in: endpoint {
365				remote-endpoint = <&mdss_dsi0_out>;
366			};
367		};
368	};
369};
370
371&mdss_dsi0_out {
372	remote-endpoint = <&panel_in>;
373	data-lanes = <0 1 2 3>;
374};
375
376&mdss_dsi0_phy {
377	status = "okay";
378
379	vddio-supply = <&pma8084_l12>;
380};
381
382&pma8084_gpios {
383	gpio_keys_pin_a: gpio-keys-active-state {
384		pins = "gpio2", "gpio3", "gpio5";
385		function = "normal";
386
387		bias-pull-up;
388		power-source = <PMA8084_GPIO_S4>;
389	};
390
391	touchkey_pin: touchkey-int-state {
392		pins = "gpio6";
393		function = "normal";
394		bias-disable;
395		input-enable;
396		power-source = <PMA8084_GPIO_S4>;
397	};
398
399	touch_pin: touchscreen-int-state {
400		pins = "gpio8";
401		function = "normal";
402		bias-disable;
403		input-enable;
404		power-source = <PMA8084_GPIO_S4>;
405	};
406
407	panel_en_pin: panel-en-state {
408		pins = "gpio14";
409		function = "normal";
410		bias-pull-up;
411		power-source = <PMA8084_GPIO_S4>;
412		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
413	};
414
415	wlan_sleep_clk_pin: wlan-sleep-clk-state {
416		pins = "gpio16";
417		function = "func2";
418
419		output-high;
420		power-source = <PMA8084_GPIO_S4>;
421		qcom,drive-strength = <PMIC_GPIO_STRENGTH_HIGH>;
422	};
423
424	panel_rst_pin: panel-rst-state {
425		pins = "gpio17";
426		function = "normal";
427		bias-disable;
428		power-source = <PMA8084_GPIO_S4>;
429		qcom,drive-strength = <PMIC_GPIO_STRENGTH_LOW>;
430	};
431
432	fuelgauge_pin: fuelgauge-int-state {
433		pins = "gpio21";
434		function = "normal";
435		bias-disable;
436		input-enable;
437		power-source = <PMA8084_GPIO_S4>;
438	};
439};
440
441&remoteproc_adsp {
442	status = "okay";
443	cx-supply = <&pma8084_s2>;
444};
445
446&remoteproc_mss {
447	status = "okay";
448	cx-supply = <&pma8084_s2>;
449	mss-supply = <&pma8084_s6>;
450	mx-supply = <&pma8084_s1>;
451	pll-supply = <&pma8084_l12>;
452};
453
454&rpm_requests {
455	regulators-0 {
456		compatible = "qcom,rpm-pma8084-regulators";
457
458		pma8084_s1: s1 {
459			regulator-min-microvolt = <675000>;
460			regulator-max-microvolt = <1050000>;
461			regulator-always-on;
462		};
463
464		pma8084_s2: s2 {
465			regulator-min-microvolt = <500000>;
466			regulator-max-microvolt = <1050000>;
467		};
468
469		pma8084_s3: s3 {
470			regulator-min-microvolt = <1300000>;
471			regulator-max-microvolt = <1300000>;
472		};
473
474		pma8084_s4: s4 {
475			regulator-min-microvolt = <1800000>;
476			regulator-max-microvolt = <1800000>;
477		};
478
479		pma8084_s5: s5 {
480			regulator-min-microvolt = <2150000>;
481			regulator-max-microvolt = <2150000>;
482		};
483
484		pma8084_s6: s6 {
485			regulator-min-microvolt = <1050000>;
486			regulator-max-microvolt = <1050000>;
487		};
488
489		pma8084_l1: l1 {
490			regulator-min-microvolt = <1225000>;
491			regulator-max-microvolt = <1225000>;
492		};
493
494		pma8084_l2: l2 {
495			regulator-min-microvolt = <1200000>;
496			regulator-max-microvolt = <1200000>;
497		};
498
499		pma8084_l3: l3 {
500			regulator-min-microvolt = <1050000>;
501			regulator-max-microvolt = <1200000>;
502		};
503
504		pma8084_l4: l4 {
505			regulator-min-microvolt = <1200000>;
506			regulator-max-microvolt = <1225000>;
507		};
508
509		pma8084_l5: l5 {
510			regulator-min-microvolt = <1800000>;
511			regulator-max-microvolt = <1800000>;
512		};
513
514		pma8084_l6: l6 {
515			regulator-min-microvolt = <1800000>;
516			regulator-max-microvolt = <1800000>;
517		};
518
519		pma8084_l7: l7 {
520			regulator-min-microvolt = <1800000>;
521			regulator-max-microvolt = <1800000>;
522		};
523
524		pma8084_l8: l8 {
525			regulator-min-microvolt = <1800000>;
526			regulator-max-microvolt = <1800000>;
527		};
528
529		pma8084_l9: l9 {
530			regulator-min-microvolt = <1800000>;
531			regulator-max-microvolt = <2950000>;
532		};
533
534		pma8084_l10: l10 {
535			regulator-min-microvolt = <1800000>;
536			regulator-max-microvolt = <2950000>;
537		};
538
539		pma8084_l11: l11 {
540			regulator-min-microvolt = <1300000>;
541			regulator-max-microvolt = <1300000>;
542		};
543
544		pma8084_l12: l12 {
545			regulator-min-microvolt = <1800000>;
546			regulator-max-microvolt = <1800000>;
547			regulator-always-on;
548		};
549
550		pma8084_l13: l13 {
551			regulator-min-microvolt = <1800000>;
552			regulator-max-microvolt = <2950000>;
553		};
554
555		pma8084_l14: l14 {
556			regulator-min-microvolt = <1800000>;
557			regulator-max-microvolt = <1800000>;
558		};
559
560		pma8084_l15: l15 {
561			regulator-min-microvolt = <2050000>;
562			regulator-max-microvolt = <2050000>;
563		};
564
565		pma8084_l16: l16 {
566			regulator-min-microvolt = <2700000>;
567			regulator-max-microvolt = <2700000>;
568		};
569
570		pma8084_l17: l17 {
571			regulator-min-microvolt = <2850000>;
572			regulator-max-microvolt = <2850000>;
573		};
574
575		pma8084_l18: l18 {
576			regulator-min-microvolt = <2850000>;
577			regulator-max-microvolt = <2850000>;
578		};
579
580		pma8084_l19: l19 {
581			regulator-min-microvolt = <3300000>;
582			regulator-max-microvolt = <3300000>;
583		};
584
585		pma8084_l20: l20 {
586			regulator-min-microvolt = <2950000>;
587			regulator-max-microvolt = <2950000>;
588			regulator-system-load = <200000>;
589			regulator-allow-set-load;
590		};
591
592		pma8084_l21: l21 {
593			regulator-min-microvolt = <2950000>;
594			regulator-max-microvolt = <2950000>;
595			regulator-system-load = <200000>;
596			regulator-allow-set-load;
597		};
598
599		pma8084_l22: l22 {
600			regulator-min-microvolt = <3000000>;
601			regulator-max-microvolt = <3300000>;
602		};
603
604		pma8084_l23: l23 {
605			regulator-min-microvolt = <3000000>;
606			regulator-max-microvolt = <3000000>;
607		};
608
609		pma8084_l24: l24 {
610			regulator-min-microvolt = <3075000>;
611			regulator-max-microvolt = <3075000>;
612		};
613
614		pma8084_l25: l25 {
615			regulator-min-microvolt = <2100000>;
616			regulator-max-microvolt = <2100000>;
617		};
618
619		pma8084_l26: l26 {
620			regulator-min-microvolt = <1800000>;
621			regulator-max-microvolt = <2050000>;
622		};
623
624		pma8084_l27: l27 {
625			regulator-min-microvolt = <1000000>;
626			regulator-max-microvolt = <1225000>;
627		};
628
629		pma8084_lvs1: lvs1 {};
630		pma8084_lvs2: lvs2 {};
631		pma8084_lvs3: lvs3 {};
632		pma8084_lvs4: lvs4 {};
633
634		pma8084_5vs1: 5vs1 {};
635	};
636};
637
638&sdhc_1 {
639	status = "okay";
640
641	vmmc-supply = <&pma8084_l20>;
642	vqmmc-supply = <&pma8084_s4>;
643
644	pinctrl-names = "default", "sleep";
645	pinctrl-0 = <&sdc1_on>;
646	pinctrl-1 = <&sdc1_off>;
647};
648
649&sdhc_2 {
650	status = "okay";
651	max-frequency = <100000000>;
652	vmmc-supply = <&vreg_wlan>;
653	vqmmc-supply = <&pma8084_s4>;
654	non-removable;
655
656	pinctrl-names = "default", "sleep";
657	pinctrl-0 = <&sdc2_on>;
658	pinctrl-1 = <&sdc2_off>;
659
660	wifi@1 {
661		reg = <1>;
662		compatible = "brcm,bcm4329-fmac";
663
664		/*
665		 * Allow all klte* variants to load the same NVRAM file,
666		 * as they have little difference in the WiFi part.
667		 */
668		brcm,board-type = "samsung,klte";
669
670		interrupt-parent = <&tlmm>;
671		interrupts = <92 IRQ_TYPE_LEVEL_HIGH>;
672		interrupt-names = "host-wake";
673
674		pinctrl-names = "default";
675		pinctrl-0 = <&wlan_sleep_clk_pin &wifi_pin>;
676	};
677};
678
679&sdhc_3 {
680	status = "okay";
681	max-frequency = <100000000>;
682	vmmc-supply = <&pma8084_l21>;
683	vqmmc-supply = <&pma8084_l13>;
684
685	/*
686	 * cd-gpio is intentionally disabled. If enabled, an SD card
687	 * present during boot is not initialized correctly. Without
688	 * cd-gpios the driver resorts to polling, so hotplug works.
689	 */
690	pinctrl-names = "default";
691	pinctrl-0 = <&sdc3_on /* &sdhc3_cd_pin */>;
692	/* cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>; */
693};
694
695&tlmm {
696	/* This seems suspicious, but somebody with this device should look into it. */
697	blsp2_uart2_pins_active: blsp2-uart2-pins-active-state {
698		pins = "gpio45", "gpio46", "gpio47", "gpio48";
699		function = "blsp_uart8";
700		drive-strength = <8>;
701		bias-disable;
702	};
703
704	blsp2_uart2_pins_sleep: blsp2-uart2-pins-sleep-state {
705		pins = "gpio45", "gpio46", "gpio47", "gpio48";
706		function = "gpio";
707		drive-strength = <2>;
708		bias-pull-down;
709	};
710
711	bt_pins: bt-pins-state {
712		hostwake-pins {
713			pins = "gpio75";
714			function = "gpio";
715			drive-strength = <16>;
716		};
717
718		devwake-pins {
719			pins = "gpio91";
720			function = "gpio";
721			drive-strength = <2>;
722		};
723	};
724
725	sdc1_on: sdhc1-on-state {
726		clk-pins {
727			pins = "sdc1_clk";
728			drive-strength = <4>;
729			bias-disable;
730		};
731
732		cmd-data-pins {
733			pins = "sdc1_cmd", "sdc1_data";
734			drive-strength = <4>;
735			bias-pull-up;
736		};
737	};
738
739	sdc3_on: sdc3-on-state {
740		pins = "gpio35", "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
741		function = "sdc3";
742		drive-strength = <8>;
743		bias-disable;
744	};
745
746	sdhc3_cd_pin: sdc3-cd-on-state {
747		pins = "gpio62";
748		function = "gpio";
749
750		drive-strength = <2>;
751		bias-disable;
752	};
753
754	sdc2_on: sdhc2-on-state {
755		clk-pins {
756			pins = "sdc2_clk";
757			drive-strength = <6>;
758			bias-disable;
759		};
760
761		cmd-data-pins {
762			pins = "sdc2_cmd", "sdc2_data";
763			drive-strength = <6>;
764			bias-pull-up;
765		};
766	};
767
768	i2c_touchkey_pins: i2c-touchkey-state {
769		pins = "gpio95", "gpio96";
770		function = "gpio";
771		bias-pull-up;
772	};
773
774	i2c_led_gpioex_pins: i2c-led-gpioex-state {
775		function = "gpio";
776		bias-pull-down;
777	};
778
779	gpioex_pin: gpioex-state {
780		pins = "gpio145";
781		function = "gpio";
782		bias-pull-up;
783		drive-strength = <2>;
784	};
785
786	wifi_pin: wifi-state {
787		pins = "gpio92";
788		function = "gpio";
789		bias-pull-down;
790	};
791
792	panel_te_pin: panel-state {
793		pins = "gpio12";
794		function = "mdp_vsync";
795		drive-strength = <2>;
796		bias-disable;
797	};
798};
799
800&usb {
801	status = "okay";
802
803	phys = <&usb_hs1_phy>;
804	phy-select = <&tcsr 0xb000 0>;
805
806	hnp-disable;
807	srp-disable;
808	adp-disable;
809};
810
811&usb_hs1_phy {
812	status = "okay";
813
814	v1p8-supply = <&pma8084_l6>;
815	v3p3-supply = <&pma8084_l24>;
816
817	qcom,init-seq = /bits/ 8 <0x1 0x64>;
818};
819