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-gpio = <&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			msg-size = <0x20000 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	rf-pa0-therm@4d {
187		reg = <ADC5_AMUX_THM1_100K_PU>;
188		qcom,ratiometric;
189		qcom,hw-settle-time = <200>;
190		qcom,pre-scaling = <1 1>;
191	};
192
193	quiet-therm@4e {
194		reg = <ADC5_AMUX_THM2_100K_PU>;
195		qcom,ratiometric;
196		qcom,hw-settle-time = <200>;
197		qcom,pre-scaling = <1 1>;
198	};
199
200	camera-flash-therm@52 {
201		reg = <ADC5_GPIO1_100K_PU>;
202		qcom,ratiometric;
203		qcom,hw-settle-time = <200>;
204		qcom,pre-scaling = <1 1>;
205	};
206
207	emmc-ufs-therm@54 {
208		reg = <ADC5_GPIO3_100K_PU>;
209		qcom,ratiometric;
210		qcom,hw-settle-time = <200>;
211		qcom,pre-scaling = <1 1>;
212	};
213
214	rf-pa1-therm@55 {
215		reg = <ADC5_GPIO4_100K_PU>;
216		qcom,ratiometric;
217		qcom,hw-settle-time = <200>;
218		qcom,pre-scaling = <1 1>;
219	};
220};
221
222&pm6125_adc_tm {
223	status = "okay";
224
225	rf-pa0-therm@0 {
226		reg = <0>;
227		io-channels = <&pm6125_adc ADC5_AMUX_THM1_100K_PU>;
228		qcom,ratiometric;
229		qcom,hw-settle-time-us = <200>;
230	};
231
232	quiet-therm@1 {
233		reg = <1>;
234		io-channels = <&pm6125_adc ADC5_AMUX_THM2_100K_PU>;
235		qcom,ratiometric;
236		qcom,hw-settle-time-us = <200>;
237	};
238
239	xo-therm@2 {
240		reg = <2>;
241		io-channels = <&pm6125_adc ADC5_XO_THERM_100K_PU>;
242		qcom,ratiometric;
243		qcom,hw-settle-time-us = <200>;
244	};
245
246	rf-pa1-therm@3 {
247		reg = <3>;
248		io-channels = <&pm6125_adc ADC5_GPIO4_100K_PU>;
249		qcom,ratiometric;
250		qcom,hw-settle-time-us = <200>;
251	};
252};
253
254&pm6125_gpios {
255	camera_flash_therm: camera-flash-therm-state {
256		pins = "gpio3";
257		function = PMIC_GPIO_FUNC_NORMAL;
258		bias-high-impedance;
259	};
260
261	emmc_ufs_therm: emmc-ufs-therm-state {
262		pins = "gpio6";
263		function = PMIC_GPIO_FUNC_NORMAL;
264		bias-high-impedance;
265	};
266
267	rf_pa1_therm: rf-pa1-therm-state {
268		pins = "gpio7";
269		function = PMIC_GPIO_FUNC_NORMAL;
270		bias-high-impedance;
271	};
272};
273
274&pon_pwrkey {
275	status = "okay";
276};
277
278&pon_resin {
279	status = "okay";
280	linux,code = <KEY_VOLUMEUP>;
281};
282
283&rpm_requests {
284	regulators-0 {
285		compatible = "qcom,rpm-pm6125-regulators";
286
287		vdd_l2_l3_l4-supply = <&pm6125_l7>;
288		vdd_l5_l15_l19_l20_l21_l22-supply = <&pm6125_l10>;
289
290		/*
291		 * S3/S4 is VDD_CX
292		 * S5 is VDD_MX/WCSS_MX
293		 */
294
295		pm6125_s6: s6 {
296			regulator-min-microvolt = <936000>;
297			regulator-max-microvolt = <1422000>;
298		};
299
300		pm6125_l1: l1 {
301			regulator-min-microvolt = <1200000>;
302			regulator-max-microvolt = <1256000>;
303		};
304
305		pm6125_l2: l2 {
306			regulator-min-microvolt = <1000000>;
307			regulator-max-microvolt = <1056000>;
308		};
309
310		pm6125_l3: l3 {
311			regulator-min-microvolt = <1000000>;
312			regulator-max-microvolt = <1064000>;
313		};
314
315		pm6125_l4: l4 {
316			regulator-min-microvolt = <872000>;
317			regulator-max-microvolt = <976000>;
318		};
319
320		pm6125_l5: l5 {
321			regulator-min-microvolt = <1648000>;
322			regulator-max-microvolt = <2950000>;
323			regulator-allow-set-load;
324		};
325
326		pm6125_l6: l6 {
327			regulator-min-microvolt = <576000>;
328			regulator-max-microvolt = <656000>;
329		};
330
331		pm6125_l7: l7 {
332			regulator-min-microvolt = <872000>;
333			regulator-max-microvolt = <976000>;
334		};
335
336		pm6125_l8: l8 {
337			regulator-min-microvolt = <400000>;
338			regulator-max-microvolt = <728000>;
339		};
340
341		pm6125_l9: l9 {
342			regulator-min-microvolt = <1800000>;
343			regulator-max-microvolt = <1896000>;
344		};
345
346		pm6125_l10: l10 {
347			regulator-min-microvolt = <1800000>;
348			regulator-max-microvolt = <1896000>;
349		};
350
351		pm6125_l11: l11 {
352			regulator-min-microvolt = <1800000>;
353			regulator-max-microvolt = <1800000>;
354			regulator-allow-set-load;
355		};
356
357		pm6125_l12: l12 {
358			regulator-min-microvolt = <1800000>;
359			regulator-max-microvolt = <1996000>;
360		};
361
362		pm6125_l13: l13 {
363			regulator-min-microvolt = <1800000>;
364			regulator-max-microvolt = <1832000>;
365		};
366
367		pm6125_l14: l14 {
368			regulator-min-microvolt = <1800000>;
369			regulator-max-microvolt = <1904000>;
370		};
371
372		pm6125_l15: l15 {
373			regulator-min-microvolt = <3104000>;
374			regulator-max-microvolt = <3232000>;
375		};
376
377		pm6125_l16: l16 {
378			regulator-min-microvolt = <1800000>;
379			regulator-max-microvolt = <1904000>;
380		};
381
382		pm6125_l17: l17 {
383			regulator-min-microvolt = <1248000>;
384			regulator-max-microvolt = <1304000>;
385		};
386
387		pm6125_l18: l18 {
388			regulator-min-microvolt = <1200000>;
389			regulator-max-microvolt = <1264000>;
390		};
391
392		pm6125_l19: l19 {
393			regulator-min-microvolt = <1648000>;
394			regulator-max-microvolt = <2952000>;
395		};
396
397		pm6125_l20: l20 {
398			regulator-min-microvolt = <1648000>;
399			regulator-max-microvolt = <2952000>;
400		};
401
402		pm6125_l21: l21 {
403			regulator-min-microvolt = <2600000>;
404			regulator-max-microvolt = <2856000>;
405		};
406
407		pm6125_l22: l22 {
408			regulator-min-microvolt = <2944000>;
409			regulator-max-microvolt = <2950000>;
410			regulator-allow-set-load;
411		};
412
413		pm6125_l23: l23 {
414			regulator-min-microvolt = <3000000>;
415			regulator-max-microvolt = <3400000>;
416		};
417
418		pm6125_l24: l24 {
419			regulator-min-microvolt = <2944000>;
420			regulator-max-microvolt = <2950000>;
421			regulator-allow-set-load;
422		};
423	};
424};
425
426&qupv3_id_0 {
427	status = "okay";
428};
429
430&sdc2_off_state {
431	sd-cd-pins {
432		pins = "gpio98";
433		function = "gpio";
434		drive-strength = <2>;
435		bias-disable;
436	};
437};
438
439&sdc2_on_state {
440	sd-cd-pins {
441		pins = "gpio98";
442		function = "gpio";
443		drive-strength = <2>;
444		bias-pull-up;
445	};
446};
447
448&sdhc_1 {
449	vmmc-supply = <&pm6125_l24>;
450	vqmmc-supply = <&pm6125_l11>;
451	status = "okay";
452};
453
454&sdhc_2 {
455	cd-gpios = <&tlmm 98 GPIO_ACTIVE_HIGH>;
456	vmmc-supply = <&pm6125_l22>;
457	vqmmc-supply = <&pm6125_l5>;
458	no-sdio;
459	no-mmc;
460	status = "okay";
461};
462
463&tlmm {
464	gpio-reserved-ranges = <22 2>, <28 6>;
465
466	vol_down_n: vol-down-n-state {
467		pins = "gpio47";
468		function = "gpio";
469		drive-strength = <2>;
470		bias-disable;
471		input-enable;
472	};
473};
474
475&usb3 {
476	status = "okay";
477};
478
479&usb3_dwc3 {
480	extcon = <&extcon_usb>;
481};
482