1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, Martin Botka <martin.botka@somainline.org>
4 */
5
6/dts-v1/;
7
8#include "sm6125.dtsi"
9#include "pm6125.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/gpio-keys.h>
12#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
13
14/ {
15	/* required for bootloader to select correct board */
16	qcom,msm-id = <394 0x10000>; /* sm6125 v1 */
17	qcom,board-id = <34 0>;
18
19	model = "Sony Xperia 10 II";
20	compatible = "sony,pdx201", "qcom,sm6125";
21	chassis-type = "handset";
22
23	aliases {
24		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
25		mmc1 = &sdhc_2; /* SDC2 SD card slot */
26	};
27
28	chosen {
29		#address-cells = <2>;
30		#size-cells = <2>;
31		ranges;
32
33		framebuffer0: framebuffer@5c000000 {
34			compatible = "simple-framebuffer";
35			reg = <0 0x5c000000 0 (2520 * 1080 * 4)>;
36			width = <1080>;
37			height = <2520>;
38			stride = <(1080 * 4)>;
39			format = "a8r8g8b8";
40		};
41	};
42
43	extcon_usb: extcon-usb {
44		compatible = "linux,extcon-usb-gpio";
45		id-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
46	};
47
48	gpio-keys {
49		compatible = "gpio-keys";
50
51		pinctrl-0 = <&vol_down_n>;
52		pinctrl-names = "default";
53
54		key-volume-down {
55			label = "Volume Down";
56			gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
57			linux,code = <KEY_VOLUMEDOWN>;
58			debounce-interval = <15>;
59			linux,can-disable;
60			wakeup-source;
61		};
62	};
63
64	reserved-memory {
65		#address-cells = <2>;
66		#size-cells = <2>;
67		debug_mem: memory@ffb00000 {
68			reg = <0x0 0xffb00000 0x0 0xc0000>;
69			no-map;
70		};
71
72		last_log_mem: memory@ffbc0000 {
73			reg = <0x0 0xffbc0000 0x0 0x80000>;
74			no-map;
75		};
76
77		pstore_mem: ramoops@ffc00000 {
78			compatible = "ramoops";
79			reg = <0x0 0xffc40000 0x0 0xc0000>;
80			record-size = <0x1000>;
81			console-size = <0x40000>;
82			pmsg-size = <0x20000>;
83		};
84
85		cmdline_mem: memory@ffd00000 {
86			reg = <0x0 0xffd40000 0x0 0x1000>;
87			no-map;
88		};
89	};
90
91	thermal-zones {
92		rf-pa0-thermal {
93			polling-delay-passive = <0>;
94			polling-delay = <0>;
95			thermal-sensors = <&pm6125_adc_tm 0>;
96
97			trips {
98				active-config0 {
99					temperature = <125000>;
100					hysteresis = <1000>;
101					type = "critical";
102				};
103			};
104		};
105
106		quiet-thermal {
107			polling-delay-passive = <0>;
108			polling-delay = <5000>;
109			thermal-sensors = <&pm6125_adc_tm 1>;
110
111			trips {
112				active-config0 {
113					temperature = <125000>;
114					hysteresis = <1000>;
115					type = "critical";
116				};
117			};
118		};
119
120		xo-thermal {
121			polling-delay-passive = <0>;
122			polling-delay = <0>;
123			thermal-sensors = <&pm6125_adc_tm 2>;
124
125			trips {
126				active-config0 {
127					temperature = <125000>;
128					hysteresis = <1000>;
129					type = "critical";
130				};
131			};
132		};
133
134		rf-pa1-thermal {
135			polling-delay-passive = <0>;
136			polling-delay = <0>;
137			thermal-sensors = <&pm6125_adc_tm 3>;
138
139			trips {
140				active-config0 {
141					temperature = <125000>;
142					hysteresis = <1000>;
143					type = "critical";
144				};
145			};
146		};
147	};
148};
149
150&gpi_dma0 {
151	status = "okay";
152};
153
154&hsusb_phy1 {
155	vdd-supply = <&pm6125_l7>;
156	vdda-pll-supply = <&pm6125_l10>;
157	vdda-phy-dpdm-supply = <&pm6125_l15>;
158	status = "okay";
159};
160
161&i2c1 {
162	clock-frequency = <400000>;
163	status = "okay";
164
165	/* NXP PN553 NFC @ 28 */
166};
167
168&i2c2 {
169	clock-frequency = <400000>;
170	status = "okay";
171
172	/* Samsung touchscreen @ 48 */
173};
174
175&i2c3 {
176	clock-frequency = <1000000>;
177	status = "okay";
178
179	/* Cirrus Logic CS35L41 boosted audio amplifier @ 40 */
180};
181
182&pm6125_adc {
183	pinctrl-names = "default";
184	pinctrl-0 = <&camera_flash_therm &emmc_ufs_therm &rf_pa1_therm>;
185
186	channel@4d {
187		reg = <ADC5_AMUX_THM1_100K_PU>;
188		qcom,ratiometric;
189		qcom,hw-settle-time = <200>;
190		qcom,pre-scaling = <1 1>;
191		label = "rf_pa0_therm";
192	};
193
194	channel@4e {
195		reg = <ADC5_AMUX_THM2_100K_PU>;
196		qcom,ratiometric;
197		qcom,hw-settle-time = <200>;
198		qcom,pre-scaling = <1 1>;
199		label = "quiet_therm";
200	};
201
202	channel@52 {
203		reg = <ADC5_GPIO1_100K_PU>;
204		qcom,ratiometric;
205		qcom,hw-settle-time = <200>;
206		qcom,pre-scaling = <1 1>;
207		label = "camera_flash_therm";
208	};
209
210	channel@54 {
211		reg = <ADC5_GPIO3_100K_PU>;
212		qcom,ratiometric;
213		qcom,hw-settle-time = <200>;
214		qcom,pre-scaling = <1 1>;
215		label = "emmc_ufs_therm";
216	};
217
218	channel@55 {
219		reg = <ADC5_GPIO4_100K_PU>;
220		qcom,ratiometric;
221		qcom,hw-settle-time = <200>;
222		qcom,pre-scaling = <1 1>;
223		label = "rf_pa1_therm";
224	};
225};
226
227&pm6125_adc_tm {
228	status = "okay";
229
230	rf-pa0-therm@0 {
231		reg = <0>;
232		io-channels = <&pm6125_adc ADC5_AMUX_THM1_100K_PU>;
233		qcom,ratiometric;
234		qcom,hw-settle-time-us = <200>;
235	};
236
237	quiet-therm@1 {
238		reg = <1>;
239		io-channels = <&pm6125_adc ADC5_AMUX_THM2_100K_PU>;
240		qcom,ratiometric;
241		qcom,hw-settle-time-us = <200>;
242	};
243
244	xo-therm@2 {
245		reg = <2>;
246		io-channels = <&pm6125_adc ADC5_XO_THERM_100K_PU>;
247		qcom,ratiometric;
248		qcom,hw-settle-time-us = <200>;
249	};
250
251	rf-pa1-therm@3 {
252		reg = <3>;
253		io-channels = <&pm6125_adc ADC5_GPIO4_100K_PU>;
254		qcom,ratiometric;
255		qcom,hw-settle-time-us = <200>;
256	};
257};
258
259&pm6125_gpios {
260	camera_flash_therm: camera-flash-therm-state {
261		pins = "gpio3";
262		function = PMIC_GPIO_FUNC_NORMAL;
263		bias-high-impedance;
264	};
265
266	emmc_ufs_therm: emmc-ufs-therm-state {
267		pins = "gpio6";
268		function = PMIC_GPIO_FUNC_NORMAL;
269		bias-high-impedance;
270	};
271
272	rf_pa1_therm: rf-pa1-therm-state {
273		pins = "gpio7";
274		function = PMIC_GPIO_FUNC_NORMAL;
275		bias-high-impedance;
276	};
277};
278
279&pon_pwrkey {
280	status = "okay";
281};
282
283&pon_resin {
284	status = "okay";
285	linux,code = <KEY_VOLUMEUP>;
286};
287
288&rpm_requests {
289	regulators-0 {
290		compatible = "qcom,rpm-pm6125-regulators";
291
292		vdd_l2_l3_l4-supply = <&pm6125_l7>;
293		vdd_l5_l15_l19_l20_l21_l22-supply = <&pm6125_l10>;
294
295		/*
296		 * S3/S4 is VDD_CX
297		 * S5 is VDD_MX/WCSS_MX
298		 */
299
300		pm6125_s6: s6 {
301			regulator-min-microvolt = <936000>;
302			regulator-max-microvolt = <1422000>;
303		};
304
305		pm6125_l1: l1 {
306			regulator-min-microvolt = <1200000>;
307			regulator-max-microvolt = <1256000>;
308		};
309
310		pm6125_l2: l2 {
311			regulator-min-microvolt = <1000000>;
312			regulator-max-microvolt = <1056000>;
313		};
314
315		pm6125_l3: l3 {
316			regulator-min-microvolt = <1000000>;
317			regulator-max-microvolt = <1064000>;
318		};
319
320		pm6125_l4: l4 {
321			regulator-min-microvolt = <872000>;
322			regulator-max-microvolt = <976000>;
323		};
324
325		pm6125_l5: l5 {
326			regulator-min-microvolt = <1648000>;
327			regulator-max-microvolt = <2950000>;
328			regulator-allow-set-load;
329		};
330
331		pm6125_l6: l6 {
332			regulator-min-microvolt = <576000>;
333			regulator-max-microvolt = <656000>;
334		};
335
336		pm6125_l7: l7 {
337			regulator-min-microvolt = <872000>;
338			regulator-max-microvolt = <976000>;
339		};
340
341		pm6125_l8: l8 {
342			regulator-min-microvolt = <400000>;
343			regulator-max-microvolt = <728000>;
344		};
345
346		pm6125_l9: l9 {
347			regulator-min-microvolt = <1800000>;
348			regulator-max-microvolt = <1896000>;
349		};
350
351		pm6125_l10: l10 {
352			regulator-min-microvolt = <1800000>;
353			regulator-max-microvolt = <1896000>;
354		};
355
356		pm6125_l11: l11 {
357			regulator-min-microvolt = <1800000>;
358			regulator-max-microvolt = <1800000>;
359			regulator-allow-set-load;
360		};
361
362		pm6125_l12: l12 {
363			regulator-min-microvolt = <1800000>;
364			regulator-max-microvolt = <1996000>;
365		};
366
367		pm6125_l13: l13 {
368			regulator-min-microvolt = <1800000>;
369			regulator-max-microvolt = <1832000>;
370		};
371
372		pm6125_l14: l14 {
373			regulator-min-microvolt = <1800000>;
374			regulator-max-microvolt = <1904000>;
375		};
376
377		pm6125_l15: l15 {
378			regulator-min-microvolt = <3104000>;
379			regulator-max-microvolt = <3232000>;
380		};
381
382		pm6125_l16: l16 {
383			regulator-min-microvolt = <1800000>;
384			regulator-max-microvolt = <1904000>;
385		};
386
387		pm6125_l17: l17 {
388			regulator-min-microvolt = <1248000>;
389			regulator-max-microvolt = <1304000>;
390		};
391
392		pm6125_l18: l18 {
393			regulator-min-microvolt = <1200000>;
394			regulator-max-microvolt = <1264000>;
395		};
396
397		pm6125_l19: l19 {
398			regulator-min-microvolt = <1648000>;
399			regulator-max-microvolt = <2952000>;
400		};
401
402		pm6125_l20: l20 {
403			regulator-min-microvolt = <1648000>;
404			regulator-max-microvolt = <2952000>;
405		};
406
407		pm6125_l21: l21 {
408			regulator-min-microvolt = <2600000>;
409			regulator-max-microvolt = <2856000>;
410		};
411
412		pm6125_l22: l22 {
413			regulator-min-microvolt = <2944000>;
414			regulator-max-microvolt = <2950000>;
415			regulator-allow-set-load;
416		};
417
418		pm6125_l23: l23 {
419			regulator-min-microvolt = <3000000>;
420			regulator-max-microvolt = <3400000>;
421		};
422
423		pm6125_l24: l24 {
424			regulator-min-microvolt = <2944000>;
425			regulator-max-microvolt = <2950000>;
426			regulator-allow-set-load;
427		};
428	};
429};
430
431&qupv3_id_0 {
432	status = "okay";
433};
434
435&sdc2_off_state {
436	sd-cd-pins {
437		pins = "gpio98";
438		function = "gpio";
439		drive-strength = <2>;
440		bias-disable;
441	};
442};
443
444&sdc2_on_state {
445	sd-cd-pins {
446		pins = "gpio98";
447		function = "gpio";
448		drive-strength = <2>;
449		bias-pull-up;
450	};
451};
452
453&sdhc_1 {
454	vmmc-supply = <&pm6125_l24>;
455	vqmmc-supply = <&pm6125_l11>;
456	status = "okay";
457};
458
459&sdhc_2 {
460	cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
461	vmmc-supply = <&pm6125_l22>;
462	vqmmc-supply = <&pm6125_l5>;
463	no-sdio;
464	no-mmc;
465	status = "okay";
466};
467
468&tlmm {
469	gpio-reserved-ranges = <22 2>, <28 6>;
470
471	vol_down_n: vol-down-n-state {
472		pins = "gpio47";
473		function = "gpio";
474		drive-strength = <2>;
475		bias-disable;
476	};
477};
478
479&usb3 {
480	status = "okay";
481};
482
483&usb3_dwc3 {
484	extcon = <&extcon_usb>;
485};
486