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		vio-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	pinctrl-names = "default", "sleep";
247	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
248	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
249};
250
251&sdhc_2 {
252	status = "okay";
253
254	pinctrl-names = "default", "sleep";
255	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
256	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
257
258	non-removable;
259};
260
261&usb {
262	status = "okay";
263	dr_mode = "peripheral";
264	extcon = <&pm8916_usbin>;
265};
266
267&usb_hs_phy {
268	extcon = <&pm8916_usbin>;
269};
270
271&wcnss {
272	status = "okay";
273};
274
275&wcnss_iris {
276	compatible = "qcom,wcn3620";
277};
278
279&tlmm {
280	accel_int_default: accel-int-default-state {
281		pins = "gpio116";
282		function = "gpio";
283
284		drive-strength = <2>;
285		bias-disable;
286	};
287
288	camera_flash_default: camera-flash-default-state {
289		pins = "gpio31", "gpio32";
290		function = "gpio";
291
292		drive-strength = <2>;
293		bias-disable;
294	};
295
296	ctp_pwr_en_default: ctp-pwr-en-default-state {
297		pins = "gpio17";
298		function = "gpio";
299
300		drive-strength = <2>;
301		bias-disable;
302	};
303
304	gpio_keys_default: gpio-keys-default-state {
305		pins = "gpio107";
306		function = "gpio";
307
308		drive-strength = <2>;
309		bias-pull-up;
310	};
311
312	gyro_int_default: gyro-int-default-state {
313		pins = "gpio22", "gpio23";
314		function = "gpio";
315
316		drive-strength = <2>;
317		bias-disable;
318	};
319
320	light_int_default: light-int-default-state {
321		pins = "gpio115";
322		function = "gpio";
323
324		drive-strength = <2>;
325		bias-disable;
326	};
327
328	magn_int_default: magn-int-default-state {
329		pins = "gpio113";
330		function = "gpio";
331
332		drive-strength = <2>;
333		bias-disable;
334	};
335
336	tp_int_default: tp-int-default-state {
337		pins = "gpio13";
338		function = "gpio";
339
340		drive-strength = <2>;
341		bias-disable;
342	};
343};
344