1// SPDX-License-Identifier: BSD-3-Clause
2/dts-v1/;
3
4#include "msm8953.dtsi"
5#include "pm8953.dtsi"
6#include "pmi8950.dtsi"
7#include <dt-bindings/leds/common.h>
8
9/delete-node/ &cont_splash_mem;
10/delete-node/ &qseecom_mem;
11
12/ {
13	model = "Xiaomi Redmi Note 4X";
14	compatible = "xiaomi,mido", "qcom,msm8953";
15	chassis-type = "handset";
16	qcom,msm-id = <293 0>;
17	qcom,board-id = <11 0>;
18
19	aliases {
20		mmc0 = &sdhc_1;
21		mmc1 = &sdhc_2;
22	};
23
24	speaker_amp: audio-amplifier {
25		compatible = "awinic,aw8738";
26		mode-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>;
27		awinic,mode = <5>;
28		sound-name-prefix = "Speaker Amp";
29	};
30
31	chosen {
32		#address-cells = <2>;
33		#size-cells = <2>;
34		ranges;
35
36		framebuffer@90001000 {
37			compatible = "simple-framebuffer";
38			reg = <0 0x90001000 0 (1920 * 1080 * 3)>;
39
40			width = <1080>;
41			height = <1920>;
42			stride = <(1080 * 3)>;
43			format = "r8g8b8";
44
45			power-domains = <&gcc MDSS_GDSC>;
46
47			clocks = <&gcc GCC_MDSS_AHB_CLK>,
48				 <&gcc GCC_MDSS_AXI_CLK>,
49				 <&gcc GCC_MDSS_VSYNC_CLK>,
50				 <&gcc GCC_MDSS_MDP_CLK>,
51				 <&gcc GCC_MDSS_BYTE0_CLK>,
52				 <&gcc GCC_MDSS_PCLK0_CLK>,
53				 <&gcc GCC_MDSS_ESC0_CLK>;
54		};
55	};
56
57	gpio-keys {
58		compatible = "gpio-keys";
59
60		pinctrl-names = "default";
61		pinctrl-0 = <&gpio_key_default>;
62
63		key-volume-up {
64			label = "Volume Up";
65			gpios = <&tlmm 85 GPIO_ACTIVE_LOW>;
66			linux,code = <KEY_VOLUMEUP>;
67		};
68	};
69
70	reserved-memory {
71		qseecom_mem: qseecom@84a00000 {
72			reg = <0x0 0x84a00000 0x0 0x1900000>;
73			no-map;
74		};
75
76		cont_splash_mem: cont-splash@90001000 {
77			reg = <0x0 0x90001000 0x0 (1080 * 1920 * 3)>;
78			no-map;
79		};
80
81		ramoops@9ff00000 {
82			compatible = "ramoops";
83			reg = <0x0 0x9ff00000 0x0 0x00100000>;
84			console-size = <0x100000>;
85		};
86	};
87
88	vph_pwr: vph-pwr-regulator {
89		compatible = "regulator-fixed";
90		regulator-name = "vph_pwr";
91		regulator-min-microvolt = <3700000>;
92		regulator-max-microvolt = <3700000>;
93		regulator-always-on;
94		regulator-boot-on;
95	};
96};
97
98&hsusb_phy {
99	vdd-supply = <&pm8953_l3>;
100	vdda-pll-supply = <&pm8953_l7>;
101	vdda-phy-dpdm-supply = <&pm8953_l13>;
102
103	status = "okay";
104};
105
106&i2c_2 {
107	status = "okay";
108
109	led-controller@45 {
110		compatible = "awinic,aw2013";
111		reg = <0x45>;
112
113		vcc-supply = <&pm8953_l10>;
114
115		#address-cells = <1>;
116		#size-cells = <0>;
117
118		led@0 {
119			reg = <0>;
120			color = <LED_COLOR_ID_RED>;
121			function = LED_FUNCTION_INDICATOR;
122			led-max-microamp = <5000>;
123		};
124
125		led@1 {
126			reg = <1>;
127			color = <LED_COLOR_ID_GREEN>;
128			function = LED_FUNCTION_INDICATOR;
129			led-max-microamp = <5000>;
130		};
131
132		led@2 {
133			reg = <2>;
134			color = <LED_COLOR_ID_BLUE>;
135			function = LED_FUNCTION_INDICATOR;
136			led-max-microamp = <5000>;
137		};
138	};
139};
140
141&i2c_3 {
142	status = "okay";
143
144	touchscreen@38 {
145		compatible = "edt,edt-ft5406";
146		reg = <0x38>;
147
148		interrupt-parent = <&tlmm>;
149		interrupts = <65 IRQ_TYPE_EDGE_FALLING>;
150
151		pinctrl-names = "default";
152		pinctrl-0 = <&ts_int_active>;
153
154		reset-gpios = <&tlmm 64 GPIO_ACTIVE_LOW>;
155
156		vcc-supply = <&pm8953_l10>;
157
158		touchscreen-size-x = <1080>;
159		touchscreen-size-y = <1920>;
160	};
161};
162
163&pm8953_resin {
164	linux,code = <KEY_VOLUMEDOWN>;
165	status = "okay";
166};
167
168&rpm_requests {
169	regulators {
170		compatible = "qcom,rpm-pm8953-regulators";
171
172		vdd_s1-supply = <&vph_pwr>;
173		vdd_s2-supply = <&vph_pwr>;
174		vdd_s3-supply = <&vph_pwr>;
175		vdd_s4-supply = <&vph_pwr>;
176		vdd_s5-supply = <&vph_pwr>;
177		vdd_s6-supply = <&vph_pwr>;
178		vdd_s7-supply = <&vph_pwr>;
179		vdd_l1-supply = <&pm8953_s3>;
180		vdd_l2_l3-supply = <&pm8953_s3>;
181		vdd_l4_l5_l6_l7_l16_l19-supply = <&pm8953_s4>;
182		vdd_l8_l11_l12_l13_l14_l15-supply = <&vph_pwr>;
183		vdd_l9_l10_l17_l18_l22-supply = <&vph_pwr>;
184		vdd_l23-supply = <&pm8953_s3>;
185
186		pm8953_s1: s1 {
187			regulator-min-microvolt = <863000>;
188			regulator-max-microvolt = <1152000>;
189		};
190
191		pm8953_s3: s3 {
192			regulator-min-microvolt = <1224000>;
193			regulator-max-microvolt = <1224000>;
194		};
195
196		pm8953_s4: s4 {
197			regulator-min-microvolt = <1896000>;
198			regulator-max-microvolt = <2048000>;
199		};
200
201		pm8953_l1: l1 {
202			regulator-min-microvolt = <1000000>;
203			regulator-max-microvolt = <1100000>;
204		};
205
206		pm8953_l2: l2 {
207			regulator-min-microvolt = <975000>;
208			regulator-max-microvolt = <1225000>;
209		};
210
211		pm8953_l3: l3 {
212			regulator-min-microvolt = <925000>;
213			regulator-max-microvolt = <925000>;
214			regulator-allow-set-load;
215		};
216
217		pm8953_l5: l5 {
218			regulator-min-microvolt = <1800000>;
219			regulator-max-microvolt = <1800000>;
220		};
221
222		pm8953_l6: l6 {
223			regulator-min-microvolt = <1800000>;
224			regulator-max-microvolt = <1800000>;
225			regulator-always-on;
226		};
227
228		pm8953_l7: l7 {
229			regulator-min-microvolt = <1800000>;
230			regulator-max-microvolt = <1900000>;
231		};
232
233		pm8953_l8: l8 {
234			regulator-min-microvolt = <2900000>;
235			regulator-max-microvolt = <2900000>;
236		};
237
238		pm8953_l9: l9 {
239			regulator-min-microvolt = <3000000>;
240			regulator-max-microvolt = <3300000>;
241		};
242
243		pm8953_l10: l10 {
244			regulator-min-microvolt = <2850000>;
245			regulator-max-microvolt = <2850000>;
246			regulator-always-on;
247		};
248
249		pm8953_l11: l11 {
250			regulator-min-microvolt = <2950000>;
251			regulator-max-microvolt = <2950000>;
252		};
253
254		pm8953_l12: l12 {
255			regulator-min-microvolt = <1800000>;
256			regulator-max-microvolt = <2950000>;
257		};
258
259		pm8953_l13: l13 {
260			regulator-min-microvolt = <3125000>;
261			regulator-max-microvolt = <3125000>;
262		};
263
264		pm8953_l16: l16 {
265			regulator-min-microvolt = <1800000>;
266			regulator-max-microvolt = <1800000>;
267		};
268
269		pm8953_l17: l17 {
270			regulator-min-microvolt = <2850000>;
271			regulator-max-microvolt = <2850000>;
272		};
273
274		pm8953_l19: l19 {
275			regulator-min-microvolt = <1200000>;
276			regulator-max-microvolt = <1350000>;
277		};
278
279		pm8953_l22: l22 {
280			regulator-min-microvolt = <2800000>;
281			regulator-max-microvolt = <2850000>;
282			regulator-always-on;
283		};
284
285		pm8953_l23: l23 {
286			regulator-min-microvolt = <975000>;
287			regulator-max-microvolt = <1225000>;
288		};
289	};
290};
291
292&sdhc_1 {
293	vmmc-supply = <&pm8953_l8>;
294	vqmmc-supply = <&pm8953_l5>;
295
296	status = "okay";
297};
298
299&sdhc_2 {
300	vmmc-supply = <&pm8953_l11>;
301	vqmmc-supply = <&pm8953_l12>;
302
303	cd-gpios = <&tlmm 133 GPIO_ACTIVE_LOW>;
304
305	pinctrl-names = "default", "sleep";
306	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
307	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
308
309	status = "okay";
310};
311
312&tlmm {
313	gpio-reserved-ranges = <0 4>, <135 4>;
314
315	ts_int_active: ts-int-active-state {
316		pins = "gpio65";
317		function = "gpio";
318		drive-strength = <8>;
319		bias-pull-up;
320	};
321};
322
323&usb3 {
324	status = "okay";
325};
326
327&usb3_dwc3 {
328	dr_mode = "peripheral";
329};
330