1// SPDX-License-Identifier: GPL-2.0
2#include "qcom-msm8974pro.dtsi"
3#include "pm8841.dtsi"
4#include "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	model = "Fairphone 2";
11	compatible = "fairphone,fp2", "qcom,msm8974pro", "qcom,msm8974";
12	chassis-type = "handset";
13
14	aliases {
15		mmc0 = &sdhc_1;
16		mmc1 = &sdhc_2;
17		serial0 = &blsp1_uart2;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	gpio-keys {
25		compatible = "gpio-keys";
26
27		pinctrl-names = "default";
28		pinctrl-0 = <&gpio_keys_pin_a>;
29
30		key-camera-snapshot {
31			label = "camera_snapshot";
32			gpios = <&pm8941_gpios 1 GPIO_ACTIVE_LOW>;
33			linux,code = <KEY_CAMERA>;
34			wakeup-source;
35			debounce-interval = <15>;
36		};
37
38		key-volume-down {
39			label = "volume_down";
40			gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
41			linux,code = <KEY_VOLUMEDOWN>;
42			wakeup-source;
43			debounce-interval = <15>;
44		};
45
46		key-volume-up {
47			label = "volume_up";
48			gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
49			linux,code = <KEY_VOLUMEUP>;
50			wakeup-source;
51			debounce-interval = <15>;
52		};
53	};
54
55	vibrator {
56		compatible = "gpio-vibrator";
57		enable-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>;
58		vcc-supply = <&pm8941_l18>;
59	};
60};
61
62&blsp1_i2c2 {
63	status = "okay";
64
65	touchscreen@41 {
66		compatible = "ilitek,ili2120";
67		reg = <0x41>;
68		interrupt-parent = <&tlmm>;
69		interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
70		reset-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
71
72		touchscreen-size-x = <1080>;
73		touchscreen-size-y = <1920>;
74	};
75};
76
77&blsp1_uart2 {
78	status = "okay";
79};
80
81&imem {
82	reboot-mode {
83		mode-normal = <0x77665501>;
84		mode-bootloader = <0x77665500>;
85		mode-recovery = <0x77665502>;
86	};
87};
88
89&pm8941_gpios {
90	gpio_keys_pin_a: gpio-keys-active-state {
91		pins = "gpio1", "gpio2", "gpio5";
92		function = "normal";
93
94		bias-pull-up;
95		power-source = <PM8941_GPIO_S3>;
96	};
97};
98
99&pm8941_lpg {
100	status = "okay";
101
102	qcom,power-source = <1>;
103
104	multi-led {
105		color = <LED_COLOR_ID_RGB>;
106		function = LED_FUNCTION_STATUS;
107
108		#address-cells = <1>;
109		#size-cells = <0>;
110
111		led@7 {
112			reg = <7>;
113			color = <LED_COLOR_ID_RED>;
114		};
115
116		led@6 {
117			reg = <6>;
118			color = <LED_COLOR_ID_GREEN>;
119		};
120
121		led@5 {
122			reg = <5>;
123			color = <LED_COLOR_ID_BLUE>;
124		};
125	};
126};
127
128&pronto {
129	status = "okay";
130
131	vddmx-supply = <&pm8841_s1>;
132	vddcx-supply = <&pm8841_s2>;
133	vddpx-supply = <&pm8941_s3>;
134
135	pinctrl-names = "default";
136	pinctrl-0 = <&wcnss_pin_a>;
137
138	iris {
139		vddxo-supply = <&pm8941_l6>;
140		vddrfa-supply = <&pm8941_l11>;
141		vddpa-supply = <&pm8941_l19>;
142		vdddig-supply = <&pm8941_s3>;
143	};
144
145	smd-edge {
146		qcom,remote-pid = <4>;
147		label = "pronto";
148
149		wcnss {
150			status = "okay";
151		};
152	};
153};
154
155&remoteproc_adsp {
156	status = "okay";
157	cx-supply = <&pm8841_s2>;
158};
159
160&remoteproc_mss {
161	status = "okay";
162	cx-supply = <&pm8841_s2>;
163	mss-supply = <&pm8841_s3>;
164	mx-supply = <&pm8841_s1>;
165	pll-supply = <&pm8941_l12>;
166};
167
168&rpm_requests {
169	regulators-0 {
170		compatible = "qcom,rpm-pm8841-regulators";
171
172		pm8841_s1: s1 {
173			regulator-min-microvolt = <675000>;
174			regulator-max-microvolt = <1050000>;
175		};
176
177		pm8841_s2: s2 {
178			regulator-min-microvolt = <500000>;
179			regulator-max-microvolt = <1050000>;
180		};
181
182		pm8841_s3: s3 {
183			regulator-min-microvolt = <1050000>;
184			regulator-max-microvolt = <1050000>;
185		};
186	};
187
188	regulators-1 {
189		compatible = "qcom,rpm-pm8941-regulators";
190
191		vdd_l1_l3-supply = <&pm8941_s1>;
192		vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
193		vdd_l4_l11-supply = <&pm8941_s1>;
194		vdd_l5_l7-supply = <&pm8941_s2>;
195		vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
196		vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
197		vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
198		vdd_l21-supply = <&vreg_boost>;
199
200		pm8941_s1: s1 {
201			regulator-min-microvolt = <1300000>;
202			regulator-max-microvolt = <1300000>;
203			regulator-always-on;
204			regulator-boot-on;
205		};
206
207		pm8941_s2: s2 {
208			regulator-min-microvolt = <2150000>;
209			regulator-max-microvolt = <2150000>;
210			regulator-boot-on;
211		};
212
213		pm8941_s3: s3 {
214			regulator-min-microvolt = <1800000>;
215			regulator-max-microvolt = <1800000>;
216			regulator-always-on;
217			regulator-boot-on;
218		};
219
220		pm8941_l1: l1 {
221			regulator-min-microvolt = <1225000>;
222			regulator-max-microvolt = <1225000>;
223			regulator-always-on;
224			regulator-boot-on;
225		};
226
227		pm8941_l2: l2 {
228			regulator-min-microvolt = <1200000>;
229			regulator-max-microvolt = <1200000>;
230		};
231
232		pm8941_l3: l3 {
233			regulator-min-microvolt = <1225000>;
234			regulator-max-microvolt = <1225000>;
235		};
236
237		pm8941_l4: l4 {
238			regulator-min-microvolt = <1225000>;
239			regulator-max-microvolt = <1225000>;
240		};
241
242		pm8941_l5: l5 {
243			regulator-min-microvolt = <1800000>;
244			regulator-max-microvolt = <1800000>;
245		};
246
247		pm8941_l6: l6 {
248			regulator-min-microvolt = <1800000>;
249			regulator-max-microvolt = <1800000>;
250			regulator-boot-on;
251		};
252
253		pm8941_l7: l7 {
254			regulator-min-microvolt = <1800000>;
255			regulator-max-microvolt = <1800000>;
256			regulator-boot-on;
257		};
258
259		pm8941_l8: l8 {
260			regulator-min-microvolt = <1800000>;
261			regulator-max-microvolt = <1800000>;
262		};
263
264		pm8941_l9: l9 {
265			regulator-min-microvolt = <1800000>;
266			regulator-max-microvolt = <2950000>;
267		};
268
269		pm8941_l10: l10 {
270			regulator-min-microvolt = <1800000>;
271			regulator-max-microvolt = <2950000>;
272		};
273
274		pm8941_l11: l11 {
275			regulator-min-microvolt = <1225000>;
276			regulator-max-microvolt = <1350000>;
277		};
278
279		pm8941_l12: l12 {
280			regulator-min-microvolt = <1800000>;
281			regulator-max-microvolt = <1800000>;
282			regulator-always-on;
283			regulator-boot-on;
284		};
285
286		pm8941_l13: l13 {
287			regulator-min-microvolt = <1800000>;
288			regulator-max-microvolt = <2950000>;
289			regulator-boot-on;
290		};
291
292		pm8941_l14: l14 {
293			regulator-min-microvolt = <1800000>;
294			regulator-max-microvolt = <1800000>;
295		};
296
297		pm8941_l15: l15 {
298			regulator-min-microvolt = <2050000>;
299			regulator-max-microvolt = <2050000>;
300		};
301
302		pm8941_l16: l16 {
303			regulator-min-microvolt = <2700000>;
304			regulator-max-microvolt = <2700000>;
305		};
306
307		pm8941_l17: l17 {
308			regulator-min-microvolt = <2850000>;
309			regulator-max-microvolt = <2850000>;
310		};
311
312		pm8941_l18: l18 {
313			regulator-min-microvolt = <2850000>;
314			regulator-max-microvolt = <2850000>;
315		};
316
317		pm8941_l19: l19 {
318			regulator-min-microvolt = <2900000>;
319			regulator-max-microvolt = <3350000>;
320		};
321
322		pm8941_l20: l20 {
323			regulator-min-microvolt = <2950000>;
324			regulator-max-microvolt = <2950000>;
325			regulator-system-load = <200000>;
326			regulator-allow-set-load;
327			regulator-boot-on;
328		};
329
330		pm8941_l21: l21 {
331			regulator-min-microvolt = <2950000>;
332			regulator-max-microvolt = <2950000>;
333			regulator-boot-on;
334		};
335
336		pm8941_l22: l22 {
337			regulator-min-microvolt = <3000000>;
338			regulator-max-microvolt = <3300000>;
339		};
340
341		pm8941_l23: l23 {
342			regulator-min-microvolt = <3000000>;
343			regulator-max-microvolt = <3000000>;
344		};
345
346		pm8941_l24: l24 {
347			regulator-min-microvolt = <3075000>;
348			regulator-max-microvolt = <3075000>;
349			regulator-boot-on;
350		};
351	};
352};
353
354&sdhc_1 {
355	status = "okay";
356
357	vmmc-supply = <&pm8941_l20>;
358	vqmmc-supply = <&pm8941_s3>;
359
360	pinctrl-names = "default", "sleep";
361	pinctrl-0 = <&sdc1_on>;
362	pinctrl-1 = <&sdc1_off>;
363};
364
365&sdhc_2 {
366	status = "okay";
367
368	vmmc-supply = <&pm8941_l21>;
369	vqmmc-supply = <&pm8941_l13>;
370
371	pinctrl-names = "default", "sleep";
372	pinctrl-0 = <&sdc2_on>;
373	pinctrl-1 = <&sdc2_off>;
374};
375
376&smbb {
377	usb-charge-current-limit = <1500000>;
378	qcom,fast-charge-safe-current = <1500000>;
379	qcom,fast-charge-current-limit = <1500000>;
380	qcom,fast-charge-safe-voltage = <4380000>;
381	qcom,fast-charge-high-threshold-voltage = <4350000>;
382	qcom,auto-recharge-threshold-voltage = <4240000>;
383	qcom,minimum-input-voltage = <4450000>;
384};
385
386&tlmm {
387	sdc1_on: sdc1-on-state {
388		clk-pins {
389			pins = "sdc1_clk";
390			drive-strength = <16>;
391			bias-disable;
392		};
393
394		cmd-data-pins {
395			pins = "sdc1_cmd", "sdc1_data";
396			drive-strength = <10>;
397			bias-pull-up;
398		};
399	};
400
401	sdc2_on: sdc2-on-state {
402		clk-pins {
403			pins = "sdc2_clk";
404			drive-strength = <10>;
405			bias-disable;
406		};
407
408		cmd-data-pins {
409			pins = "sdc2_cmd", "sdc2_data";
410			drive-strength = <6>;
411			bias-pull-up;
412		};
413	};
414
415	wcnss_pin_a: wcnss-pin-active-state {
416		wlan-pins {
417			pins = "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
418			function = "wlan";
419
420			drive-strength = <6>;
421			bias-pull-down;
422		};
423
424		bt-pins {
425			pins = "gpio35", "gpio43", "gpio44";
426			function = "bt";
427
428			drive-strength = <2>;
429			bias-pull-down;
430		};
431
432		fm-pins {
433			pins = "gpio41", "gpio42";
434			function = "fm";
435
436			drive-strength = <2>;
437			bias-pull-down;
438		};
439	};
440};
441
442&usb {
443	status = "okay";
444
445	phys = <&usb_hs1_phy>;
446	phy-select = <&tcsr 0xb000 0>;
447	extcon = <&smbb>, <&usb_id>;
448	vbus-supply = <&chg_otg>;
449
450	hnp-disable;
451	srp-disable;
452	adp-disable;
453};
454
455&usb_hs1_phy {
456	status = "okay";
457
458	v1p8-supply = <&pm8941_l6>;
459	v3p3-supply = <&pm8941_l24>;
460
461	extcon = <&smbb>;
462	qcom,init-seq = /bits/ 8 <0x1 0x64>;
463};
464