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