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		button-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	light-sensor@23 {
155		compatible = "liteon,ltr559";
156		reg = <0x23>;
157		proximity-near-level = <75>;
158
159		interrupt-parent = <&msmgpio>;
160		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
161
162		pinctrl-names = "default";
163		pinctrl-0 = <&light_int_default>;
164
165		vdd-supply = <&pm8916_l17>;
166		vio-supply = <&pm8916_l6>;
167	};
168
169	gyroscope@68 {
170		compatible = "bosch,bmg160";
171		reg = <0x68>;
172
173		interrupt-parent = <&msmgpio>;
174		interrupts = <23 IRQ_TYPE_EDGE_RISING>,
175			     <22 IRQ_TYPE_EDGE_RISING>;
176
177		pinctrl-names = "default";
178		pinctrl-0 = <&gyro_int_default>;
179
180		vdd-supply = <&pm8916_l17>;
181		vddio-supply = <&pm8916_l6>;
182	};
183};
184
185&blsp_i2c5 {
186	status = "okay";
187
188	rmi4@20 {
189		compatible = "syna,rmi4-i2c";
190		reg = <0x20>;
191		#address-cells = <1>;
192		#size-cells = <0>;
193
194		interrupt-parent = <&msmgpio>;
195		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
196
197		vdd-supply = <&reg_ctp>;
198		vio-supply = <&pm8916_l6>;
199
200		pinctrl-names = "default";
201		pinctrl-0 = <&tp_int_default>;
202
203		syna,startup-delay-ms = <10>;
204
205		rmi4-f01@1 {
206			reg = <0x1>;
207			syna,nosleep-mode = <1>; /* Allow sleeping */
208		};
209
210		rmi4-f12@12 {
211			reg = <0x12>;
212			syna,sensor-type = <1>; /* Touchscreen */
213		};
214	};
215};
216
217&blsp1_uart2 {
218	status = "okay";
219};
220
221&pm8916_resin {
222	status = "okay";
223	linux,code = <KEY_VOLUMEDOWN>;
224};
225
226&pm8916_usbin {
227	status = "okay";
228};
229
230&pm8916_vib {
231	status = "okay";
232};
233
234&sdhc_1 {
235	status = "okay";
236
237	pinctrl-names = "default", "sleep";
238	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
239	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
240};
241
242&sdhc_2 {
243	status = "okay";
244
245	pinctrl-names = "default", "sleep";
246	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
247	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
248
249	non-removable;
250};
251
252&usb {
253	status = "okay";
254	dr_mode = "peripheral";
255	extcon = <&pm8916_usbin>;
256};
257
258&usb_hs_phy {
259	extcon = <&pm8916_usbin>;
260};
261
262&wcnss {
263	status = "okay";
264};
265
266&wcnss_iris {
267	compatible = "qcom,wcn3620";
268};
269
270&smd_rpm_regulators {
271	vdd_l1_l2_l3-supply = <&pm8916_s3>;
272	vdd_l4_l5_l6-supply = <&pm8916_s4>;
273	vdd_l7-supply = <&pm8916_s4>;
274
275	s3 {
276		regulator-min-microvolt = <1200000>;
277		regulator-max-microvolt = <1300000>;
278	};
279
280	s4 {
281		regulator-min-microvolt = <1800000>;
282		regulator-max-microvolt = <2100000>;
283	};
284
285	l1 {
286		regulator-min-microvolt = <1225000>;
287		regulator-max-microvolt = <1225000>;
288	};
289
290	l2 {
291		regulator-min-microvolt = <1200000>;
292		regulator-max-microvolt = <1200000>;
293	};
294
295	l4 {
296		regulator-min-microvolt = <2050000>;
297		regulator-max-microvolt = <2050000>;
298	};
299
300	l5 {
301		regulator-min-microvolt = <1800000>;
302		regulator-max-microvolt = <1800000>;
303	};
304
305	l6 {
306		regulator-min-microvolt = <1800000>;
307		regulator-max-microvolt = <1800000>;
308	};
309
310	l7 {
311		regulator-min-microvolt = <1800000>;
312		regulator-max-microvolt = <1800000>;
313	};
314
315	l8 {
316		regulator-min-microvolt = <2850000>;
317		regulator-max-microvolt = <2900000>;
318	};
319
320	l9 {
321		regulator-min-microvolt = <3300000>;
322		regulator-max-microvolt = <3300000>;
323	};
324
325	l10 {
326		regulator-min-microvolt = <2700000>;
327		regulator-max-microvolt = <2800000>;
328	};
329
330	l11 {
331		regulator-min-microvolt = <1800000>;
332		regulator-max-microvolt = <2950000>;
333		regulator-allow-set-load;
334		regulator-system-load = <200000>;
335	};
336
337	l12 {
338		regulator-min-microvolt = <1800000>;
339		regulator-max-microvolt = <2950000>;
340	};
341
342	l13 {
343		regulator-min-microvolt = <3075000>;
344		regulator-max-microvolt = <3075000>;
345	};
346
347	l14 {
348		regulator-min-microvolt = <1800000>;
349		regulator-max-microvolt = <3300000>;
350	};
351
352	l15 {
353		regulator-min-microvolt = <1800000>;
354		regulator-max-microvolt = <3300000>;
355	};
356
357	l16 {
358		regulator-min-microvolt = <1800000>;
359		regulator-max-microvolt = <3300000>;
360	};
361
362	l17 {
363		regulator-min-microvolt = <2850000>;
364		regulator-max-microvolt = <2850000>;
365	};
366
367	l18 {
368		regulator-min-microvolt = <2700000>;
369		regulator-max-microvolt = <2700000>;
370	};
371};
372
373&msmgpio {
374	accel_int_default: accel-int-default-state {
375		pins = "gpio116";
376		function = "gpio";
377
378		drive-strength = <2>;
379		bias-disable;
380	};
381
382	camera_flash_default: camera-flash-default-state {
383		pins = "gpio31", "gpio32";
384		function = "gpio";
385
386		drive-strength = <2>;
387		bias-disable;
388	};
389
390	ctp_pwr_en_default: ctp-pwr-en-default-state {
391		pins = "gpio17";
392		function = "gpio";
393
394		drive-strength = <2>;
395		bias-disable;
396	};
397
398	gpio_keys_default: gpio-keys-default-state {
399		pins = "gpio107";
400		function = "gpio";
401
402		drive-strength = <2>;
403		bias-pull-up;
404	};
405
406	gyro_int_default: gyro-int-default-state {
407		pins = "gpio22", "gpio23";
408		function = "gpio";
409
410		drive-strength = <2>;
411		bias-disable;
412	};
413
414	light_int_default: light-int-default-state {
415		pins = "gpio115";
416		function = "gpio";
417
418		drive-strength = <2>;
419		bias-disable;
420	};
421
422	magn_int_default: magn-int-default-state {
423		pins = "gpio113";
424		function = "gpio";
425
426		drive-strength = <2>;
427		bias-disable;
428	};
429
430	tp_int_default: tp-int-default-state {
431		pins = "gpio13";
432		function = "gpio";
433
434		drive-strength = <2>;
435		bias-disable;
436	};
437};
438