1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (C) 2020 Stephan Gerhold
3
4/dts-v1/;
5
6#include "msm8916-pm8916.dtsi"
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/leds/common.h>
10
11/ {
12	model = "Xiaomi Redmi 2 (Wingtech WT88047)";
13	compatible = "wingtech,wt88047", "qcom,msm8916";
14	chassis-type = "handset";
15
16	aliases {
17		serial0 = &blsp1_uart2;
18	};
19
20	chosen {
21		stdout-path = "serial0";
22	};
23
24	gpio-keys {
25		compatible = "gpio-keys";
26
27		pinctrl-names = "default";
28		pinctrl-0 = <&gpio_keys_default>;
29
30		label = "GPIO Buttons";
31
32		volume-up {
33			label = "Volume Up";
34			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
35			linux,code = <KEY_VOLUMEUP>;
36		};
37	};
38
39	usb_id: usb-id {
40		compatible = "linux,extcon-usb-gpio";
41		id-gpio = <&msmgpio 110 GPIO_ACTIVE_HIGH>;
42		pinctrl-names = "default";
43		pinctrl-0 = <&usb_id_default>;
44	};
45};
46
47&blsp_i2c2 {
48	status = "okay";
49
50	imu@68 {
51		compatible = "invensense,mpu6880";
52		reg = <0x68>;
53
54		interrupt-parent = <&msmgpio>;
55		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
56
57		vdd-supply = <&pm8916_l17>;
58		vddio-supply = <&pm8916_l6>;
59
60		pinctrl-names = "default";
61		pinctrl-0 = <&imu_default>;
62
63		mount-matrix = "1",  "0", "0",
64			       "0", "-1", "0",
65			       "0",  "0", "1";
66	};
67};
68
69&blsp_i2c5 {
70	status = "okay";
71
72	touchscreen@38 {
73		/* Likely some other model but works just fine with this one */
74		compatible = "edt,edt-ft5506";
75		reg = <0x38>;
76
77		interrupt-parent = <&msmgpio>;
78		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
79
80		reset-gpios = <&msmgpio 12 GPIO_ACTIVE_LOW>;
81
82		vcc-supply = <&pm8916_l17>;
83		iovcc-supply = <&pm8916_l6>;
84
85		touchscreen-size-x = <720>;
86		touchscreen-size-y = <1280>;
87
88		pinctrl-names = "default";
89		pinctrl-0 = <&touchscreen_default>;
90	};
91};
92
93&blsp_i2c6 {
94	status = "okay";
95
96	led-controller@45 {
97		compatible = "awinic,aw2013";
98		reg = <0x45>;
99		#address-cells = <1>;
100		#size-cells = <0>;
101
102		vcc-supply = <&pm8916_l16>;
103
104		led@0 {
105			reg = <0>;
106			led-max-microamp = <15000>;
107			function = LED_FUNCTION_INDICATOR;
108			color = <LED_COLOR_ID_RED>;
109		};
110
111		led@1 {
112			reg = <1>;
113			led-max-microamp = <15000>;
114			function = LED_FUNCTION_INDICATOR;
115			color = <LED_COLOR_ID_GREEN>;
116		};
117
118		led@2 {
119			reg = <2>;
120			led-max-microamp = <15000>;
121			function = LED_FUNCTION_INDICATOR;
122			color = <LED_COLOR_ID_BLUE>;
123		};
124	};
125};
126
127&blsp1_uart2 {
128	status = "okay";
129};
130
131&pm8916_resin {
132	status = "okay";
133	linux,code = <KEY_VOLUMEDOWN>;
134};
135
136&pm8916_vib {
137	status = "okay";
138};
139
140&pronto {
141	status = "okay";
142};
143
144&sdhc_1 {
145	status = "okay";
146
147	pinctrl-names = "default", "sleep";
148	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
149	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
150};
151
152&sdhc_2 {
153	status = "okay";
154
155	pinctrl-names = "default", "sleep";
156	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
157	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
158
159	non-removable;
160};
161
162&usb {
163	status = "okay";
164	extcon = <&usb_id>, <&usb_id>;
165};
166
167&usb_hs_phy {
168	extcon = <&usb_id>;
169};
170
171&smd_rpm_regulators {
172	vdd_l1_l2_l3-supply = <&pm8916_s3>;
173	vdd_l4_l5_l6-supply = <&pm8916_s4>;
174	vdd_l7-supply = <&pm8916_s4>;
175
176	s3 {
177		regulator-min-microvolt = <1200000>;
178		regulator-max-microvolt = <1300000>;
179	};
180
181	s4 {
182		regulator-min-microvolt = <1800000>;
183		regulator-max-microvolt = <2100000>;
184	};
185
186	l1 {
187		regulator-min-microvolt = <1225000>;
188		regulator-max-microvolt = <1225000>;
189	};
190
191	l2 {
192		regulator-min-microvolt = <1200000>;
193		regulator-max-microvolt = <1200000>;
194	};
195
196	l4 {
197		regulator-min-microvolt = <2050000>;
198		regulator-max-microvolt = <2050000>;
199	};
200
201	l5 {
202		regulator-min-microvolt = <1800000>;
203		regulator-max-microvolt = <1800000>;
204	};
205
206	l6 {
207		regulator-min-microvolt = <1800000>;
208		regulator-max-microvolt = <1800000>;
209	};
210
211	l7 {
212		regulator-min-microvolt = <1800000>;
213		regulator-max-microvolt = <1800000>;
214	};
215
216	l8 {
217		regulator-min-microvolt = <2850000>;
218		regulator-max-microvolt = <2900000>;
219	};
220
221	l9 {
222		regulator-min-microvolt = <3300000>;
223		regulator-max-microvolt = <3300000>;
224	};
225
226	l10 {
227		regulator-min-microvolt = <2700000>;
228		regulator-max-microvolt = <2800000>;
229	};
230
231	l11 {
232		regulator-min-microvolt = <2950000>;
233		regulator-max-microvolt = <2950000>;
234		regulator-allow-set-load;
235		regulator-system-load = <200000>;
236	};
237
238	l12 {
239		regulator-min-microvolt = <1800000>;
240		regulator-max-microvolt = <2950000>;
241	};
242
243	l13 {
244		regulator-min-microvolt = <3075000>;
245		regulator-max-microvolt = <3075000>;
246	};
247
248	l14 {
249		regulator-min-microvolt = <1800000>;
250		regulator-max-microvolt = <3300000>;
251	};
252
253	l15 {
254		regulator-min-microvolt = <1800000>;
255		regulator-max-microvolt = <3300000>;
256	};
257
258	l16 {
259		regulator-min-microvolt = <2800000>;
260		regulator-max-microvolt = <3300000>;
261	};
262
263	l17 {
264		regulator-min-microvolt = <2850000>;
265		regulator-max-microvolt = <2850000>;
266	};
267
268	l18 {
269		regulator-min-microvolt = <2700000>;
270		regulator-max-microvolt = <2700000>;
271	};
272};
273
274&msmgpio {
275	gpio_keys_default: gpio-keys-default {
276		pins = "gpio107";
277		function = "gpio";
278
279		drive-strength = <2>;
280		bias-pull-up;
281	};
282
283	imu_default: imu-default {
284		pins = "gpio115";
285		function = "gpio";
286
287		drive-strength = <2>;
288		bias-disable;
289	};
290
291	touchscreen_default: touchscreen-default {
292		pins = "gpio13";
293		function = "gpio";
294
295		drive-strength = <2>;
296		bias-pull-up;
297
298		reset {
299			pins = "gpio12";
300			function = "gpio";
301
302			drive-strength = <2>;
303			bias-disable;
304		};
305	};
306
307	usb_id_default: usb-id-default {
308		pins = "gpio110";
309		function = "gpio";
310
311		drive-strength = <8>;
312		bias-pull-up;
313	};
314};
315