1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-msm8974.dtsi"
3#include "qcom-pm8841.dtsi"
4#include "qcom-pm8941.dtsi"
5#include <dt-bindings/input/input.h>
6#include <dt-bindings/leds/common.h>
7#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
8
9/ {
10	aliases {
11		serial0 = &blsp1_uart2;
12	};
13
14	chosen {
15		stdout-path = "serial0:115200n8";
16	};
17
18	gpio-keys {
19		compatible = "gpio-keys";
20
21		pinctrl-names = "default";
22		pinctrl-0 = <&gpio_keys_pin_a>;
23
24		key-volume-down {
25			label = "volume_down";
26			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
27			linux,input-type = <1>;
28			linux,code = <KEY_VOLUMEDOWN>;
29		};
30
31		key-camera-snapshot {
32			label = "camera_snapshot";
33			gpios = <&pm8941_gpios 3 GPIO_ACTIVE_LOW>;
34			linux,input-type = <1>;
35			linux,code = <KEY_CAMERA>;
36		};
37
38		key-camera-focus {
39			label = "camera_focus";
40			gpios = <&pm8941_gpios 4 GPIO_ACTIVE_LOW>;
41			linux,input-type = <1>;
42			linux,code = <KEY_CAMERA_FOCUS>;
43		};
44
45		key-volume-up {
46			label = "volume_up";
47			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
48			linux,input-type = <1>;
49			linux,code = <KEY_VOLUMEUP>;
50		};
51	};
52
53	reserved-memory {
54		#address-cells = <1>;
55		#size-cells = <1>;
56		ranges;
57
58		ramoops@3e8e0000 {
59			compatible = "ramoops";
60			reg = <0x3e8e0000 0x200000>;
61
62			console-size = <0x100000>;
63			record-size = <0x10000>;
64			ftrace-size = <0x10000>;
65			pmsg-size = <0x80000>;
66		};
67	};
68};
69
70&blsp1_i2c2 {
71	status = "okay";
72	clock-frequency = <355000>;
73
74	synaptics@2c {
75		compatible = "syna,rmi4-i2c";
76		reg = <0x2c>;
77
78		interrupts-extended = <&tlmm 61 IRQ_TYPE_EDGE_FALLING>;
79
80		#address-cells = <1>;
81		#size-cells = <0>;
82
83		vdd-supply = <&pm8941_l22>;
84		vio-supply = <&pm8941_lvs3>;
85
86		pinctrl-names = "default";
87		pinctrl-0 = <&ts_int_pin>;
88
89		syna,startup-delay-ms = <10>;
90
91		rmi4-f01@1 {
92			reg = <0x1>;
93			syna,nosleep-mode = <1>;
94		};
95
96		rmi4-f11@11 {
97			reg = <0x11>;
98			touchscreen-inverted-x;
99			syna,sensor-type = <1>;
100		};
101	};
102};
103
104&blsp1_i2c6 {
105	status = "okay";
106	clock-frequency = <355000>;
107
108	nfc@28 {
109		compatible = "nxp,pn544-i2c";
110		reg = <0x28>;
111
112		interrupt-parent = <&tlmm>;
113		interrupts = <59 IRQ_TYPE_EDGE_RISING>;
114
115		enable-gpios = <&pm8941_gpios 23 GPIO_ACTIVE_HIGH>;
116		firmware-gpios = <&tlmm 77 GPIO_ACTIVE_HIGH>;
117	};
118};
119
120&blsp1_uart2 {
121	status = "okay";
122};
123
124&blsp2_dma {
125	qcom,controlled-remotely;
126};
127
128&blsp2_i2c5 {
129	status = "okay";
130	clock-frequency = <355000>;
131
132	/* sii8334 MHL HDMI bridge */
133};
134
135&otg {
136	status = "okay";
137
138	phys = <&usb_hs1_phy>;
139	phy-select = <&tcsr 0xb000 0>;
140	extcon = <&smbb>, <&usb_id>;
141	vbus-supply = <&chg_otg>;
142
143	hnp-disable;
144	srp-disable;
145	adp-disable;
146
147	ulpi {
148		phy@a {
149			status = "okay";
150
151			v1p8-supply = <&pm8941_l6>;
152			v3p3-supply = <&pm8941_l24>;
153
154			extcon = <&smbb>;
155			qcom,init-seq = /bits/ 8 <0x1 0x64>;
156		};
157	};
158};
159
160&pm8941_coincell {
161	status = "okay";
162	qcom,rset-ohms = <2100>;
163	qcom,vset-millivolts = <3000>;
164};
165
166&pm8941_gpios {
167	gpio_keys_pin_a: gpio-keys-active-state {
168		pins = "gpio2", "gpio3", "gpio4", "gpio5";
169		function = "normal";
170
171		bias-pull-up;
172		power-source = <PM8941_GPIO_S3>;
173	};
174};
175
176&pm8941_lpg {
177	status = "okay";
178
179	qcom,power-source = <1>;
180
181	rgb-led {
182		color = <LED_COLOR_ID_RGB>;
183		function = LED_FUNCTION_STATUS;
184
185		#address-cells = <1>;
186		#size-cells = <0>;
187
188		led@5 {
189			reg = <5>;
190			color = <LED_COLOR_ID_BLUE>;
191		};
192
193		led@6 {
194			reg = <6>;
195			color = <LED_COLOR_ID_GREEN>;
196		};
197
198		led@7 {
199			reg = <7>;
200			color = <LED_COLOR_ID_RED>;
201		};
202	};
203};
204
205&pm8941_wled {
206	status = "okay";
207
208	qcom,cs-out;
209	qcom,current-limit = <20>;
210	qcom,current-boost-limit = <805>;
211	qcom,switching-freq = <1600>;
212	qcom,ovp = <29>;
213	qcom,num-strings = <2>;
214};
215
216&rpm_requests {
217	pm8841-regulators {
218		compatible = "qcom,rpm-pm8841-regulators";
219
220		pm8841_s1: s1 {
221			regulator-min-microvolt = <675000>;
222			regulator-max-microvolt = <1050000>;
223		};
224
225		pm8841_s2: s2 {
226			regulator-min-microvolt = <500000>;
227			regulator-max-microvolt = <1050000>;
228		};
229
230		pm8841_s3: s3 {
231			regulator-min-microvolt = <500000>;
232			regulator-max-microvolt = <1050000>;
233		};
234
235		pm8841_s4: s4 {
236			regulator-min-microvolt = <500000>;
237			regulator-max-microvolt = <1050000>;
238		};
239	};
240
241	pm8941-regulators {
242		compatible = "qcom,rpm-pm8941-regulators";
243
244		vdd_l1_l3-supply = <&pm8941_s1>;
245		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
246		vdd_l4_l11-supply = <&pm8941_s1>;
247		vdd_l5_l7-supply = <&pm8941_s2>;
248		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
249		vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
250		vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
251		vdd_l21-supply = <&vreg_boost>;
252
253		pm8941_s1: s1 {
254			regulator-min-microvolt = <1300000>;
255			regulator-max-microvolt = <1300000>;
256			regulator-always-on;
257			regulator-boot-on;
258		};
259
260		pm8941_s2: s2 {
261			regulator-min-microvolt = <2150000>;
262			regulator-max-microvolt = <2150000>;
263			regulator-boot-on;
264		};
265
266		pm8941_s3: s3 {
267			regulator-min-microvolt = <1800000>;
268			regulator-max-microvolt = <1800000>;
269			regulator-always-on;
270			regulator-boot-on;
271		};
272
273		pm8941_s4: s4 {
274			regulator-min-microvolt = <5000000>;
275			regulator-max-microvolt = <5000000>;
276		};
277
278		pm8941_l1: l1 {
279			regulator-min-microvolt = <1225000>;
280			regulator-max-microvolt = <1225000>;
281			regulator-always-on;
282			regulator-boot-on;
283		};
284
285		pm8941_l2: l2 {
286			regulator-min-microvolt = <1200000>;
287			regulator-max-microvolt = <1200000>;
288		};
289
290		pm8941_l3: l3 {
291			regulator-min-microvolt = <1200000>;
292			regulator-max-microvolt = <1200000>;
293		};
294
295		pm8941_l4: l4 {
296			regulator-min-microvolt = <1225000>;
297			regulator-max-microvolt = <1225000>;
298		};
299
300		pm8941_l5: l5 {
301			regulator-min-microvolt = <1800000>;
302			regulator-max-microvolt = <1800000>;
303		};
304
305		pm8941_l6: l6 {
306			regulator-min-microvolt = <1800000>;
307			regulator-max-microvolt = <1800000>;
308			regulator-boot-on;
309		};
310
311		pm8941_l7: l7 {
312			regulator-min-microvolt = <1800000>;
313			regulator-max-microvolt = <1800000>;
314			regulator-boot-on;
315		};
316
317		pm8941_l8: l8 {
318			regulator-min-microvolt = <1800000>;
319			regulator-max-microvolt = <1800000>;
320		};
321
322		pm8941_l9: l9 {
323			regulator-min-microvolt = <1800000>;
324			regulator-max-microvolt = <2950000>;
325		};
326
327		pm8941_l11: l11 {
328			regulator-min-microvolt = <1300000>;
329			regulator-max-microvolt = <1350000>;
330		};
331
332		pm8941_l12: l12 {
333			regulator-min-microvolt = <1800000>;
334			regulator-max-microvolt = <1800000>;
335			regulator-always-on;
336			regulator-boot-on;
337		};
338
339		pm8941_l13: l13 {
340			regulator-min-microvolt = <1800000>;
341			regulator-max-microvolt = <2950000>;
342			regulator-boot-on;
343		};
344
345		pm8941_l14: l14 {
346			regulator-min-microvolt = <1800000>;
347			regulator-max-microvolt = <1800000>;
348		};
349
350		pm8941_l15: l15 {
351			regulator-min-microvolt = <2050000>;
352			regulator-max-microvolt = <2050000>;
353		};
354
355		pm8941_l16: l16 {
356			regulator-min-microvolt = <2700000>;
357			regulator-max-microvolt = <2700000>;
358		};
359
360		pm8941_l17: l17 {
361			regulator-min-microvolt = <2700000>;
362			regulator-max-microvolt = <2700000>;
363		};
364
365		pm8941_l18: l18 {
366			regulator-min-microvolt = <2850000>;
367			regulator-max-microvolt = <2850000>;
368		};
369
370		pm8941_l19: l19 {
371			regulator-min-microvolt = <3300000>;
372			regulator-max-microvolt = <3300000>;
373		};
374
375		pm8941_l20: l20 {
376			regulator-min-microvolt = <2950000>;
377			regulator-max-microvolt = <2950000>;
378			regulator-system-load = <200000>;
379			regulator-allow-set-load;
380			regulator-boot-on;
381		};
382
383		pm8941_l21: l21 {
384			regulator-min-microvolt = <2950000>;
385			regulator-max-microvolt = <2950000>;
386			regulator-boot-on;
387		};
388
389		pm8941_l22: l22 {
390			regulator-min-microvolt = <3000000>;
391			regulator-max-microvolt = <3000000>;
392		};
393
394		pm8941_l23: l23 {
395			regulator-min-microvolt = <2800000>;
396			regulator-max-microvolt = <2800000>;
397		};
398
399		pm8941_l24: l24 {
400			regulator-min-microvolt = <3075000>;
401			regulator-max-microvolt = <3075000>;
402			regulator-boot-on;
403		};
404
405		pm8941_lvs3: lvs3 {};
406	};
407};
408
409&sdhc_1 {
410	status = "okay";
411
412	vmmc-supply = <&pm8941_l20>;
413	vqmmc-supply = <&pm8941_s3>;
414
415	pinctrl-names = "default", "sleep";
416	pinctrl-0 = <&sdc1_on>;
417	pinctrl-1 = <&sdc1_off>;
418};
419
420&sdhc_2 {
421	status = "okay";
422
423	vmmc-supply = <&pm8941_l21>;
424	vqmmc-supply = <&pm8941_l13>;
425
426	cd-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
427
428	pinctrl-names = "default", "sleep";
429	pinctrl-0 = <&sdc2_on>;
430	pinctrl-1 = <&sdc2_off>;
431};
432
433&smbb {
434	qcom,fast-charge-safe-current = <1500000>;
435	qcom,fast-charge-current-limit = <1500000>;
436	qcom,dc-current-limit = <1800000>;
437	qcom,fast-charge-safe-voltage = <4400000>;
438	qcom,fast-charge-high-threshold-voltage = <4350000>;
439	qcom,fast-charge-low-threshold-voltage = <3400000>;
440	qcom,auto-recharge-threshold-voltage = <4200000>;
441	qcom,minimum-input-voltage = <4300000>;
442};
443
444&tlmm {
445	ts_int_pin: touch-int {
446		pins = "gpio61";
447		function = "gpio";
448		drive-strength = <2>;
449		bias-disable;
450		input-enable;
451	};
452
453	sdc1_on: sdc1-on {
454		clk {
455			pins = "sdc1_clk";
456			drive-strength = <16>;
457			bias-disable;
458		};
459
460		cmd-data {
461			pins = "sdc1_cmd", "sdc1_data";
462			drive-strength = <10>;
463			bias-pull-up;
464		};
465	};
466
467	sdc2_on: sdc-on {
468		clk {
469			pins = "sdc2_clk";
470			drive-strength = <10>;
471			bias-disable;
472		};
473
474		cmd-data {
475			pins = "sdc2_cmd", "sdc2_data";
476			drive-strength = <6>;
477			bias-pull-up;
478		};
479
480		cd {
481			pins = "gpio62";
482			function = "gpio";
483			drive-strength = <2>;
484			bias-disable;
485		};
486	};
487};
488