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		mmc0 = &sdhc_1; /* eMMC */
18		mmc1 = &sdhc_2; /* SD card */
19		serial0 = &blsp_uart2;
20	};
21
22	chosen {
23		stdout-path = "serial0";
24	};
25
26	reserved-memory {
27		/* wcnss.mdt is not relocatable, so it must be loaded at 0x8b600000 */
28		/delete-node/ wcnss@89300000;
29
30		wcnss_mem: wcnss@8b600000 {
31			reg = <0x0 0x8b600000 0x0 0x600000>;
32			no-map;
33		};
34	};
35
36	gpio-keys {
37		compatible = "gpio-keys";
38
39		pinctrl-names = "default";
40		pinctrl-0 = <&gpio_keys_default>;
41
42		label = "GPIO Buttons";
43
44		button-volume-up {
45			label = "Volume Up";
46			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
47			linux,code = <KEY_VOLUMEUP>;
48		};
49	};
50
51	reg_ctp: regulator-ctp {
52		compatible = "regulator-fixed";
53		regulator-name = "ctp";
54
55		regulator-min-microvolt = <2800000>;
56		regulator-max-microvolt = <2800000>;
57
58		gpio = <&tlmm 17 GPIO_ACTIVE_HIGH>;
59		enable-active-high;
60
61		pinctrl-names = "default";
62		pinctrl-0 = <&ctp_pwr_en_default>;
63	};
64
65	flash-led-controller {
66		compatible = "sgmicro,sgm3140";
67		flash-gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
68		enable-gpios = <&tlmm 32 GPIO_ACTIVE_HIGH>;
69
70		pinctrl-names = "default";
71		pinctrl-0 = <&camera_flash_default>;
72
73		flash_led: led {
74			function = LED_FUNCTION_FLASH;
75			color = <LED_COLOR_ID_WHITE>;
76			flash-max-timeout-us = <250000>;
77		};
78	};
79};
80
81&blsp_i2c1 {
82	status = "okay";
83
84	led-controller@45 {
85		compatible = "awinic,aw2013";
86		reg = <0x45>;
87		#address-cells = <1>;
88		#size-cells = <0>;
89
90		vcc-supply = <&pm8916_l17>;
91
92		led@0 {
93			reg = <0>;
94			led-max-microamp = <5000>;
95			function = LED_FUNCTION_INDICATOR;
96			color = <LED_COLOR_ID_RED>;
97		};
98
99		led@1 {
100			reg = <1>;
101			led-max-microamp = <5000>;
102			function = LED_FUNCTION_INDICATOR;
103			color = <LED_COLOR_ID_GREEN>;
104		};
105
106		led@2 {
107			reg = <2>;
108			led-max-microamp = <5000>;
109			function = LED_FUNCTION_INDICATOR;
110			color = <LED_COLOR_ID_BLUE>;
111		};
112	};
113};
114
115&blsp_i2c2 {
116	status = "okay";
117
118	accelerometer@10 {
119		compatible = "bosch,bmc156_accel";
120		reg = <0x10>;
121
122		/*
123		 * For some reason the interrupt line is usually not connected
124		 * to the BMC156. However, there are two pads next to the chip
125		 * that can be shorted to make it work if needed.
126		 *
127		 * interrupt-parent = <&tlmm>;
128		 * interrupts = <116 IRQ_TYPE_EDGE_RISING>;
129		 */
130
131		pinctrl-names = "default";
132		pinctrl-0 = <&accel_int_default>;
133
134		vdd-supply = <&pm8916_l17>;
135		vddio-supply = <&pm8916_l6>;
136
137		mount-matrix = "0", "1", "0",
138			      "-1", "0", "0",
139			       "0", "0", "1";
140	};
141
142	magnetometer@12 {
143		compatible = "bosch,bmc156_magn";
144		reg = <0x12>;
145
146		interrupt-parent = <&tlmm>;
147		interrupts = <113 IRQ_TYPE_EDGE_RISING>;
148
149		pinctrl-names = "default";
150		pinctrl-0 = <&magn_int_default>;
151
152		vdd-supply = <&pm8916_l17>;
153		vddio-supply = <&pm8916_l6>;
154	};
155
156	light-sensor@23 {
157		compatible = "liteon,ltr559";
158		reg = <0x23>;
159		proximity-near-level = <75>;
160
161		interrupt-parent = <&tlmm>;
162		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
163
164		pinctrl-names = "default";
165		pinctrl-0 = <&light_int_default>;
166
167		vdd-supply = <&pm8916_l17>;
168		vddio-supply = <&pm8916_l6>;
169	};
170
171	gyroscope@68 {
172		compatible = "bosch,bmg160";
173		reg = <0x68>;
174
175		interrupt-parent = <&tlmm>;
176		interrupts = <23 IRQ_TYPE_EDGE_RISING>,
177			     <22 IRQ_TYPE_EDGE_RISING>;
178
179		pinctrl-names = "default";
180		pinctrl-0 = <&gyro_int_default>;
181
182		vdd-supply = <&pm8916_l17>;
183		vddio-supply = <&pm8916_l6>;
184	};
185};
186
187&blsp_i2c5 {
188	status = "okay";
189
190	rmi4@20 {
191		compatible = "syna,rmi4-i2c";
192		reg = <0x20>;
193		#address-cells = <1>;
194		#size-cells = <0>;
195
196		interrupt-parent = <&tlmm>;
197		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
198
199		vdd-supply = <&reg_ctp>;
200		vio-supply = <&pm8916_l6>;
201
202		pinctrl-names = "default";
203		pinctrl-0 = <&tp_int_default>;
204
205		syna,startup-delay-ms = <10>;
206
207		rmi4-f01@1 {
208			reg = <0x1>;
209			syna,nosleep-mode = <1>; /* Allow sleeping */
210		};
211
212		rmi4-f12@12 {
213			reg = <0x12>;
214			syna,sensor-type = <1>; /* Touchscreen */
215		};
216	};
217};
218
219&blsp_uart2 {
220	status = "okay";
221};
222
223&pm8916_resin {
224	status = "okay";
225	linux,code = <KEY_VOLUMEDOWN>;
226};
227
228&pm8916_rpm_regulators {
229	pm8916_l17: l17 {
230		regulator-min-microvolt = <2850000>;
231		regulator-max-microvolt = <2850000>;
232	};
233};
234
235&pm8916_usbin {
236	status = "okay";
237};
238
239&pm8916_vib {
240	status = "okay";
241};
242
243&sdhc_1 {
244	status = "okay";
245};
246
247&sdhc_2 {
248	status = "okay";
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&tlmm {
271	accel_int_default: accel-int-default-state {
272		pins = "gpio116";
273		function = "gpio";
274
275		drive-strength = <2>;
276		bias-disable;
277	};
278
279	camera_flash_default: camera-flash-default-state {
280		pins = "gpio31", "gpio32";
281		function = "gpio";
282
283		drive-strength = <2>;
284		bias-disable;
285	};
286
287	ctp_pwr_en_default: ctp-pwr-en-default-state {
288		pins = "gpio17";
289		function = "gpio";
290
291		drive-strength = <2>;
292		bias-disable;
293	};
294
295	gpio_keys_default: gpio-keys-default-state {
296		pins = "gpio107";
297		function = "gpio";
298
299		drive-strength = <2>;
300		bias-pull-up;
301	};
302
303	gyro_int_default: gyro-int-default-state {
304		pins = "gpio22", "gpio23";
305		function = "gpio";
306
307		drive-strength = <2>;
308		bias-disable;
309	};
310
311	light_int_default: light-int-default-state {
312		pins = "gpio115";
313		function = "gpio";
314
315		drive-strength = <2>;
316		bias-disable;
317	};
318
319	magn_int_default: magn-int-default-state {
320		pins = "gpio113";
321		function = "gpio";
322
323		drive-strength = <2>;
324		bias-disable;
325	};
326
327	tp_int_default: tp-int-default-state {
328		pins = "gpio13";
329		function = "gpio";
330
331		drive-strength = <2>;
332		bias-disable;
333	};
334};
335