GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / arm64 / boot / dts / qcom / msm8998-fxtec-pro1.dts
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 <dt-bindings/input/input.h>
10 #include <dt-bindings/leds/common.h>
11 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
12 #include "msm8998.dtsi"
13 #include "pm8005.dtsi"
14 #include "pm8998.dtsi"
15 #include "pmi8998.dtsi"
16
17 / {
18         model = "F(x)tec Pro1 (QX1000)";
19         compatible = "fxtec,pro1", "qcom,msm8998";
20         chassis-type = "handset";
21         qcom,board-id = <0x02000b 0x10>;
22
23         aliases {
24                 serial0 = &blsp2_uart1;
25                 serial1 = &blsp1_uart3;
26         };
27
28         /*
29          * Until we hook up type-c detection, we
30          * have to stick with this. But it works.
31          */
32         extcon_usb: extcon-usb {
33                 compatible = "linux,extcon-usb-gpio";
34                 id-gpio = <&tlmm 38 GPIO_ACTIVE_HIGH>;
35         };
36
37         gpio-hall-sensors {
38                 compatible = "gpio-keys";
39                 label = "Hall sensors";
40                 pinctrl-names = "default";
41                 pinctrl-0 = <&hall_sensor1_default>;
42
43                 event-hall-sensor1 {
44                         label = "Keyboard Hall Sensor";
45                         gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>;
46                         debounce-interval = <15>;
47                         gpio-key,wakeup;
48                         linux,input-type = <EV_SW>;
49                         linux,code = <SW_KEYPAD_SLIDE>;
50                 };
51         };
52
53         gpio-kb-extra-keys {
54                 compatible = "gpio-keys";
55                 label = "Keyboard extra keys";
56                 pinctrl-names = "default";
57                 pinctrl-0 = <&gpio_kb_pins_extra>;
58
59                 key-home {
60                         label = "Home";
61                         gpios = <&tlmm 21 GPIO_ACTIVE_LOW>;
62                         linux,code = <KEY_HOMEPAGE>;
63                         debounce-interval = <15>;
64                         linux,can-disable;
65                 };
66
67                 key-super-l {
68                         label = "Super Left";
69                         gpios = <&tlmm 32 GPIO_ACTIVE_LOW>;
70                         linux,code = <KEY_FN>;
71                         debounce-interval = <15>;
72                         linux,can-disable;
73                 };
74
75                 key-super-r {
76                         label = "Super Right";
77                         gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
78                         linux,code = <KEY_FN>;
79                         debounce-interval = <15>;
80                         linux,can-disable;
81                 };
82
83                 key-shift {
84                         label = "Shift";
85                         gpios = <&tlmm 114 GPIO_ACTIVE_LOW>;
86                         linux,code = <KEY_RIGHTSHIFT>;
87                         debounce-interval = <15>;
88                         linux,can-disable;
89                 };
90
91                 key-ctrl {
92                         label = "Ctrl";
93                         gpios = <&tlmm 128 GPIO_ACTIVE_LOW>;
94                         linux,code = <KEY_LEFTCTRL>;
95                         debounce-interval = <15>;
96                         linux,can-disable;
97                 };
98
99                 key-alt {
100                         label = "Alt";
101                         gpios = <&tlmm 129 GPIO_ACTIVE_LOW>;
102                         linux,code = <KEY_LEFTALT>;
103                         debounce-interval = <15>;
104                         linux,can-disable;
105                 };
106         };
107
108         gpio-keys {
109                 compatible = "gpio-keys";
110                 label = "Side buttons";
111                 pinctrl-names = "default";
112                 pinctrl-0 = <&vol_up_pin_a>, <&cam_focus_pin_a>,
113                             <&cam_snapshot_pin_a>;
114                 button-vol-up {
115                         label = "Volume Up";
116                         gpios = <&pm8998_gpio 6 GPIO_ACTIVE_LOW>;
117                         linux,input-type = <EV_KEY>;
118                         linux,code = <KEY_VOLUMEUP>;
119                         gpio-key,wakeup;
120                         debounce-interval = <15>;
121                 };
122
123                 button-camera-snapshot {
124                         label = "Camera Snapshot";
125                         gpios = <&pm8998_gpio 7 GPIO_ACTIVE_LOW>;
126                         linux,input-type = <EV_KEY>;
127                         linux,code = <KEY_CAMERA>;
128                         debounce-interval = <15>;
129                 };
130
131                 button-camera-focus {
132                         label = "Camera Focus";
133                         gpios = <&pm8998_gpio 8 GPIO_ACTIVE_LOW>;
134                         linux,input-type = <EV_KEY>;
135                         linux,code = <KEY_CAMERA_FOCUS>;
136                         debounce-interval = <15>;
137                 };
138         };
139
140         keyboard-leds {
141                 compatible = "gpio-leds";
142
143                 led-0 {
144                         color = <LED_COLOR_ID_WHITE>;
145                         default-state = "off";
146                         function = LED_FUNCTION_KBD_BACKLIGHT;
147                         gpios = <&tlmm 16 GPIO_ACTIVE_HIGH>;
148                         label = "white:kbd_backlight";
149                         retain-state-suspended;
150                 };
151
152                 led-1 {
153                         color = <LED_COLOR_ID_YELLOW>;
154                         default-state = "off";
155                         function = LED_FUNCTION_CAPSLOCK;
156                         gpios = <&tlmm 26 GPIO_ACTIVE_HIGH>;
157                         label = "yellow:capslock";
158                         linux,default-trigger = "kbd-capslock";
159                 };
160         };
161
162         reserved-memory {
163                 cont_splash_mem: memory@9d400000 {
164                         reg = <0x0 0x9d400000 0x0 0x2000000>;
165                         no-map;
166                 };
167
168                 zap_shader_region: memory@f6400000 {
169                         compatible = "shared-dma-pool";
170                         reg = <0x0 0xf6400000 0x0 0x2000>;
171                         no-map;
172                 };
173
174                 ramoops@ffc00000 {
175                         compatible = "ramoops";
176                         reg = <0x0 0xffc00000 0x0 0x100000>;
177                         console-size = <0x60000>;
178                         ecc-size = <16>;
179                         ftrace-size = <0x10000>;
180                         pmsg-size = <0x20000>;
181                         record-size = <0x10000>;
182                 };
183         };
184
185         ts_vio_vreg: ts-vio-vreg {
186                 compatible = "regulator-fixed";
187                 regulator-name = "ts_vio_reg";
188                 startup-delay-us = <2>;
189                 enable-active-high;
190                 gpio = <&tlmm 81 GPIO_ACTIVE_HIGH>;
191                 pinctrl-names = "default";
192                 pinctrl-0 = <&ts_vio_default>;
193                 regulator-always-on;
194         };
195
196         vph_pwr: vph-pwr-regulator {
197                 compatible = "regulator-fixed";
198                 regulator-name = "vph_pwr";
199                 regulator-always-on;
200                 regulator-boot-on;
201         };
202 };
203
204 &blsp1_uart3 {
205         status = "okay";
206
207         bluetooth {
208                 compatible = "qcom,wcn3990-bt";
209
210                 vddio-supply = <&vreg_s4a_1p8>;
211                 vddxo-supply = <&vreg_l7a_1p8>;
212                 vddrf-supply = <&vreg_l17a_1p3>;
213                 vddch0-supply = <&vreg_l25a_3p3>;
214                 max-speed = <3200000>;
215         };
216 };
217
218 &blsp1_uart3_on {
219         rx {
220                 /delete-property/ bias-disable;
221                 /*
222                  * Configure a pull-up on 45 (RX). This is needed to
223                  * avoid garbage data when the TX pin of the Bluetooth
224                  * module is in tri-state (module powered off or not
225                  * driving the signal yet).
226                  */
227                 bias-pull-up;
228         };
229
230         cts {
231                 /delete-property/ bias-disable;
232                 /*
233                  * Configure a pull-down on 47 (CTS) to match the pull
234                  * of the Bluetooth module.
235                  */
236                 bias-pull-down;
237         };
238 };
239
240 &blsp2_uart1 {
241         status = "okay";
242 };
243
244 &blsp2_i2c1 {
245         status = "okay";
246
247         touchscreen@14 {
248                 compatible = "goodix,gt9286";
249                 reg = <0x14>;
250                 interrupt-parent = <&tlmm>;
251                 interrupts = <125 IRQ_TYPE_LEVEL_LOW>;
252                 reset-gpios = <&tlmm 89 GPIO_ACTIVE_HIGH>;
253                 AVDD28-supply = <&vreg_l28_3p0>;
254                 VDDIO-supply = <&ts_vio_vreg>;
255                 pinctrl-names = "active";
256                 pinctrl-0 = <&ts_rst_n>, <&ts_int_n>;
257         };
258 };
259
260 &etf {
261         status = "okay";
262 };
263
264 &etm1 {
265         status = "okay";
266 };
267
268 &etm2 {
269         status = "okay";
270 };
271
272 &etm3 {
273         status = "okay";
274 };
275
276 &etm4 {
277         status = "okay";
278 };
279
280 &etm5 {
281         status = "okay";
282 };
283
284 &etm6 {
285         status = "okay";
286 };
287
288 &etm7 {
289         status = "okay";
290 };
291
292 &etm8 {
293         status = "okay";
294 };
295
296 &etr {
297         status = "okay";
298 };
299
300 &funnel1 {
301         status = "okay";
302 };
303
304 &funnel2 {
305         status = "okay";
306 };
307
308 &funnel3 {
309         status = "okay";
310 };
311
312 &funnel4 {
313         // FIXME: Figure out why clock late_initcall crashes the board with
314         // this enabled.
315         // status = "okay";
316 };
317
318 &funnel5 {
319         // FIXME: Figure out why clock late_initcall crashes the board with
320         // this enabled.
321         // status = "okay";
322 };
323
324 &pcie0 {
325         status = "okay";
326 };
327
328 &pcie_phy {
329         status = "okay";
330 };
331
332 &pm8005_regulators {
333         vdd_s1-supply = <&vph_pwr>;
334
335         pm8005_s1: s1 { /* VDD_GFX supply */
336                 regulator-min-microvolt = <524000>;
337                 regulator-max-microvolt = <1100000>;
338                 regulator-enable-ramp-delay = <500>;
339
340                 /* Hack until we rig up the gpu consumer */
341                 regulator-always-on;
342         };
343 };
344
345 &pm8998_gpio {
346         vol_up_pin_a: vol-up-active-state {
347                 pins = "gpio6";
348                 function = "normal";
349                 bias-pull-up;
350                 input-enable;
351                 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
352         };
353
354         cam_focus_pin_a: cam-focus-btn-active-state {
355                 pins = "gpio7";
356                 function = "normal";
357                 bias-pull-up;
358                 input-enable;
359                 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
360         };
361
362         cam_snapshot_pin_a: cam-snapshot-btn-active-state {
363                 pins = "gpio8";
364                 function = "normal";
365                 bias-pull-up;
366                 input-enable;
367                 qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>;
368         };
369 };
370
371 &pm8998_pon {
372         resin {
373                 compatible = "qcom,pm8941-resin";
374                 interrupts = <GIC_SPI 0x8 1 IRQ_TYPE_EDGE_BOTH>;
375                 bias-pull-up;
376                 debounce = <15625>;
377                 linux,code = <KEY_VOLUMEDOWN>;
378         };
379 };
380
381 &qusb2phy {
382         status = "okay";
383
384         vdda-pll-supply = <&vreg_l12a_1p8>;
385         vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
386 };
387
388 &replicator1 {
389         status = "okay";
390 };
391
392 &rpm_requests {
393         pm8998-regulators {
394                 compatible = "qcom,rpm-pm8998-regulators";
395
396                 vdd_s1-supply = <&vph_pwr>;
397                 vdd_s2-supply = <&vph_pwr>;
398                 vdd_s3-supply = <&vph_pwr>;
399                 vdd_s4-supply = <&vph_pwr>;
400                 vdd_s5-supply = <&vph_pwr>;
401                 vdd_s6-supply = <&vph_pwr>;
402                 vdd_s7-supply = <&vph_pwr>;
403                 vdd_s8-supply = <&vph_pwr>;
404                 vdd_s9-supply = <&vph_pwr>;
405                 vdd_s10-supply = <&vph_pwr>;
406                 vdd_s11-supply = <&vph_pwr>;
407                 vdd_s12-supply = <&vph_pwr>;
408                 vdd_s13-supply = <&vph_pwr>;
409                 vdd_l1_l27-supply = <&vreg_s7a_1p025>;
410                 vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
411                 vdd_l3_l11-supply = <&vreg_s7a_1p025>;
412                 vdd_l4_l5-supply = <&vreg_s7a_1p025>;
413                 vdd_l6-supply = <&vreg_s5a_2p04>;
414                 vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
415                 vdd_l9-supply = <&vreg_bob>;
416                 vdd_l10_l23_l25-supply = <&vreg_bob>;
417                 vdd_l13_l19_l21-supply = <&vreg_bob>;
418                 vdd_l16_l28-supply = <&vreg_bob>;
419                 vdd_l18_l22-supply = <&vreg_bob>;
420                 vdd_l20_l24-supply = <&vreg_bob>;
421                 vdd_l26-supply = <&vreg_s3a_1p35>;
422                 vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
423
424                 vreg_s3a_1p35: s3 {
425                         regulator-min-microvolt = <1352000>;
426                         regulator-max-microvolt = <1352000>;
427                 };
428
429                 vreg_s4a_1p8: s4 {
430                         regulator-min-microvolt = <1800000>;
431                         regulator-max-microvolt = <1800000>;
432                         regulator-allow-set-load;
433                 };
434
435                 vreg_s5a_2p04: s5 {
436                         regulator-min-microvolt = <1904000>;
437                         regulator-max-microvolt = <2040000>;
438                 };
439
440                 vreg_s7a_1p025: s7 {
441                         regulator-min-microvolt = <900000>;
442                         regulator-max-microvolt = <1028000>;
443                 };
444
445                 vreg_l1a_0p875: l1 {
446                         regulator-min-microvolt = <880000>;
447                         regulator-max-microvolt = <880000>;
448                 };
449
450                 vreg_l2a_1p2: l2 {
451                         regulator-min-microvolt = <1200000>;
452                         regulator-max-microvolt = <1200000>;
453                 };
454
455                 vreg_l3a_1p0: l3 {
456                         regulator-min-microvolt = <1000000>;
457                         regulator-max-microvolt = <1000000>;
458                 };
459
460                 vreg_l5a_0p8: l5 {
461                         regulator-min-microvolt = <800000>;
462                         regulator-max-microvolt = <800000>;
463                 };
464
465                 vreg_l6a_1p8: l6 {
466                         regulator-min-microvolt = <1808000>;
467                         regulator-max-microvolt = <1808000>;
468                 };
469
470                 vreg_l7a_1p8: l7 {
471                         regulator-min-microvolt = <1800000>;
472                         regulator-max-microvolt = <1800000>;
473                 };
474
475                 vreg_l8a_1p2: l8 {
476                         regulator-min-microvolt = <1200000>;
477                         regulator-max-microvolt = <1200000>;
478                 };
479
480                 vreg_l9a_1p8: l9 {
481                         regulator-min-microvolt = <1808000>;
482                         regulator-max-microvolt = <2960000>;
483                 };
484
485                 vreg_l10a_1p8: l10 {
486                         regulator-min-microvolt = <1808000>;
487                         regulator-max-microvolt = <2960000>;
488                 };
489
490                 vreg_l11a_1p0: l11 {
491                         regulator-min-microvolt = <1000000>;
492                         regulator-max-microvolt = <1000000>;
493                 };
494
495                 vreg_l12a_1p8: l12 {
496                         regulator-min-microvolt = <1800000>;
497                         regulator-max-microvolt = <1800000>;
498                 };
499
500                 vreg_l13a_2p95: l13 {
501                         regulator-min-microvolt = <1808000>;
502                         regulator-max-microvolt = <2960000>;
503                 };
504
505                 vreg_l14a_1p88: l14 {
506                         regulator-min-microvolt = <1880000>;
507                         regulator-max-microvolt = <1880000>;
508                 };
509
510                 vreg_l15a_1p8: l15 {
511                         regulator-min-microvolt = <1800000>;
512                         regulator-max-microvolt = <1800000>;
513                 };
514
515                 vreg_l16a_2p7: l16 {
516                         regulator-min-microvolt = <2704000>;
517                         regulator-max-microvolt = <2704000>;
518                 };
519
520                 vreg_l17a_1p3: l17 {
521                         regulator-min-microvolt = <1304000>;
522                         regulator-max-microvolt = <1304000>;
523                 };
524
525                 vreg_l18a_2p7: l18 {
526                         regulator-min-microvolt = <2704000>;
527                         regulator-max-microvolt = <2704000>;
528                 };
529
530                 vreg_l19a_3p0: l19 {
531                         regulator-min-microvolt = <3008000>;
532                         regulator-max-microvolt = <3008000>;
533                 };
534
535                 vreg_l20a_2p95: l20 {
536                         regulator-min-microvolt = <2960000>;
537                         regulator-max-microvolt = <2960000>;
538                         regulator-allow-set-load;
539                 };
540
541                 vreg_l21a_2p95: l21 {
542                         regulator-min-microvolt = <2960000>;
543                         regulator-max-microvolt = <2960000>;
544                         regulator-system-load = <800000>;
545                         regulator-allow-set-load;
546                 };
547
548                 vreg_l22a_2p85: l22 {
549                         regulator-min-microvolt = <2864000>;
550                         regulator-max-microvolt = <2864000>;
551                 };
552
553                 vreg_l23a_3p3: l23 {
554                         regulator-min-microvolt = <3312000>;
555                         regulator-max-microvolt = <3312000>;
556                 };
557
558                 vreg_l24a_3p075: l24 {
559                         regulator-min-microvolt = <3088000>;
560                         regulator-max-microvolt = <3088000>;
561                 };
562
563                 vreg_l25a_3p3: l25 {
564                         regulator-min-microvolt = <3104000>;
565                         regulator-max-microvolt = <3312000>;
566                 };
567
568                 vreg_l26a_1p2: l26 {
569                         regulator-min-microvolt = <1200000>;
570                         regulator-max-microvolt = <1200000>;
571                         regulator-allow-set-load;
572                 };
573
574                 vreg_l28_3p0: l28 {
575                         regulator-min-microvolt = <3008000>;
576                         regulator-max-microvolt = <3008000>;
577                 };
578
579                 vreg_lvs1a_1p8: lvs1 {
580                         regulator-min-microvolt = <1800000>;
581                         regulator-max-microvolt = <1800000>;
582                 };
583
584                 vreg_lvs2a_1p8: lvs2 {
585                         regulator-min-microvolt = <1800000>;
586                         regulator-max-microvolt = <1800000>;
587                 };
588
589         };
590
591         pmi8998-regulators {
592                 compatible = "qcom,rpm-pmi8998-regulators";
593
594                 vdd_bob-supply = <&vph_pwr>;
595
596                 vreg_bob: bob {
597                         regulator-min-microvolt = <3312000>;
598                         regulator-max-microvolt = <3600000>;
599                 };
600         };
601 };
602
603 &remoteproc_adsp {
604         status = "okay";
605 };
606
607 &remoteproc_mss {
608         status = "okay";
609 };
610
611 &remoteproc_slpi {
612         status = "okay";
613 };
614
615 &tlmm {
616         gpio-reserved-ranges = <0 4>;
617
618         mdp_vsync_n: mdp-vsync-n {
619                 pins = "gpio10";
620                 function = "mdp_vsync_a";
621                 bias-pull-down;
622                 drive-strength = <2>;
623         };
624
625         gpio_kb_pins_extra: gpio-kb-pins-extra {
626                 pins = "gpio21", "gpio32", "gpio33", "gpio114",
627                        "gpio128", "gpio129";
628                 function = "gpio";
629                 drive-strength = <2>;
630                 bias-pull-up;
631         };
632
633         ts_vio_default: ts-vio-def {
634                 pins = "gpio81";
635                 function = "gpio";
636                 bias-disable;
637                 drive-strength = <2>;
638         };
639
640         ts_rst_n: ts-rst-n {
641                 pins = "gpio89";
642                 function = "gpio";
643                 bias-pull-up;
644                 drive-strength = <8>;
645         };
646
647         hall_sensor1_default: hall-sensor1-def {
648                 pins = "gpio124";
649                 function = "gpio";
650                 bias-disable;
651                 drive-strength = <2>;
652                 input-enable;
653         };
654
655         ts_int_n: ts-int-n {
656                 pins = "gpio125";
657                 function = "gpio";
658                 bias-disable;
659                 drive-strength = <8>;
660         };
661 };
662
663 &sdhc2 {
664         status = "okay";
665         cd-gpios = <&tlmm 95 GPIO_ACTIVE_LOW>;
666
667         vmmc-supply = <&vreg_l21a_2p95>;
668         vqmmc-supply = <&vreg_l13a_2p95>;
669
670         pinctrl-names = "default", "sleep";
671         pinctrl-0 = <&sdc2_on &sdc2_cd>;
672         pinctrl-1 = <&sdc2_off &sdc2_cd>;
673 };
674
675 &stm {
676         status = "okay";
677 };
678
679 &ufshc {
680         status = "okay";
681         vcc-supply = <&vreg_l20a_2p95>;
682         vccq-supply = <&vreg_l26a_1p2>;
683         vccq2-supply = <&vreg_s4a_1p8>;
684         vcc-max-microamp = <750000>;
685         vccq-max-microamp = <560000>;
686         vccq2-max-microamp = <750000>;
687 };
688
689 &ufsphy {
690         status = "okay";
691         vdda-phy-supply = <&vreg_l1a_0p875>;
692         vdda-pll-supply = <&vreg_l2a_1p2>;
693         vddp-ref-clk-supply = <&vreg_l26a_1p2>;
694 };
695
696 &usb3 {
697         status = "okay";
698 };
699
700 &usb3_dwc3 {
701         dr_mode = "peripheral";
702         extcon = <&extcon_usb>;
703 };
704
705 &usb3phy {
706         status = "okay";
707
708         vdda-phy-supply = <&vreg_l1a_0p875>;
709         vdda-pll-supply = <&vreg_l2a_1p2>;
710 };
711
712 /* GT9286 analog supply */
713 &vreg_l28_3p0 {
714         regulator-min-microvolt = <2800000>;
715         regulator-max-microvolt = <2800000>;
716 };
717
718 &wifi {
719         status = "okay";
720
721         vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
722         vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
723         vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
724         vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
725 };