xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/msm8953-xiaomi-vince.dts (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2022, Eugene Lepshy <fekz115@gmail.com>
4 * Copyright (c) 2022, Gianluca Boiano <morf3089@gmail.com>
5 */
6/dts-v1/;
7
8#include "msm8953.dtsi"
9#include "pm8953.dtsi"
10#include "pmi8950.dtsi"
11#include <dt-bindings/leds/common.h>
12
13/delete-node/ &adsp_fw_mem;
14/delete-node/ &cont_splash_mem;
15/delete-node/ &qseecom_mem;
16/delete-node/ &wcnss_fw_mem;
17
18/ {
19	model = "Xiaomi Redmi 5 Plus";
20	compatible = "xiaomi,vince", "qcom,msm8953";
21	chassis-type = "handset";
22	qcom,msm-id = <293 0>;
23	qcom,board-id = <0x1000b 0x08>;
24
25	gpio-keys {
26		compatible = "gpio-keys";
27
28		pinctrl-names = "default";
29		pinctrl-0 = <&gpio_key_default>;
30
31		key-volume-up {
32			label = "volume_up";
33			linux,code = <KEY_VOLUMEUP>;
34			gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
35		};
36	};
37
38	reserved-memory {
39		qseecom_mem: qseecom@84a00000 {
40			reg = <0x0 0x84a00000 0x0 0x1900000>;
41			no-map;
42		};
43
44		cont_splash_mem: cont-splash@90001000 {
45			reg = <0x0 0x90001000 0x0 (1080 * 2160 * 3)>;
46			no-map;
47		};
48
49		adsp_fw_mem: adsp@8d600000 {
50			reg = <0x0 0x8d600000 0x0 0x1200000>;
51			no-map;
52		};
53
54		wcnss_fw_mem: wcnss@8e800000 {
55			reg = <0x0 0x8e800000 0x0 0x700000>;
56			no-map;
57		};
58
59		ramoops@9ff00000 {
60			compatible = "ramoops";
61			reg = <0x0 0x9ff00000 0x0 0x100000>;
62			record-size = <0x1000>;
63			console-size = <0x80000>;
64			ftrace-size = <0x1000>;
65			pmsg-size = <0x8000>;
66		};
67	};
68
69	/*
70	 * We bitbang on &i2c_4 because BLSP is protected by TZ as sensors are
71	 * normally proxied via ADSP firmware. GPIOs aren't protected.
72	 */
73	i2c-sensors {
74		compatible = "i2c-gpio";
75		sda-gpios = <&tlmm 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
76		scl-gpios = <&tlmm 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
77		i2c-gpio,delay-us = <2>; /* ~100 kHz */
78		#address-cells = <1>;
79		#size-cells = <0>;
80
81		imu@6a {
82			compatible = "st,lsm6dsl";
83			reg = <0x6a>;
84			vdd-supply = <&pm8953_l10>;
85			vddio-supply = <&pm8953_l6>;
86			mount-matrix = "1", "0", "0",
87					"0", "-1", "0",
88					"0", "0", "1";
89		};
90	};
91
92	vph_pwr: vph-pwr-regulator {
93		compatible = "regulator-fixed";
94		regulator-name = "vph_pwr";
95		regulator-always-on;
96		regulator-boot-on;
97	};
98};
99
100&hsusb_phy {
101	vdd-supply = <&pm8953_l3>;
102	vdda-pll-supply = <&pm8953_l7>;
103	vdda-phy-dpdm-supply = <&pm8953_l13>;
104
105	status = "okay";
106};
107
108&i2c_2 {
109	status = "okay";
110
111	led-controller@45 {
112		compatible = "awinic,aw2013";
113		reg = <0x45>;
114
115		vcc-supply = <&pm8953_l10>;
116
117		#address-cells = <1>;
118		#size-cells = <0>;
119
120		led@0 {
121			reg = <0>;
122			led-max-microamp = <5000>;
123			function = LED_FUNCTION_INDICATOR;
124			color = <LED_COLOR_ID_WHITE>;
125		};
126	};
127};
128
129&i2c_3 {
130	status = "okay";
131
132	touchscreen@20 {
133		reg = <0x20>;
134		compatible = "syna,rmi4-i2c";
135		interrupts-extended = <&tlmm 65 IRQ_TYPE_EDGE_FALLING>;
136
137		#address-cells = <1>;
138		#size-cells = <0>;
139
140		vdd-supply = <&pm8953_l10>;
141		vio-supply = <&pm8953_l6>;
142
143		pinctrl-names = "init", "suspend";
144		pinctrl-0 = <&ts_reset_active &ts_int_active>;
145		pinctrl-1 = <&ts_reset_suspend &ts_int_suspend>;
146		syna,reset-delay-ms = <200>;
147		syna,startup-delay-ms = <500>;
148
149		rmi4-f01@1 {
150			reg = <0x01>;
151			syna,nosleep-mode = <1>;
152		};
153
154		rmi4-f12@12 {
155			reg = <0x12>;
156			syna,rezero-wait-ms = <20>;
157			syna,sensor-type = <1>;
158			touchscreen-x-mm = <68>;
159			touchscreen-y-mm = <122>;
160		};
161	};
162};
163
164&pm8953_resin {
165	linux,code = <KEY_VOLUMEDOWN>;
166	status = "okay";
167};
168
169&pmi8950_wled {
170	qcom,current-limit-microamp = <20000>;
171	qcom,ovp-millivolt = <29600>;
172	qcom,num-strings = <2>;
173	qcom,external-pfet;
174	qcom,cabc;
175
176	status = "okay";
177};
178
179&rpm_requests {
180	regulators {
181		compatible = "qcom,rpm-pm8953-regulators";
182		vdd_s1-supply = <&vph_pwr>;
183		vdd_s2-supply = <&vph_pwr>;
184		vdd_s3-supply = <&vph_pwr>;
185		vdd_s4-supply = <&vph_pwr>;
186		vdd_s5-supply = <&vph_pwr>;
187		vdd_s6-supply = <&vph_pwr>;
188		vdd_s7-supply = <&vph_pwr>;
189		vdd_l1-supply = <&pm8953_s3>;
190		vdd_l2_l3-supply = <&pm8953_s3>;
191		vdd_l4_l5_l6_l7_l16_l19-supply = <&pm8953_s4>;
192		vdd_l8_l11_l12_l13_l14_l15-supply = <&vph_pwr>;
193		vdd_l9_l10_l17_l18_l22-supply = <&vph_pwr>;
194
195		pm8953_s1: s1 {
196			regulator-min-microvolt = <870000>;
197			regulator-max-microvolt = <1156000>;
198		};
199
200		pm8953_s3: s3 {
201			regulator-min-microvolt = <984000>;
202			regulator-max-microvolt = <1224000>;
203		};
204
205		pm8953_s4: s4 {
206			regulator-min-microvolt = <1900000>;
207			regulator-max-microvolt = <2050000>;
208		};
209
210		pm8953_l1: l1 {
211			regulator-min-microvolt = <1000000>;
212			regulator-max-microvolt = <1100000>;
213		};
214
215		pm8953_l2: l2 {
216			regulator-min-microvolt = <1200000>;
217			regulator-max-microvolt = <1225000>;
218		};
219
220		pm8953_l3: l3 {
221			regulator-min-microvolt = <925000>;
222			regulator-max-microvolt = <925000>;
223		};
224
225		pm8953_l5: l5 {
226			regulator-min-microvolt = <1800000>;
227			regulator-max-microvolt = <1800000>;
228		};
229
230		pm8953_l6: l6 {
231			regulator-min-microvolt = <1800000>;
232			regulator-max-microvolt = <1800000>;
233		};
234
235		pm8953_l7: l7 {
236			regulator-min-microvolt = <1800000>;
237			regulator-max-microvolt = <1900000>;
238		};
239
240		pm8953_l8: l8 {
241			regulator-min-microvolt = <2900000>;
242			regulator-max-microvolt = <2900000>;
243		};
244
245		pm8953_l9: l9 {
246			regulator-min-microvolt = <3000000>;
247			regulator-max-microvolt = <3300000>;
248		};
249
250		pm8953_l10: l10 {
251			regulator-min-microvolt = <2850000>;
252			regulator-max-microvolt = <2850000>;
253		};
254
255		pm8953_l11: l11 {
256			regulator-min-microvolt = <2950000>;
257			regulator-max-microvolt = <2950000>;
258		};
259
260		pm8953_l12: l12 {
261			regulator-min-microvolt = <1800000>;
262			regulator-max-microvolt = <2950000>;
263		};
264
265		pm8953_l13: l13 {
266			regulator-min-microvolt = <3125000>;
267			regulator-max-microvolt = <3125000>;
268		};
269
270		pm8953_l16: l16 {
271			regulator-min-microvolt = <1800000>;
272			regulator-max-microvolt = <1800000>;
273		};
274
275		pm8953_l17: l17 {
276			regulator-min-microvolt = <2750000>;
277			regulator-max-microvolt = <2850000>;
278		};
279
280		pm8953_l19: l19 {
281			regulator-min-microvolt = <1200000>;
282			regulator-max-microvolt = <1380000>;
283		};
284
285		pm8953_l22: l22 {
286			regulator-min-microvolt = <2800000>;
287			regulator-max-microvolt = <2800000>;
288		};
289
290		pm8953_l23: l23 {
291			regulator-min-microvolt = <1200000>;
292			regulator-max-microvolt = <1225000>;
293		};
294	};
295};
296
297&sdhc_1 {
298	vmmc-supply = <&pm8953_l8>;
299	vqmmc-supply = <&pm8953_l5>;
300
301	status = "okay";
302};
303
304&sdhc_2 {
305	vmmc-supply = <&pm8953_l11>;
306	vqmmc-supply = <&pm8953_l12>;
307
308	pinctrl-names = "default", "sleep";
309	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
310	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
311
312	status = "okay";
313};
314
315&tlmm {
316	gpio-reserved-ranges = <0 4>, <16 4>, <135 4>;
317
318	ts_reset_active: ts-reset-active-state {
319		pins = "gpio64";
320		function = "gpio";
321		drive-strength = <8>;
322		bias-pull-up;
323	};
324
325	ts_reset_suspend: ts-reset-suspend-state {
326		pins = "gpio64";
327		function = "gpio";
328		drive-strength = <2>;
329		bias-pull-up;
330	};
331
332	ts_int_active: ts-int-active-state {
333		pins = "gpio65";
334		function = "gpio";
335		drive-strength = <8>;
336		bias-pull-up;
337	};
338
339	ts_int_suspend: ts-int-suspend-state {
340		pins = "gpio65";
341		function = "gpio";
342		drive-strength = <2>;
343		bias-pull-down;
344	};
345};
346
347&uart_0 {
348	pinctrl-names = "default";
349	pinctrl-0 = <&uart_console_active>;
350
351	status = "okay";
352};
353
354&usb3 {
355	status = "okay";
356};
357
358&usb3_dwc3 {
359	dr_mode = "peripheral";
360};
361