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	chosen {
24		#address-cells = <2>;
25		#size-cells = <2>;
26		ranges;
27
28		framebuffer0: framebuffer@5c000000 {
29			compatible = "simple-framebuffer";
30			reg = <0 0x5c000000 0 (2520 * 1080 * 4)>;
31			width = <1080>;
32			height = <2520>;
33			stride = <(1080 * 4)>;
34			format = "a8r8g8b8";
35		};
36	};
37
38	extcon_usb: extcon-usb {
39		compatible = "linux,extcon-usb-gpio";
40		id-gpio = <&tlmm 102 GPIO_ACTIVE_HIGH>;
41	};
42
43	gpio-keys {
44		status = "okay";
45		compatible = "gpio-keys";
46		autorepeat;
47
48		key-vol-dn {
49			label = "Volume Down";
50			gpios = <&tlmm 47 GPIO_ACTIVE_LOW>;
51			linux,input-type = <1>;
52			linux,code = <KEY_VOLUMEDOWN>;
53			gpio-key,wakeup;
54			debounce-interval = <15>;
55		};
56	};
57
58	reserved_memory {
59		#address-cells = <2>;
60		#size-cells = <2>;
61		debug_mem: memory@ffb00000 {
62			reg = <0x0 0xffb00000 0x0 0xc0000>;
63			no-map;
64		};
65
66		last_log_mem: memory@ffbc0000 {
67			reg = <0x0 0xffbc0000 0x0 0x80000>;
68			no-map;
69		};
70
71		pstore_mem: ramoops@ffc00000 {
72			compatible = "ramoops";
73			reg = <0x0 0xffc40000 0x0 0xc0000>;
74			record-size = <0x1000>;
75			console-size = <0x40000>;
76			msg-size = <0x20000 0x20000>;
77		};
78
79		cmdline_mem: memory@ffd00000 {
80			reg = <0x0 0xffd40000 0x0 0x1000>;
81			no-map;
82		};
83	};
84
85	thermal-zones {
86		rf-pa0-thermal {
87			polling-delay-passive = <0>;
88			polling-delay = <0>;
89			thermal-sensors = <&pm6125_adc_tm 0>;
90
91			trips {
92				active-config0 {
93					temperature = <125000>;
94					hysteresis = <1000>;
95					type = "critical";
96				};
97			};
98		};
99
100		quiet-thermal {
101			polling-delay-passive = <0>;
102			polling-delay = <5000>;
103			thermal-sensors = <&pm6125_adc_tm 1>;
104
105			trips {
106				active-config0 {
107					temperature = <125000>;
108					hysteresis = <1000>;
109					type = "critical";
110				};
111			};
112		};
113
114		xo-thermal {
115			polling-delay-passive = <0>;
116			polling-delay = <0>;
117			thermal-sensors = <&pm6125_adc_tm 2>;
118
119			trips {
120				active-config0 {
121					temperature = <125000>;
122					hysteresis = <1000>;
123					type = "critical";
124				};
125			};
126		};
127
128		rf-pa1-thermal {
129			polling-delay-passive = <0>;
130			polling-delay = <0>;
131			thermal-sensors = <&pm6125_adc_tm 3>;
132
133			trips {
134				active-config0 {
135					temperature = <125000>;
136					hysteresis = <1000>;
137					type = "critical";
138				};
139			};
140		};
141	};
142};
143
144&hsusb_phy1 {
145	status = "okay";
146};
147
148&pm6125_adc {
149	pinctrl-names = "default";
150	pinctrl-0 = <&camera_flash_therm &emmc_ufs_therm &rf_pa1_therm>;
151
152	rf-pa0-therm@4d {
153		reg = <ADC5_AMUX_THM1_100K_PU>;
154		qcom,ratiometric;
155		qcom,hw-settle-time = <200>;
156		qcom,pre-scaling = <1 1>;
157	};
158
159	quiet-therm@4e {
160		reg = <ADC5_AMUX_THM2_100K_PU>;
161		qcom,ratiometric;
162		qcom,hw-settle-time = <200>;
163		qcom,pre-scaling = <1 1>;
164	};
165
166	camera-flash-therm@52 {
167		reg = <ADC5_GPIO1_100K_PU>;
168		qcom,ratiometric;
169		qcom,hw-settle-time = <200>;
170		qcom,pre-scaling = <1 1>;
171	};
172
173	emmc-ufs-therm@54 {
174		reg = <ADC5_GPIO3_100K_PU>;
175		qcom,ratiometric;
176		qcom,hw-settle-time = <200>;
177		qcom,pre-scaling = <1 1>;
178	};
179
180	rf-pa1-therm@55 {
181		reg = <ADC5_GPIO4_100K_PU>;
182		qcom,ratiometric;
183		qcom,hw-settle-time = <200>;
184		qcom,pre-scaling = <1 1>;
185	};
186};
187
188&pm6125_adc_tm {
189	status = "okay";
190
191	rf-pa0-therm@0 {
192		reg = <0>;
193		io-channels = <&pm6125_adc ADC5_AMUX_THM1_100K_PU>;
194		qcom,ratiometric;
195		qcom,hw-settle-time-us = <200>;
196	};
197
198	quiet-therm@1 {
199		reg = <1>;
200		io-channels = <&pm6125_adc ADC5_AMUX_THM2_100K_PU>;
201		qcom,ratiometric;
202		qcom,hw-settle-time-us = <200>;
203	};
204
205	xo-therm@2 {
206		reg = <2>;
207		io-channels = <&pm6125_adc ADC5_XO_THERM_100K_PU>;
208		qcom,ratiometric;
209		qcom,hw-settle-time-us = <200>;
210	};
211
212	rf-pa1-therm@3 {
213		reg = <3>;
214		io-channels = <&pm6125_adc ADC5_GPIO4_100K_PU>;
215		qcom,ratiometric;
216		qcom,hw-settle-time-us = <200>;
217	};
218};
219
220&pm6125_gpio {
221	camera_flash_therm: camera-flash-therm-state {
222		pins = "gpio3";
223		function = PMIC_GPIO_FUNC_NORMAL;
224		bias-high-impedance;
225	};
226
227	emmc_ufs_therm: emmc-ufs-therm-state {
228		pins = "gpio6";
229		function = PMIC_GPIO_FUNC_NORMAL;
230		bias-high-impedance;
231	};
232
233	rf_pa1_therm: rf-pa1-therm-state {
234		pins = "gpio7";
235		function = PMIC_GPIO_FUNC_NORMAL;
236		bias-high-impedance;
237	};
238};
239
240&pon_pwrkey {
241	status = "okay";
242};
243
244&pon_resin {
245	status = "okay";
246	linux,code = <KEY_VOLUMEUP>;
247};
248
249&sdc2_off_state {
250	sd-cd-pins {
251		pins = "gpio98";
252		function = "gpio";
253		drive-strength = <2>;
254		bias-disable;
255	};
256};
257
258&sdc2_on_state {
259	sd-cd-pins {
260		pins = "gpio98";
261		function = "gpio";
262		drive-strength = <2>;
263		bias-pull-up;
264	};
265};
266
267&sdhc_1 {
268	status = "okay";
269};
270
271&tlmm {
272	gpio-reserved-ranges = <22 2>, <28 6>;
273};
274
275&usb3 {
276	status = "okay";
277};
278
279&usb3_dwc3 {
280	extcon = <&extcon_usb>;
281};
282