GNU Linux-libre 5.19-rc6-gnu
[releases.git] / arch / arm / boot / dts / qcom-msm8974pro-fairphone-fp2.dts
1 // SPDX-License-Identifier: GPL-2.0
2 #include "qcom-msm8974pro.dtsi"
3 #include "qcom-pm8841.dtsi"
4 #include "qcom-pm8941.dtsi"
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
7
8 / {
9         model = "Fairphone 2";
10         compatible = "fairphone,fp2", "qcom,msm8974";
11
12         aliases {
13                 mmc0 = &sdhc_1;
14                 mmc1 = &sdhc_2;
15                 serial0 = &blsp1_uart2;
16         };
17
18         chosen {
19                 stdout-path = "serial0:115200n8";
20         };
21
22         gpio-keys {
23                 compatible = "gpio-keys";
24
25                 pinctrl-names = "default";
26                 pinctrl-0 = <&gpio_keys_pin_a>;
27
28                 camera-snapshot {
29                         label = "camera_snapshot";
30                         gpios = <&pm8941_gpios 1 GPIO_ACTIVE_LOW>;
31                         linux,code = <KEY_CAMERA>;
32                         wakeup-source;
33                         debounce-interval = <15>;
34                 };
35
36                 volume-down {
37                         label = "volume_down";
38                         gpios = <&pm8941_gpios 2 GPIO_ACTIVE_LOW>;
39                         linux,code = <KEY_VOLUMEDOWN>;
40                         wakeup-source;
41                         debounce-interval = <15>;
42                 };
43
44                 volume-up {
45                         label = "volume_up";
46                         gpios = <&pm8941_gpios 5 GPIO_ACTIVE_LOW>;
47                         linux,code = <KEY_VOLUMEUP>;
48                         wakeup-source;
49                         debounce-interval = <15>;
50                 };
51         };
52
53         vibrator {
54                 compatible = "gpio-vibrator";
55                 enable-gpios = <&tlmm 86 GPIO_ACTIVE_HIGH>;
56                 vcc-supply = <&pm8941_l18>;
57         };
58 };
59
60 &blsp1_i2c2 {
61         status = "okay";
62
63         touchscreen@41 {
64                 compatible = "ilitek,ili2120";
65                 reg = <0x41>;
66                 interrupt-parent = <&tlmm>;
67                 interrupts = <28 IRQ_TYPE_EDGE_FALLING>;
68                 reset-gpios = <&tlmm 55 GPIO_ACTIVE_LOW>;
69
70                 touchscreen-size-x = <1080>;
71                 touchscreen-size-y = <1920>;
72         };
73 };
74
75 &blsp1_uart2 {
76         status = "okay";
77 };
78
79 &imem {
80         reboot-mode {
81                 mode-normal     = <0x77665501>;
82                 mode-bootloader = <0x77665500>;
83                 mode-recovery   = <0x77665502>;
84         };
85 };
86
87 &otg {
88         status = "okay";
89
90         phys = <&usb_hs1_phy>;
91         phy-select = <&tcsr 0xb000 0>;
92         extcon = <&smbb>, <&usb_id>;
93         vbus-supply = <&chg_otg>;
94
95         hnp-disable;
96         srp-disable;
97         adp-disable;
98
99         ulpi {
100                 phy@a {
101                         status = "okay";
102
103                         v1p8-supply = <&pm8941_l6>;
104                         v3p3-supply = <&pm8941_l24>;
105
106                         extcon = <&smbb>;
107                         qcom,init-seq = /bits/ 8 <0x1 0x64>;
108                 };
109         };
110 };
111
112 &pm8941_gpios {
113         gpio_keys_pin_a: gpio-keys-active {
114                 pins = "gpio1", "gpio2", "gpio5";
115                 function = "normal";
116
117                 bias-pull-up;
118                 power-source = <PM8941_GPIO_S3>;
119         };
120 };
121
122 &pronto {
123         status = "okay";
124
125         vddmx-supply = <&pm8841_s1>;
126         vddcx-supply = <&pm8841_s2>;
127         vddpx-supply = <&pm8941_s3>;
128
129         pinctrl-names = "default";
130         pinctrl-0 = <&wcnss_pin_a>;
131
132         iris {
133                 vddxo-supply = <&pm8941_l6>;
134                 vddrfa-supply = <&pm8941_l11>;
135                 vddpa-supply = <&pm8941_l19>;
136                 vdddig-supply = <&pm8941_s3>;
137         };
138
139         smd-edge {
140                 qcom,remote-pid = <4>;
141                 label = "pronto";
142
143                 wcnss {
144                         status = "okay";
145                 };
146         };
147 };
148
149 &remoteproc_adsp {
150         cx-supply = <&pm8841_s2>;
151 };
152
153 &remoteproc_mss {
154         cx-supply = <&pm8841_s2>;
155         mss-supply = <&pm8841_s3>;
156         mx-supply = <&pm8841_s1>;
157         pll-supply = <&pm8941_l12>;
158 };
159
160 &rpm_requests {
161         pm8841-regulators {
162                 compatible = "qcom,rpm-pm8841-regulators";
163
164                 pm8841_s1: s1 {
165                         regulator-min-microvolt = <675000>;
166                         regulator-max-microvolt = <1050000>;
167                 };
168
169                 pm8841_s2: s2 {
170                         regulator-min-microvolt = <500000>;
171                         regulator-max-microvolt = <1050000>;
172                 };
173
174                 pm8841_s3: s3 {
175                         regulator-min-microvolt = <1050000>;
176                         regulator-max-microvolt = <1050000>;
177                 };
178         };
179
180         pm8941-regulators {
181                 compatible = "qcom,rpm-pm8941-regulators";
182
183                 vdd_l1_l3-supply = <&pm8941_s1>;
184                 vdd_l2_lvs1_2_3-supply = <&pm8941_s3>;
185                 vdd_l4_l11-supply = <&pm8941_s1>;
186                 vdd_l5_l7-supply = <&pm8941_s2>;
187                 vdd_l6_l12_l14_l15-supply = <&pm8941_s2>;
188                 vdd_l9_l10_l17_l22-supply = <&vreg_boost>;
189                 vdd_l13_l20_l23_l24-supply = <&vreg_boost>;
190                 vdd_l21-supply = <&vreg_boost>;
191
192                 pm8941_s1: s1 {
193                         regulator-min-microvolt = <1300000>;
194                         regulator-max-microvolt = <1300000>;
195                         regulator-always-on;
196                         regulator-boot-on;
197                 };
198
199                 pm8941_s2: s2 {
200                         regulator-min-microvolt = <2150000>;
201                         regulator-max-microvolt = <2150000>;
202                         regulator-boot-on;
203                 };
204
205                 pm8941_s3: s3 {
206                         regulator-min-microvolt = <1800000>;
207                         regulator-max-microvolt = <1800000>;
208                         regulator-always-on;
209                         regulator-boot-on;
210                 };
211
212                 pm8941_l1: l1 {
213                         regulator-min-microvolt = <1225000>;
214                         regulator-max-microvolt = <1225000>;
215                         regulator-always-on;
216                         regulator-boot-on;
217                 };
218
219                 pm8941_l2: l2 {
220                         regulator-min-microvolt = <1200000>;
221                         regulator-max-microvolt = <1200000>;
222                 };
223
224                 pm8941_l3: l3 {
225                         regulator-min-microvolt = <1225000>;
226                         regulator-max-microvolt = <1225000>;
227                 };
228
229                 pm8941_l4: l4 {
230                         regulator-min-microvolt = <1225000>;
231                         regulator-max-microvolt = <1225000>;
232                 };
233
234                 pm8941_l5: l5 {
235                         regulator-min-microvolt = <1800000>;
236                         regulator-max-microvolt = <1800000>;
237                 };
238
239                 pm8941_l6: l6 {
240                         regulator-min-microvolt = <1800000>;
241                         regulator-max-microvolt = <1800000>;
242                         regulator-boot-on;
243                 };
244
245                 pm8941_l7: l7 {
246                         regulator-min-microvolt = <1800000>;
247                         regulator-max-microvolt = <1800000>;
248                         regulator-boot-on;
249                 };
250
251                 pm8941_l8: l8 {
252                         regulator-min-microvolt = <1800000>;
253                         regulator-max-microvolt = <1800000>;
254                 };
255
256                 pm8941_l9: l9 {
257                         regulator-min-microvolt = <1800000>;
258                         regulator-max-microvolt = <2950000>;
259                 };
260
261                 pm8941_l10: l10 {
262                         regulator-min-microvolt = <1800000>;
263                         regulator-max-microvolt = <2950000>;
264                 };
265
266                 pm8941_l11: l11 {
267                         regulator-min-microvolt = <1225000>;
268                         regulator-max-microvolt = <1350000>;
269                 };
270
271                 pm8941_l12: l12 {
272                         regulator-min-microvolt = <1800000>;
273                         regulator-max-microvolt = <1800000>;
274                         regulator-always-on;
275                         regulator-boot-on;
276                 };
277
278                 pm8941_l13: l13 {
279                         regulator-min-microvolt = <1800000>;
280                         regulator-max-microvolt = <2950000>;
281                         regulator-boot-on;
282                 };
283
284                 pm8941_l14: l14 {
285                         regulator-min-microvolt = <1800000>;
286                         regulator-max-microvolt = <1800000>;
287                 };
288
289                 pm8941_l15: l15 {
290                         regulator-min-microvolt = <2050000>;
291                         regulator-max-microvolt = <2050000>;
292                 };
293
294                 pm8941_l16: l16 {
295                         regulator-min-microvolt = <2700000>;
296                         regulator-max-microvolt = <2700000>;
297                 };
298
299                 pm8941_l17: l17 {
300                         regulator-min-microvolt = <2850000>;
301                         regulator-max-microvolt = <2850000>;
302                 };
303
304                 pm8941_l18: l18 {
305                         regulator-min-microvolt = <2850000>;
306                         regulator-max-microvolt = <2850000>;
307                 };
308
309                 pm8941_l19: l19 {
310                         regulator-min-microvolt = <2900000>;
311                         regulator-max-microvolt = <3350000>;
312                 };
313
314                 pm8941_l20: l20 {
315                         regulator-min-microvolt = <2950000>;
316                         regulator-max-microvolt = <2950000>;
317                         regulator-system-load = <200000>;
318                         regulator-allow-set-load;
319                         regulator-boot-on;
320                 };
321
322                 pm8941_l21: l21 {
323                         regulator-min-microvolt = <2950000>;
324                         regulator-max-microvolt = <2950000>;
325                         regulator-boot-on;
326                 };
327
328                 pm8941_l22: l22 {
329                         regulator-min-microvolt = <3000000>;
330                         regulator-max-microvolt = <3300000>;
331                 };
332
333                 pm8941_l23: l23 {
334                         regulator-min-microvolt = <3000000>;
335                         regulator-max-microvolt = <3000000>;
336                 };
337
338                 pm8941_l24: l24 {
339                         regulator-min-microvolt = <3075000>;
340                         regulator-max-microvolt = <3075000>;
341                         regulator-boot-on;
342                 };
343         };
344 };
345
346 &sdhc_1 {
347         status = "okay";
348
349         vmmc-supply = <&pm8941_l20>;
350         vqmmc-supply = <&pm8941_s3>;
351
352         pinctrl-names = "default", "sleep";
353         pinctrl-0 = <&sdc1_on>;
354         pinctrl-1 = <&sdc1_off>;
355 };
356
357 &sdhc_2 {
358         status = "okay";
359
360         vmmc-supply = <&pm8941_l21>;
361         vqmmc-supply = <&pm8941_l13>;
362
363         pinctrl-names = "default", "sleep";
364         pinctrl-0 = <&sdc2_on>;
365         pinctrl-1 = <&sdc2_off>;
366 };
367
368 &smbb {
369         usb-charge-current-limit = <1500000>;
370         qcom,fast-charge-safe-current = <1500000>;
371         qcom,fast-charge-current-limit = <1500000>;
372         qcom,fast-charge-safe-voltage = <4380000>;
373         qcom,fast-charge-high-threshold-voltage = <4350000>;
374         qcom,auto-recharge-threshold-voltage = <4240000>;
375         qcom,minimum-input-voltage = <4450000>;
376 };
377
378 &tlmm {
379         sdc1_on: sdc1-on {
380                 clk {
381                         pins = "sdc1_clk";
382                         drive-strength = <16>;
383                         bias-disable;
384                 };
385
386                 cmd-data {
387                         pins = "sdc1_cmd", "sdc1_data";
388                         drive-strength = <10>;
389                         bias-pull-up;
390                 };
391         };
392
393         sdc2_on: sdc2-on {
394                 clk {
395                         pins = "sdc2_clk";
396                         drive-strength = <10>;
397                         bias-disable;
398                 };
399
400                 cmd-data {
401                         pins = "sdc2_cmd", "sdc2_data";
402                         drive-strength = <6>;
403                         bias-pull-up;
404                 };
405         };
406
407         wcnss_pin_a: wcnss-pin-active {
408                 wlan {
409                         pins =  "gpio36", "gpio37", "gpio38", "gpio39", "gpio40";
410                         function = "wlan";
411
412                         drive-strength = <6>;
413                         bias-pull-down;
414                 };
415
416                 bt {
417                         pins = "gpio35", "gpio43", "gpio44";
418                         function = "bt";
419
420                         drive-strength = <2>;
421                         bias-pull-down;
422                 };
423
424                 fm {
425                         pins = "gpio41", "gpio42";
426                         function = "fm";
427
428                         drive-strength = <2>;
429                         bias-pull-down;
430                 };
431         };
432 };