1// SPDX-License-Identifier: GPL-2.0-only
2
3/dts-v1/;
4
5#include "msm8916-pm8916.dtsi"
6#include <dt-bindings/gpio/gpio.h>
7#include <dt-bindings/input/input.h>
8#include <dt-bindings/interrupt-controller/irq.h>
9#include <dt-bindings/leds/common.h>
10
11/ {
12	model = "Longcheer L8150";
13	compatible = "longcheer,l8150", "qcom,msm8916-v1-qrd/9-v1", "qcom,msm8916";
14
15	aliases {
16		serial0 = &blsp1_uart2;
17	};
18
19	chosen {
20		stdout-path = "serial0";
21	};
22
23	reserved-memory {
24		// wcnss.mdt is not relocatable, so it must be loaded at 0x8b600000
25		/delete-node/ wcnss@89300000;
26
27		wcnss_mem: wcnss@8b600000 {
28			reg = <0x0 0x8b600000 0x0 0x600000>;
29			no-map;
30		};
31	};
32
33	// FIXME: Use extcon device provided by charger driver when available
34	usb_vbus: usb-vbus {
35		compatible = "linux,extcon-usb-gpio";
36		vbus-gpio = <&msmgpio 62 GPIO_ACTIVE_HIGH>;
37		pinctrl-names = "default";
38		pinctrl-0 = <&usb_vbus_default>;
39	};
40
41	gpio-keys {
42		compatible = "gpio-keys";
43
44		pinctrl-names = "default";
45		pinctrl-0 = <&gpio_keys_default>;
46
47		label = "GPIO Buttons";
48
49		volume-up {
50			label = "Volume Up";
51			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
52			linux,code = <KEY_VOLUMEUP>;
53		};
54	};
55
56	reg_ctp: regulator-ctp {
57		compatible = "regulator-fixed";
58		regulator-name = "ctp";
59
60		regulator-min-microvolt = <2800000>;
61		regulator-max-microvolt = <2800000>;
62
63		gpio = <&msmgpio 17 GPIO_ACTIVE_HIGH>;
64		enable-active-high;
65
66		pinctrl-names = "default";
67		pinctrl-0 = <&ctp_pwr_en_default>;
68	};
69
70	flash-led-controller {
71		compatible = "sgmicro,sgm3140";
72		flash-gpios = <&msmgpio 31 GPIO_ACTIVE_HIGH>;
73		enable-gpios = <&msmgpio 32 GPIO_ACTIVE_HIGH>;
74
75		pinctrl-names = "default";
76		pinctrl-0 = <&camera_flash_default>;
77
78		flash_led: led {
79			function = LED_FUNCTION_FLASH;
80			color = <LED_COLOR_ID_WHITE>;
81			flash-max-timeout-us = <250000>;
82		};
83	};
84};
85
86&blsp_i2c1 {
87	status = "okay";
88
89	led-controller@45 {
90		compatible = "awinic,aw2013";
91		reg = <0x45>;
92		#address-cells = <1>;
93		#size-cells = <0>;
94
95		vcc-supply = <&pm8916_l17>;
96
97		led@0 {
98			reg = <0>;
99			led-max-microamp = <5000>;
100			function = LED_FUNCTION_INDICATOR;
101			color = <LED_COLOR_ID_RED>;
102		};
103
104		led@1 {
105			reg = <1>;
106			led-max-microamp = <5000>;
107			function = LED_FUNCTION_INDICATOR;
108			color = <LED_COLOR_ID_GREEN>;
109		};
110
111		led@2 {
112			reg = <2>;
113			led-max-microamp = <5000>;
114			function = LED_FUNCTION_INDICATOR;
115			color = <LED_COLOR_ID_BLUE>;
116		};
117	};
118};
119
120&blsp_i2c2 {
121	status = "okay";
122
123	accelerometer@10 {
124		compatible = "bosch,bmc150_accel";
125		reg = <0x10>;
126
127		vdd-supply = <&pm8916_l17>;
128		vddio-supply = <&pm8916_l6>;
129
130		mount-matrix = "0", "1", "0",
131			      "-1", "0", "0",
132			       "0", "0", "1";
133	};
134
135	magnetometer@12 {
136		compatible = "bosch,bmc150_magn";
137		reg = <0x12>;
138
139		vdd-supply = <&pm8916_l17>;
140		vddio-supply = <&pm8916_l6>;
141	};
142
143	gyroscope@68 {
144		compatible = "bosch,bmg160";
145		reg = <0x68>;
146
147		interrupt-parent = <&msmgpio>;
148		interrupts = <23 IRQ_TYPE_EDGE_RISING>;
149
150		pinctrl-names = "default";
151		pinctrl-0 = <&gyro_int_default>;
152
153		vdd-supply = <&pm8916_l17>;
154		vddio-supply = <&pm8916_l6>;
155	};
156};
157
158&blsp_i2c5 {
159	status = "okay";
160
161	rmi4@20 {
162		compatible = "syna,rmi4-i2c";
163		reg = <0x20>;
164		#address-cells = <1>;
165		#size-cells = <0>;
166
167		interrupt-parent = <&msmgpio>;
168		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
169
170		vdd-supply = <&reg_ctp>;
171		vio-supply = <&pm8916_l6>;
172
173		pinctrl-names = "default";
174		pinctrl-0 = <&tp_int_default>;
175
176		syna,startup-delay-ms = <10>;
177
178		rmi4-f01@1 {
179			reg = <0x1>;
180			syna,nosleep-mode = <1>; // Allow sleeping
181		};
182
183		rmi4-f12@12 {
184			reg = <0x12>;
185			syna,sensor-type = <1>; // Touchscreen
186		};
187	};
188};
189
190&blsp1_uart2 {
191	status = "okay";
192};
193
194&pm8916_resin {
195	status = "okay";
196	linux,code = <KEY_VOLUMEDOWN>;
197};
198
199&pm8916_vib {
200	status = "okay";
201};
202
203&pronto {
204	status = "okay";
205};
206
207&sdhc_1 {
208	status = "okay";
209
210	pinctrl-names = "default", "sleep";
211	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
212	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
213};
214
215&sdhc_2 {
216	status = "okay";
217
218	pinctrl-names = "default", "sleep";
219	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
220	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
221
222	non-removable;
223};
224
225&usb {
226	status = "okay";
227	dr_mode = "peripheral";
228	extcon = <&usb_vbus>;
229};
230
231&usb_hs_phy {
232	extcon = <&usb_vbus>;
233};
234
235&smd_rpm_regulators {
236	vdd_l1_l2_l3-supply = <&pm8916_s3>;
237	vdd_l4_l5_l6-supply = <&pm8916_s4>;
238	vdd_l7-supply = <&pm8916_s4>;
239
240	s3 {
241		regulator-min-microvolt = <1200000>;
242		regulator-max-microvolt = <1300000>;
243	};
244
245	s4 {
246		regulator-min-microvolt = <1800000>;
247		regulator-max-microvolt = <2100000>;
248	};
249
250	l1 {
251		regulator-min-microvolt = <1225000>;
252		regulator-max-microvolt = <1225000>;
253	};
254
255	l2 {
256		regulator-min-microvolt = <1200000>;
257		regulator-max-microvolt = <1200000>;
258	};
259
260	l4 {
261		regulator-min-microvolt = <2050000>;
262		regulator-max-microvolt = <2050000>;
263	};
264
265	l5 {
266		regulator-min-microvolt = <1800000>;
267		regulator-max-microvolt = <1800000>;
268	};
269
270	l6 {
271		regulator-min-microvolt = <1800000>;
272		regulator-max-microvolt = <1800000>;
273	};
274
275	l7 {
276		regulator-min-microvolt = <1800000>;
277		regulator-max-microvolt = <1800000>;
278	};
279
280	l8 {
281		regulator-min-microvolt = <2850000>;
282		regulator-max-microvolt = <2900000>;
283	};
284
285	l9 {
286		regulator-min-microvolt = <3300000>;
287		regulator-max-microvolt = <3300000>;
288	};
289
290	l10 {
291		regulator-min-microvolt = <2700000>;
292		regulator-max-microvolt = <2800000>;
293	};
294
295	l11 {
296		regulator-min-microvolt = <1800000>;
297		regulator-max-microvolt = <2950000>;
298		regulator-allow-set-load;
299		regulator-system-load = <200000>;
300	};
301
302	l12 {
303		regulator-min-microvolt = <1800000>;
304		regulator-max-microvolt = <2950000>;
305	};
306
307	l13 {
308		regulator-min-microvolt = <3075000>;
309		regulator-max-microvolt = <3075000>;
310	};
311
312	l14 {
313		regulator-min-microvolt = <1800000>;
314		regulator-max-microvolt = <3300000>;
315	};
316
317	l15 {
318		regulator-min-microvolt = <1800000>;
319		regulator-max-microvolt = <3300000>;
320	};
321
322	l16 {
323		regulator-min-microvolt = <1800000>;
324		regulator-max-microvolt = <3300000>;
325	};
326
327	l17 {
328		regulator-min-microvolt = <2850000>;
329		regulator-max-microvolt = <2850000>;
330	};
331
332	l18 {
333		regulator-min-microvolt = <2700000>;
334		regulator-max-microvolt = <2700000>;
335	};
336};
337
338&msmgpio {
339	camera_flash_default: camera-flash-default {
340		pins = "gpio31", "gpio32";
341		function = "gpio";
342
343		drive-strength = <2>;
344		bias-disable;
345	};
346
347	ctp_pwr_en_default: ctp-pwr-en-default {
348		pins = "gpio17";
349		function = "gpio";
350
351		drive-strength = <2>;
352		bias-disable;
353	};
354
355	gpio_keys_default: gpio-keys-default {
356		pins = "gpio107";
357		function = "gpio";
358
359		drive-strength = <2>;
360		bias-pull-up;
361	};
362
363	gyro_int_default: gyro-int-default {
364		pins = "gpio23";
365		function = "gpio";
366
367		drive-strength = <2>;
368		bias-disable;
369	};
370
371	tp_int_default: tp-int-default {
372		pins = "gpio13";
373		function = "gpio";
374
375		drive-strength = <2>;
376		bias-disable;
377	};
378
379	usb_vbus_default: usb-vbus-default {
380		pins = "gpio62";
381		function = "gpio";
382
383		bias-pull-up;
384	};
385};
386