1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Konrad Dybcio <konrad.dybcio@somainline.org>
4 */
5
6/dts-v1/;
7
8/* PMK8350 is configured to use SID6 instead of 0 */
9#define PMK8350_SID 6
10
11#include <dt-bindings/gpio/gpio.h>
12#include "sm6375.dtsi"
13#include "pm6125.dtsi"
14#include "pmk8350.dtsi"
15#include "pmr735a.dtsi"
16
17/* PM6125 PON is used and we can't have duplicate labels */
18/delete-node/ &pmk8350_pon;
19
20/ {
21	model = "Sony Xperia 10 IV";
22	compatible = "sony,pdx225", "qcom,sm6375";
23	chassis-type = "handset";
24
25	chosen {
26		#address-cells = <2>;
27		#size-cells = <2>;
28		ranges;
29
30		framebuffer: framebuffer@85200000 {
31			compatible = "simple-framebuffer";
32			reg = <0 0x85200000 0 0xc00000>;
33
34			width = <1080>;
35			height = <2520>;
36			stride = <(1080 * 4)>;
37			format = "a8r8g8b8";
38			/*
39			 * That's (going to be) a lot of clocks, but it's necessary due
40			 * to unused clk cleanup & no panel driver yet
41			 */
42			clocks = <&gcc GCC_DISP_AHB_CLK>,
43				 <&gcc GCC_DISP_HF_AXI_CLK>,
44				 <&gcc GCC_DISP_THROTTLE_CORE_CLK>,
45				 <&gcc GCC_DISP_GPLL0_DIV_CLK_SRC>;
46		};
47	};
48
49	gpio-keys {
50		compatible = "gpio-keys";
51		label = "gpio-keys";
52
53		pinctrl-0 = <&vol_down_n>;
54		pinctrl-names = "default";
55
56		key-volume-down {
57			label = "Volume Down";
58			linux,code = <KEY_VOLUMEDOWN>;
59			gpios = <&pmr735a_gpios 1 GPIO_ACTIVE_LOW>;
60			debounce-interval = <15>;
61			linux,can-disable;
62			wakeup-source;
63		};
64	};
65
66	reserved-memory {
67		cont_splash_mem: memory@85200000 {
68			reg = <0 0x85200000 0 0xc00000>;
69			no-map;
70		};
71
72		ramoops@ffc40000 {
73			compatible = "ramoops";
74			reg = <0 0xffc40000 0 0xb0000>;
75			record-size = <0x10000>;
76			console-size = <0x60000>;
77			ftrace-size = <0x10000>;
78			pmsg-size = <0x20000>;
79			ecc-size = <16>;
80		};
81	};
82
83	vph_pwr: vph-pwr-regulator {
84		compatible = "regulator-fixed";
85		regulator-name = "vph_pwr";
86		regulator-min-microvolt = <3700000>;
87		regulator-max-microvolt = <3700000>;
88		regulator-always-on;
89		regulator-boot-on;
90	};
91};
92
93&sdc2_off_state {
94	sd-cd-pins {
95		pins = "gpio94";
96		function = "gpio";
97		drive-strength = <2>;
98		bias-disable;
99	};
100};
101
102&sdc2_on_state {
103	sd-cd-pins {
104		pins = "gpio94";
105		function = "gpio";
106		drive-strength = <2>;
107		bias-pull-up;
108	};
109};
110
111&sdhc_2 {
112	status = "okay";
113
114	vmmc-supply = <&pm6125_l22>;
115	vqmmc-supply = <&pm6125_l5>;
116
117	cd-gpios = <&tlmm 94 GPIO_ACTIVE_HIGH>;
118};
119
120&gpi_dma0 {
121	status = "okay";
122};
123
124&gpi_dma1 {
125	status = "okay";
126};
127
128&i2c8 {
129	clock-frequency = <400000>;
130	status = "okay";
131
132	touchscreen@48 {
133		compatible = "samsung,s6sy761";
134		reg = <0x48>;
135		interrupt-parent = <&tlmm>;
136		interrupts = <22 0x2008>;
137
138		vdd-supply = <&pm6125_l13>;
139
140		pinctrl-names = "default";
141		pinctrl-0 = <&ts_int_default &ts_avdd_default>;
142	};
143};
144
145&pmk8350_adc_tm {
146	status = "okay";
147};
148
149&pmk8350_rtc {
150	status = "okay";
151};
152
153&pmr735a_gpios {
154	vol_down_n: vol-down-n-state {
155		pins = "gpio1";
156		function = "normal";
157		power-source = <1>;
158		bias-pull-up;
159		input-enable;
160	};
161};
162
163&pon_pwrkey {
164	status = "okay";
165};
166
167&pon_resin {
168	linux,code = <KEY_VOLUMEUP>;
169	status = "okay";
170};
171
172&qupv3_id_0 {
173	status = "okay";
174};
175
176&qupv3_id_1 {
177	status = "okay";
178};
179
180&remoteproc_adsp {
181	firmware-name = "qcom/sm6375/Sony/murray/adsp.mbn";
182	status = "okay";
183};
184
185&remoteproc_cdsp {
186	firmware-name = "qcom/sm6375/Sony/murray/cdsp.mbn";
187	status = "okay";
188};
189
190&rpm_requests {
191	regulators-0 {
192		compatible = "qcom,rpm-pm6125-regulators";
193
194		pm6125_s5: s5 {
195			regulator-min-microvolt = <382000>;
196			regulator-max-microvolt = <1120000>;
197		};
198
199		pm6125_s6: s6 {
200			regulator-min-microvolt = <320000>;
201			regulator-max-microvolt = <1374000>;
202		};
203
204		pm6125_s7: s7 {
205			regulator-min-microvolt = <1574000>;
206			regulator-max-microvolt = <2040000>;
207		};
208
209		/*
210		 * S8 is VDD_GFX
211		 * L1 is VDD_LPI_CX
212		 */
213
214		pm6125_l2: l2 {
215			regulator-min-microvolt = <1170000>;
216			regulator-max-microvolt = <1304000>;
217		};
218
219		pm6125_l3: l3 {
220			regulator-min-microvolt = <1100000>;
221			regulator-max-microvolt = <1300000>;
222		};
223
224		pm6125_l4: l4 {
225			regulator-min-microvolt = <1100000>;
226			regulator-max-microvolt = <1300000>;
227		};
228
229		pm6125_l5: l5 {
230			regulator-min-microvolt = <1650000>;
231			regulator-max-microvolt = <2960000>;
232			regulator-allow-set-load;
233		};
234
235		pm6125_l6: l6 {
236			regulator-min-microvolt = <1080000>;
237			regulator-max-microvolt = <1304000>;
238		};
239
240		pm6125_l7: l7 {
241			regulator-min-microvolt = <720000>;
242			regulator-max-microvolt = <1050000>;
243		};
244
245		pm6125_l8: l8 {
246			regulator-min-microvolt = <1100000>;
247			regulator-max-microvolt = <1304000>;
248		};
249
250		pm6125_l9: l9 {
251			regulator-min-microvolt = <1504000>;
252			regulator-max-microvolt = <2000000>;
253		};
254
255		pm6125_l10: l10 {
256			regulator-min-microvolt = <1620000>;
257			regulator-max-microvolt = <1980000>;
258		};
259
260		pm6125_l11: l11 {
261			regulator-min-microvolt = <1620000>;
262			regulator-max-microvolt = <1980000>;
263		};
264
265		pm6125_l12: l12 {
266			regulator-min-microvolt = <1620000>;
267			regulator-max-microvolt = <2000000>;
268		};
269
270		pm6125_l13: l13 {
271			regulator-min-microvolt = <1650000>;
272			regulator-max-microvolt = <1980000>;
273		};
274
275		pm6125_l14: l14 {
276			regulator-min-microvolt = <1700000>;
277			regulator-max-microvolt = <1900000>;
278		};
279
280		pm6125_l15: l15 {
281			regulator-min-microvolt = <1650000>;
282			regulator-max-microvolt = <3544000>;
283		};
284
285		pm6125_l16: l16 {
286			regulator-min-microvolt = <1620000>;
287			regulator-max-microvolt = <1980000>;
288		};
289
290		/* L17 is VDD_LPI_MX */
291
292		pm6125_l18: l18 {
293			regulator-min-microvolt = <830000>;
294			regulator-max-microvolt = <920000>;
295		};
296
297		pm6125_l19: l19 {
298			regulator-min-microvolt = <1624000>;
299			regulator-max-microvolt = <3304000>;
300		};
301
302		pm6125_l20: l20 {
303			regulator-min-microvolt = <1624000>;
304			regulator-max-microvolt = <3304000>;
305		};
306
307		pm6125_l21: l21 {
308			regulator-min-microvolt = <3000000>;
309			regulator-max-microvolt = <3400000>;
310		};
311
312		pm6125_l22: l22 {
313			regulator-min-microvolt = <2704000>;
314			regulator-max-microvolt = <2960000>;
315			regulator-allow-set-load;
316		};
317
318		pm6125_l23: l23 {
319			regulator-min-microvolt = <3000000>;
320			regulator-max-microvolt = <3400000>;
321		};
322
323		pm6125_l24: l24 {
324			regulator-min-microvolt = <2704000>;
325			regulator-max-microvolt = <3544000>;
326		};
327	};
328
329	regulators-1 {
330		compatible = "qcom,rpm-pmr735a-regulators";
331
332		/*
333		 * S1 is VDD_MX
334		 * S2 is VDD_CX
335		 */
336
337		pmr735a_l1: l1 {
338			regulator-min-microvolt = <570000>;
339			regulator-max-microvolt = <650000>;
340		};
341
342		pmr735a_l2: l2 {
343			regulator-min-microvolt = <352000>;
344			regulator-max-microvolt = <796000>;
345		};
346
347		pmr735a_l3: l3 {
348			regulator-min-microvolt = <1000000>;
349			regulator-max-microvolt = <1200000>;
350		};
351
352		pmr735a_l4: l4 {
353			regulator-min-microvolt = <1504000>;
354			regulator-max-microvolt = <2000000>;
355		};
356
357		pmr735a_l5: l5 {
358			regulator-min-microvolt = <751000>;
359			regulator-max-microvolt = <824000>;
360		};
361
362		pmr735a_l6: l6 {
363			regulator-min-microvolt = <504000>;
364			regulator-max-microvolt = <868000>;
365		};
366
367		pmr735a_l7: l7 {
368			regulator-min-microvolt = <2700000>;
369			regulator-max-microvolt = <3544000>;
370		};
371	};
372};
373
374&sdc2_off_state {
375	sd-cd-pins {
376		pins = "gpio94";
377		function = "gpio";
378		drive-strength = <2>;
379		bias-disable;
380	};
381};
382
383&sdc2_on_state {
384	sd-cd-pins {
385		pins = "gpio94";
386		function = "gpio";
387		drive-strength = <2>;
388		bias-pull-up;
389	};
390};
391
392&sdhc_2 {
393	status = "okay";
394
395	vmmc-supply = <&pm6125_l22>;
396	vqmmc-supply = <&pm6125_l5>;
397
398	cd-gpios = <&tlmm 94 GPIO_ACTIVE_HIGH>;
399};
400
401&tlmm {
402	gpio-reserved-ranges = <13 4>;
403
404	ts_int_default: ts-int-default-state {
405		pins = "gpio22";
406		function = "gpio";
407		drive-strength = <8>;
408		bias-pull-up;
409	};
410
411	ts_avdd_default: ts-avdd-default-state {
412		pins = "gpio59";
413		function = "gpio";
414		drive-strength = <8>;
415		output-high;
416	};
417};
418
419&usb_1 {
420	status = "okay";
421};
422
423&usb_1_dwc3 {
424	dr_mode = "peripheral";
425};
426
427&usb_1_hsphy {
428	status = "okay";
429};
430
431&xo_board_clk {
432	clock-frequency = <19200000>;
433};
434