1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, AngeloGioacchino Del Regno
4 *                     <angelogioacchino.delregno@somainline.org>
5 */
6
7/dts-v1/;
8
9#include "msm8998-mtp.dtsi"
10
11#include <dt-bindings/input/input.h>
12#include <dt-bindings/leds/common.h>
13#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
14
15/ {
16	model = "F(x)tec Pro1 (QX1000)";
17	compatible = "fxtec,pro1", "qcom,msm8998";
18	qcom,board-id = <0x02000b 0x10>;
19
20	/*
21	 * Until we hook up type-c detection, we
22	 * have to stick with this. But it works.
23	 */
24	extcon_usb: extcon-usb {
25		compatible = "linux,extcon-usb-gpio";
26		id-gpio = <&tlmm 38 GPIO_ACTIVE_HIGH>;
27	};
28
29	gpio-hall-sensors {
30		compatible = "gpio-keys";
31		input-name = "hall-sensors";
32		label = "Hall sensors";
33		pinctrl-names = "default";
34		pinctrl-0 = <&hall_sensor1_default>;
35
36		hall-sensor1 {
37			label = "Keyboard Hall Sensor";
38			gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
39			debounce-interval = <15>;
40			gpio-key,wakeup;
41			linux,input-type = <EV_SW>;
42			linux,code = <SW_KEYPAD_SLIDE>;
43		};
44	};
45
46	gpio-kb-extra-keys {
47		compatible = "gpio-keys";
48		input-name = "extra-kb-keys";
49		label = "Keyboard extra keys";
50		pinctrl-names = "default";
51		pinctrl-0 = <&gpio_kb_pins_extra>;
52
53		home {
54			label = "Home";
55			gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
56			linux,code = <KEY_HOMEPAGE>;
57			debounce-interval = <15>;
58			linux,can-disable;
59		};
60
61		super-l {
62			label = "Super Left";
63			gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
64			linux,code = <KEY_FN>;
65			debounce-interval = <15>;
66			linux,can-disable;
67		};
68
69		super-r {
70			label = "Super Right";
71			gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
72			linux,code = <KEY_FN>;
73			debounce-interval = <15>;
74			linux,can-disable;
75		};
76
77		shift {
78			label = "Shift";
79			gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
80			linux,code = <KEY_RIGHTSHIFT>;
81			debounce-interval = <15>;
82			linux,can-disable;
83		};
84
85		ctrl {
86			label = "Ctrl";
87			gpios = <&tlmm 128 GPIO_ACTIVE_LOW>;
88			linux,code = <KEY_LEFTCTRL>;
89			debounce-interval = <15>;
90			linux,can-disable;
91		};
92
93		alt {
94			label = "Alt";
95			gpios = <&tlmm 129 GPIO_ACTIVE_LOW>;
96			linux,code = <KEY_LEFTALT>;
97			debounce-interval = <15>;
98			linux,can-disable;
99		};
100	};
101
102	gpio-keys {
103		compatible = "gpio-keys";
104		input-name = "side-buttons";
105		label = "Side buttons";
106		#address-cells = <1>;
107		#size-cells = <0>;
108		pinctrl-names = "default";
109		pinctrl-0 = <&vol_up_pin_a>, <&cam_focus_pin_a>,
110			    <&cam_snapshot_pin_a>;
111		vol-up {
112			label = "Volume Up";
113			gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
114			linux,input-type = <EV_KEY>;
115			linux,code = <KEY_VOLUMEUP>;
116			gpio-key,wakeup;
117			debounce-interval = <15>;
118		};
119
120		camera-snapshot {
121			label = "Camera Snapshot";
122			gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
123			linux,input-type = <EV_KEY>;
124			linux,code = <KEY_CAMERA>;
125			debounce-interval = <15>;
126		};
127
128		camera-focus {
129			label = "Camera Focus";
130			gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
131			linux,input-type = <EV_KEY>;
132			linux,code = <KEY_CAMERA_FOCUS>;
133			debounce-interval = <15>;
134		};
135	};
136
137	keyboard-leds {
138		compatible = "gpio-leds";
139
140		backlight {
141			color = <LED_COLOR_ID_WHITE>;
142			default-state = "off";
143			function = LED_FUNCTION_KBD_BACKLIGHT;
144			gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;
145			label = "white:kbd_backlight";
146			retain-state-suspended;
147		};
148
149		caps-lock {
150			color = <LED_COLOR_ID_YELLOW>;
151			default-state = "off";
152			function = LED_FUNCTION_CAPSLOCK;
153			gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
154			label = "yellow:capslock";
155			linux,default-trigger = "kbd-capslock";
156		};
157	};
158
159	reserved-memory {
160		cont_splash_mem: memory@9d400000 {
161			reg = <0x0 0x9d400000 0x0 0x2000000>;
162			no-map;
163		};
164
165		zap_shader_region: memory@f6400000 {
166			compatible = "shared-dma-pool";
167			reg = <0x0 0xf6400000 0x0 0x2000>;
168			no-map;
169		};
170
171		ramoops@ffc00000 {
172			compatible = "ramoops";
173			reg = <0x0 0xffc00000 0x0 0x100000>;
174			console-size = <0x60000>;
175			ecc-size = <16>;
176			ftrace-size = <0x10000>;
177			pmsg-size = <0x20000>;
178			record-size = <0x10000>;
179		};
180	};
181
182	ts_vio_vreg: ts-vio-vreg {
183		compatible = "regulator-fixed";
184		regulator-name = "ts_vio_reg";
185		startup-delay-us = <2>;
186		enable-active-high;
187		gpio = <&tlmm 81 GPIO_ACTIVE_HIGH>;
188		pinctrl-names = "default";
189		pinctrl-0 = <&ts_vio_default>;
190		regulator-always-on;
191	};
192};
193
194&blsp2_i2c1 {
195	status = "ok";
196
197	touchscreen@14 {
198		compatible = "goodix,gt9286";
199		reg = <0x14>;
200		interrupt-parent = <&tlmm>;
201		interrupts = <125 IRQ_TYPE_LEVEL_LOW>;
202		reset-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
203		AVDD28-supply = <&vreg_l28_3p0>;
204		VDDIO-supply = <&ts_vio_vreg>;
205		pinctrl-names = "active";
206		pinctrl-0 = <&ts_rst_n>, <&ts_int_n>;
207	};
208};
209
210&mmcc {
211	status = "ok";
212};
213
214&mmss_smmu {
215	status = "ok";
216};
217
218&pm8998_gpio {
219	vol_up_pin_a: vol-up-active {
220		pins = "gpio6";
221		function = "normal";
222		bias-pull-up;
223		input-enable;
224		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
225	};
226
227	cam_focus_pin_a: cam-focus-btn-active {
228		pins = "gpio7";
229		function = "normal";
230		bias-pull-up;
231		input-enable;
232		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
233	};
234
235	cam_snapshot_pin_a: cam-snapshot-btn-active {
236		pins = "gpio8";
237		function = "normal";
238		bias-pull-up;
239		input-enable;
240		qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
241	};
242};
243
244&pm8998_pon {
245	resin {
246		compatible = "qcom,pm8941-resin";
247		interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>;
248		bias-pull-up;
249		debounce = <15625>;
250		linux,code = <KEY_VOLUMEDOWN>;
251	};
252};
253
254&tlmm {
255	gpio-reserved-ranges = <0 4>;
256
257	mdp_vsync_n: mdp-vsync-n {
258		pins = "gpio10";
259		function = "mdp_vsync_a";
260		bias-pull-down;
261		drive-strength = <2>;
262	};
263
264	gpio_kb_pins_extra: gpio-kb-pins-extra {
265		pins = "gpio21", "gpio32", "gpio33", "gpio114",
266		       "gpio128", "gpio129";
267		function = "gpio";
268		drive-strength = <2>;
269		bias-pull-up;
270	};
271
272	ts_vio_default: ts-vio-def {
273		pins = "gpio81";
274		function = "gpio";
275		bias-disable;
276		drive-strength = <2>;
277	};
278
279	ts_rst_n: ts-rst-n {
280		pins = "gpio89";
281		function = "gpio";
282		bias-pull-up;
283		drive-strength = <8>;
284	};
285
286	hall_sensor1_default: hall-sensor1-def {
287		pins = "gpio124";
288		function = "gpio";
289		bias-disable;
290		drive-strength = <2>;
291		input-enable;
292	};
293
294	ts_int_n: ts-int-n {
295		pins = "gpio125";
296		function = "gpio";
297		bias-disable;
298		drive-strength = <8>;
299	};
300};
301
302&ufshc {
303	status = "ok";
304};
305
306&ufsphy {
307	status = "ok";
308};
309
310&usb3_dwc3 {
311	dr_mode = "peripheral";
312	extcon = <&extcon_usb>;
313};
314
315/* GT9286 analog supply */
316&vreg_l28_3p0 {
317	regulator-min-microvolt = <2800000>;
318	regulator-max-microvolt = <2800000>;
319};
320