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