1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Copyright (c) 2023, Barnabas Czeman
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/arm/qcom,ids.h>
9#include <dt-bindings/gpio/gpio.h>
10#include "msm8917.dtsi"
11#include "pm8937.dtsi"
12
13/delete-node/ &qseecom_mem;
14
15/ {
16	model = "Xiaomi Redmi 5A (riva)";
17	compatible = "xiaomi,riva", "qcom,msm8917";
18	chassis-type = "handset";
19
20	qcom,msm-id = <QCOM_ID_MSM8917 0>;
21	qcom,board-id = <0x1000b 2>, <0x2000b 2>;
22
23	battery: battery {
24		compatible = "simple-battery";
25		charge-full-design-microamp-hours = <3000000>;
26		energy-full-design-microwatt-hours = <11500000>;
27		constant-charge-current-max-microamp = <1000000>;
28		constant-charge-voltage-max-microvolt = <4400000>;
29		precharge-current-microamp = <256000>;
30		charge-term-current-microamp = <60000>;
31		voltage-min-design-microvolt = <3400000>;
32	};
33
34	chosen {
35		#address-cells = <2>;
36		#size-cells = <2>;
37		ranges;
38
39		stdout-path = "framebuffer0";
40
41		framebuffer0: framebuffer@90001000 {
42			compatible = "simple-framebuffer";
43			reg = <0x0 0x90001000 0x0 (720 * 1280 * 3)>;
44			width = <720>;
45			height = <1280>;
46			stride = <(720 * 3)>;
47			format = "r8g8b8";
48
49			clocks = <&gcc GCC_MDSS_AHB_CLK>,
50				 <&gcc GCC_MDSS_AXI_CLK>,
51				 <&gcc GCC_MDSS_VSYNC_CLK>,
52				 <&gcc GCC_MDSS_MDP_CLK>,
53				 <&gcc GCC_MDSS_BYTE0_CLK>,
54				 <&gcc GCC_MDSS_PCLK0_CLK>,
55				 <&gcc GCC_MDSS_ESC0_CLK>;
56			power-domains = <&gcc MDSS_GDSC>;
57		};
58	};
59
60	gpio-keys {
61		compatible = "gpio-keys";
62
63		pinctrl-0 = <&gpio_keys_default>;
64		pinctrl-names = "default";
65
66		key-volup {
67			label = "Volume Up";
68			linux,code = <KEY_VOLUMEUP>;
69			gpios = <&tlmm 91 GPIO_ACTIVE_LOW>;
70			debounce-interval = <15>;
71		};
72	};
73
74	vph_pwr: regulator-vph-pwr {
75		compatible = "regulator-fixed";
76		regulator-name = "vph_pwr";
77		regulator-min-microvolt = <3700000>;
78		regulator-max-microvolt = <3700000>;
79		regulator-always-on;
80		regulator-boot-on;
81	};
82
83	reserved-memory {
84		qseecom_mem: qseecom@84a00000 {
85			reg = <0x0 0x84a00000 0x0 0x1900000>;
86			no-map;
87		};
88
89		framebuffer_mem: memory@90001000 {
90			reg = <0x0 0x90001000 0x0 (720 * 1280 * 3)>;
91			no-map;
92		};
93	};
94};
95
96&blsp1_i2c3 {
97	status = "okay";
98
99	touchscreen@38 {
100		compatible = "edt,edt-ft5306";
101		reg = <0x38>;
102		interrupts-extended = <&tlmm 65 IRQ_TYPE_LEVEL_LOW>;
103		reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
104		pinctrl-0 = <&tsp_int_rst_default>;
105		pinctrl-names = "default";
106		vcc-supply = <&pm8937_l10>;
107		iovcc-supply = <&pm8937_l5>;
108		touchscreen-size-x = <720>;
109		touchscreen-size-y = <1280>;
110	};
111};
112
113&blsp2_i2c1 {
114	status = "okay";
115
116	bq27426@55 {
117		compatible = "ti,bq27426";
118		reg = <0x55>;
119		monitored-battery = <&battery>;
120	};
121
122	bq25601@6b{
123		compatible = "ti,bq25601";
124		reg = <0x6b>;
125		interrupts-extended = <&tlmm 61 IRQ_TYPE_EDGE_FALLING>;
126		pinctrl-0 = <&bq25601_int_default>;
127		pinctrl-names = "default";
128		input-voltage-limit-microvolt = <4400000>;
129		input-current-limit-microamp = <1000000>;
130		monitored-battery = <&battery>;
131	};
132};
133
134&pm8937_resin {
135	linux,code = <KEY_VOLUMEDOWN>;
136
137	status = "okay";
138};
139
140&rpm_requests {
141	regulators-0 {
142		compatible = "qcom,rpm-pm8937-regulators";
143
144		vdd_s1-supply = <&vph_pwr>;
145		vdd_s2-supply = <&vph_pwr>;
146		vdd_s3-supply = <&vph_pwr>;
147		vdd_s4-supply = <&vph_pwr>;
148
149		vdd_l1_l19-supply = <&pm8937_s3>;
150		vdd_l2_l23-supply = <&pm8937_s3>;
151		vdd_l3-supply = <&pm8937_s3>;
152		vdd_l4_l5_l6_l7_l16-supply = <&pm8937_s4>;
153		vdd_l8_l11_l12_l17_l22-supply = <&vph_pwr>;
154		vdd_l9_l10_l13_l14_l15_l18-supply = <&vph_pwr>;
155
156		pm8937_s1: s1 {
157			regulator-min-microvolt = <1000000>;
158			regulator-max-microvolt = <1225000>;
159		};
160
161		pm8937_s3: s3 {
162			regulator-min-microvolt = <1300000>;
163			regulator-max-microvolt = <1300000>;
164		};
165
166		pm8937_s4: s4 {
167			regulator-min-microvolt = <2050000>;
168			regulator-max-microvolt = <2050000>;
169		};
170
171		pm8937_l2: l2 {
172			regulator-min-microvolt = <1200000>;
173			regulator-max-microvolt = <1200000>;
174		};
175
176		pm8937_l5: l5 {
177			regulator-min-microvolt = <1800000>;
178			regulator-max-microvolt = <1800000>;
179		};
180
181		pm8937_l6: l6 {
182			regulator-min-microvolt = <1800000>;
183			regulator-max-microvolt = <1800000>;
184		};
185
186		pm8937_l7: l7 {
187			regulator-min-microvolt = <1800000>;
188			regulator-max-microvolt = <1800000>;
189		};
190
191		pm8937_l8: l8 {
192			regulator-min-microvolt = <2850000>;
193			regulator-max-microvolt = <2900000>;
194		};
195
196		pm8937_l9: l9 {
197			regulator-min-microvolt = <3000000>;
198			regulator-max-microvolt = <3300000>;
199		};
200
201		pm8937_l10: l10 {
202			regulator-min-microvolt = <2800000>;
203			regulator-max-microvolt = <3000000>;
204		};
205
206		pm8937_l11: l11 {
207			regulator-min-microvolt = <2950000>;
208			regulator-max-microvolt = <2950000>;
209			regulator-allow-set-load;
210			regulator-system-load = <200000>;
211		};
212
213		pm8937_l12: l12 {
214			regulator-min-microvolt = <1800000>;
215			regulator-max-microvolt = <2950000>;
216		};
217
218		pm8937_l13: l13 {
219			regulator-min-microvolt = <3075000>;
220			regulator-max-microvolt = <3075000>;
221		};
222
223		pm8937_l14: l14 {
224			regulator-min-microvolt = <1800000>;
225			regulator-max-microvolt = <3300000>;
226		};
227
228		pm8937_l15: l15 {
229			regulator-min-microvolt = <1800000>;
230			regulator-max-microvolt = <3300000>;
231		};
232
233		pm8937_l16: l16 {
234			regulator-min-microvolt = <1800000>;
235			regulator-max-microvolt = <1800000>;
236		};
237
238		pm8937_l17: l17 {
239			regulator-min-microvolt = <2800000>;
240			regulator-max-microvolt = <2900000>;
241		};
242
243		pm8937_l19: l19 {
244			regulator-min-microvolt = <1225000>;
245			regulator-max-microvolt = <1350000>;
246		};
247
248		pm8937_l22: l22 {
249			regulator-min-microvolt = <2800000>;
250			regulator-max-microvolt = <2800000>;
251		};
252
253		pm8937_l23: l23 {
254			regulator-min-microvolt = <1200000>;
255			regulator-max-microvolt = <1200000>;
256		};
257	};
258
259};
260
261&sdhc_1 {
262	vmmc-supply = <&pm8937_l8>;
263	vqmmc-supply = <&pm8937_l5>;
264
265	status = "okay";
266};
267
268&sdhc_2 {
269	cd-gpios = <&tlmm 67 GPIO_ACTIVE_LOW>;
270	vmmc-supply = <&pm8937_l11>;
271	vqmmc-supply = <&pm8937_l12>;
272	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
273	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
274	pinctrl-names = "default", "sleep";
275
276	status = "okay";
277};
278
279&sleep_clk {
280	clock-frequency = <32768>;
281};
282
283&tlmm {
284	bq25601_int_default: bq25601-int-default-state {
285		pins = "gpio61";
286		function = "gpio";
287		drive-strength = <2>;
288		bias-pull-up;
289	};
290
291	gpio_keys_default: gpio-keys-default-state {
292		pins = "gpio91";
293		function = "gpio";
294		drive-strength = <2>;
295		bias-pull-up;
296	};
297
298	sdc2_cd_default: sdc2-cd-default-state {
299		pins = "gpio67";
300		function = "gpio";
301		drive-strength = <2>;
302		bias-disable;
303	};
304
305	tsp_int_rst_default: tsp-int-rst-default-state {
306		pins = "gpio64", "gpio65";
307		function = "gpio";
308		drive-strength = <8>;
309		bias-pull-up;
310	};
311};
312
313&wcnss {
314	vddpx-supply = <&pm8937_l5>;
315
316	status = "okay";
317};
318
319&wcnss_iris {
320	compatible = "qcom,wcn3620";
321	vddxo-supply = <&pm8937_l7>;
322	vddrfa-supply = <&pm8937_l19>;
323	vddpa-supply = <&pm8937_l9>;
324	vdddig-supply = <&pm8937_l5>;
325};
326
327&wcnss_mem {
328	status = "okay";
329};
330
331&xo_board {
332	clock-frequency = <19200000>;
333};
334