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