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		vio-supply = <&pm8916_l6>;
92
93		led@0 {
94			reg = <0>;
95			led-max-microamp = <5000>;
96			function = LED_FUNCTION_INDICATOR;
97			color = <LED_COLOR_ID_RED>;
98		};
99
100		led@1 {
101			reg = <1>;
102			led-max-microamp = <5000>;
103			function = LED_FUNCTION_INDICATOR;
104			color = <LED_COLOR_ID_GREEN>;
105		};
106
107		led@2 {
108			reg = <2>;
109			led-max-microamp = <5000>;
110			function = LED_FUNCTION_INDICATOR;
111			color = <LED_COLOR_ID_BLUE>;
112		};
113	};
114};
115
116&blsp_i2c2 {
117	status = "okay";
118
119	accelerometer@10 {
120		compatible = "bosch,bmc156_accel";
121		reg = <0x10>;
122
123		/*
124		 * For some reason the interrupt line is usually not connected
125		 * to the BMC156. However, there are two pads next to the chip
126		 * that can be shorted to make it work if needed.
127		 *
128		 * interrupt-parent = <&tlmm>;
129		 * interrupts = <116 IRQ_TYPE_EDGE_RISING>;
130		 */
131
132		pinctrl-names = "default";
133		pinctrl-0 = <&accel_int_default>;
134
135		vdd-supply = <&pm8916_l17>;
136		vddio-supply = <&pm8916_l6>;
137
138		mount-matrix = "0", "1", "0",
139			      "-1", "0", "0",
140			       "0", "0", "1";
141	};
142
143	magnetometer@12 {
144		compatible = "bosch,bmc156_magn";
145		reg = <0x12>;
146
147		interrupt-parent = <&tlmm>;
148		interrupts = <113 IRQ_TYPE_EDGE_RISING>;
149
150		pinctrl-names = "default";
151		pinctrl-0 = <&magn_int_default>;
152
153		vdd-supply = <&pm8916_l17>;
154		vddio-supply = <&pm8916_l6>;
155	};
156
157	light-sensor@23 {
158		compatible = "liteon,ltr559";
159		reg = <0x23>;
160		proximity-near-level = <75>;
161
162		interrupt-parent = <&tlmm>;
163		interrupts = <115 IRQ_TYPE_EDGE_FALLING>;
164
165		pinctrl-names = "default";
166		pinctrl-0 = <&light_int_default>;
167
168		vdd-supply = <&pm8916_l17>;
169		vddio-supply = <&pm8916_l6>;
170	};
171
172	gyroscope@68 {
173		compatible = "bosch,bmg160";
174		reg = <0x68>;
175
176		interrupt-parent = <&tlmm>;
177		interrupts = <23 IRQ_TYPE_EDGE_RISING>,
178			     <22 IRQ_TYPE_EDGE_RISING>;
179
180		pinctrl-names = "default";
181		pinctrl-0 = <&gyro_int_default>;
182
183		vdd-supply = <&pm8916_l17>;
184		vddio-supply = <&pm8916_l6>;
185	};
186};
187
188&blsp_i2c5 {
189	status = "okay";
190
191	rmi4@20 {
192		compatible = "syna,rmi4-i2c";
193		reg = <0x20>;
194		#address-cells = <1>;
195		#size-cells = <0>;
196
197		interrupt-parent = <&tlmm>;
198		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
199
200		vdd-supply = <&reg_ctp>;
201		vio-supply = <&pm8916_l6>;
202
203		pinctrl-names = "default";
204		pinctrl-0 = <&tp_int_default>;
205
206		syna,startup-delay-ms = <10>;
207
208		rmi4-f01@1 {
209			reg = <0x1>;
210			syna,nosleep-mode = <1>; /* Allow sleeping */
211		};
212
213		rmi4-f12@12 {
214			reg = <0x12>;
215			syna,sensor-type = <1>; /* Touchscreen */
216		};
217	};
218};
219
220&blsp_uart2 {
221	status = "okay";
222};
223
224&pm8916_resin {
225	status = "okay";
226	linux,code = <KEY_VOLUMEDOWN>;
227};
228
229&pm8916_rpm_regulators {
230	pm8916_l17: l17 {
231		regulator-min-microvolt = <2850000>;
232		regulator-max-microvolt = <2850000>;
233	};
234};
235
236&pm8916_usbin {
237	status = "okay";
238};
239
240&pm8916_vib {
241	status = "okay";
242};
243
244&sdhc_1 {
245	status = "okay";
246};
247
248&sdhc_2 {
249	status = "okay";
250	non-removable;
251};
252
253&usb {
254	status = "okay";
255	dr_mode = "peripheral";
256	extcon = <&pm8916_usbin>;
257};
258
259&usb_hs_phy {
260	extcon = <&pm8916_usbin>;
261};
262
263&wcnss {
264	status = "okay";
265};
266
267&wcnss_iris {
268	compatible = "qcom,wcn3620";
269};
270
271&tlmm {
272	accel_int_default: accel-int-default-state {
273		pins = "gpio116";
274		function = "gpio";
275
276		drive-strength = <2>;
277		bias-disable;
278	};
279
280	camera_flash_default: camera-flash-default-state {
281		pins = "gpio31", "gpio32";
282		function = "gpio";
283
284		drive-strength = <2>;
285		bias-disable;
286	};
287
288	ctp_pwr_en_default: ctp-pwr-en-default-state {
289		pins = "gpio17";
290		function = "gpio";
291
292		drive-strength = <2>;
293		bias-disable;
294	};
295
296	gpio_keys_default: gpio-keys-default-state {
297		pins = "gpio107";
298		function = "gpio";
299
300		drive-strength = <2>;
301		bias-pull-up;
302	};
303
304	gyro_int_default: gyro-int-default-state {
305		pins = "gpio22", "gpio23";
306		function = "gpio";
307
308		drive-strength = <2>;
309		bias-disable;
310	};
311
312	light_int_default: light-int-default-state {
313		pins = "gpio115";
314		function = "gpio";
315
316		drive-strength = <2>;
317		bias-disable;
318	};
319
320	magn_int_default: magn-int-default-state {
321		pins = "gpio113";
322		function = "gpio";
323
324		drive-strength = <2>;
325		bias-disable;
326	};
327
328	tp_int_default: tp-int-default-state {
329		pins = "gpio13";
330		function = "gpio";
331
332		drive-strength = <2>;
333		bias-disable;
334	};
335};
336