Merge tag 'timers-urgent-2020-12-27' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / arch / arm64 / boot / dts / allwinner / sun50i-a64-pinephone.dtsi
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 // Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
3 // Copyright (C) 2020 Martijn Braam <martijn@brixit.nl>
4 // Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
5
6 #include "sun50i-a64.dtsi"
7 #include "sun50i-a64-cpu-opp.dtsi"
8
9 #include <dt-bindings/gpio/gpio.h>
10 #include <dt-bindings/input/input.h>
11 #include <dt-bindings/leds/common.h>
12 #include <dt-bindings/pwm/pwm.h>
13
14 / {
15         aliases {
16                 ethernet0 = &rtl8723cs;
17                 serial0 = &uart0;
18         };
19
20         backlight: backlight {
21                 compatible = "pwm-backlight";
22                 pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
23                 enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
24                 /* Backlight configuration differs per PinePhone revision. */
25         };
26
27         chosen {
28                 stdout-path = "serial0:115200n8";
29         };
30
31         leds {
32                 compatible = "gpio-leds";
33
34                 blue {
35                         function = LED_FUNCTION_INDICATOR;
36                         color = <LED_COLOR_ID_BLUE>;
37                         gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
38                 };
39
40                 green {
41                         function = LED_FUNCTION_INDICATOR;
42                         color = <LED_COLOR_ID_GREEN>;
43                         gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
44                 };
45
46                 red {
47                         function = LED_FUNCTION_INDICATOR;
48                         color = <LED_COLOR_ID_RED>;
49                         gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
50                 };
51         };
52
53         reg_vbat_wifi: vbat-wifi {
54                 compatible = "regulator-fixed";
55                 regulator-min-microvolt = <3300000>;
56                 regulator-max-microvolt = <3300000>;
57                 regulator-name = "vbat-wifi";
58         };
59
60         sgm3140: led-controller {
61                 compatible = "sgmicro,sgm3140";
62                 vin-supply = <&reg_dcdc1>;
63
64                 sgm3140_flash: led {
65                         function = LED_FUNCTION_FLASH;
66                         color = <LED_COLOR_ID_WHITE>;
67                         flash-max-timeout-us = <250000>;
68                 };
69         };
70
71         speaker_amp: audio-amplifier {
72                 compatible = "simple-audio-amplifier";
73                 enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
74                 sound-name-prefix = "Speaker Amp";
75         };
76
77         vibrator {
78                 compatible = "gpio-vibrator";
79                 enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
80                 vcc-supply = <&reg_dcdc1>;
81         };
82 };
83
84 &codec {
85         status = "okay";
86 };
87
88 &codec_analog {
89         cpvdd-supply = <&reg_eldo1>;
90         status = "okay";
91 };
92
93 &cpu0 {
94         cpu-supply = <&reg_dcdc2>;
95 };
96
97 &cpu1 {
98         cpu-supply = <&reg_dcdc2>;
99 };
100
101 &cpu2 {
102         cpu-supply = <&reg_dcdc2>;
103 };
104
105 &cpu3 {
106         cpu-supply = <&reg_dcdc2>;
107 };
108
109 &dai {
110         status = "okay";
111 };
112
113 &de {
114         status = "okay";
115 };
116
117 &dphy {
118         status = "okay";
119 };
120
121 &dsi {
122         vcc-dsi-supply = <&reg_dldo1>;
123         status = "okay";
124
125         panel@0 {
126                 compatible = "xingbangda,xbd599";
127                 reg = <0>;
128                 reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
129                 iovcc-supply = <&reg_dldo2>;
130                 vcc-supply = <&reg_ldo_io0>;
131                 backlight = <&backlight>;
132         };
133 };
134
135 &ehci0 {
136         status = "okay";
137 };
138
139 &ehci1 {
140         status = "okay";
141 };
142
143 &i2c0 {
144         status = "okay";
145
146         touchscreen@5d {
147                 compatible = "goodix,gt917s";
148                 reg = <0x5d>;
149                 interrupt-parent = <&pio>;
150                 interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
151                 irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
152                 reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
153                 AVDD28-supply = <&reg_ldo_io0>;
154                 VDDIO-supply = <&reg_ldo_io0>;
155                 touchscreen-size-x = <720>;
156                 touchscreen-size-y = <1440>;
157         };
158 };
159
160 &i2c1 {
161         status = "okay";
162
163         /* Magnetometer */
164         lis3mdl: magnetometer@1e {
165                 compatible = "st,lis3mdl-magn";
166                 reg = <0x1e>;
167                 vdd-supply = <&reg_dldo1>;
168                 vddio-supply = <&reg_dldo1>;
169         };
170
171         /* Light/proximity sensor */
172         light-sensor@48 {
173                 compatible = "sensortek,stk3311";
174                 reg = <0x48>;
175                 interrupt-parent = <&pio>;
176                 interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
177                 vdd-supply = <&reg_ldo_io0>;
178                 leda-supply = <&reg_dldo1>;
179         };
180
181         /* Accelerometer/gyroscope */
182         accelerometer@68 {
183                 compatible = "invensense,mpu6050";
184                 reg = <0x68>;
185                 interrupt-parent = <&pio>;
186                 interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
187                 vdd-supply = <&reg_dldo1>;
188                 vddio-supply = <&reg_dldo1>;
189         };
190 };
191
192 /* Connected to pogo pins (external spring based pinheader for user addons) */
193 &i2c2 {
194         status = "okay";
195 };
196
197 &lradc {
198         vref-supply = <&reg_aldo3>;
199         status = "okay";
200
201         button-200 {
202                 label = "Volume Up";
203                 linux,code = <KEY_VOLUMEUP>;
204                 channel = <0>;
205                 voltage = <200000>;
206         };
207
208         button-400 {
209                 label = "Volume Down";
210                 linux,code = <KEY_VOLUMEDOWN>;
211                 channel = <0>;
212                 voltage = <400000>;
213         };
214 };
215
216 &mmc0 {
217         pinctrl-names = "default";
218         pinctrl-0 = <&mmc0_pins>;
219         vmmc-supply = <&reg_dcdc1>;
220         vqmmc-supply = <&reg_dcdc1>;
221         cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
222         disable-wp;
223         bus-width = <4>;
224         status = "okay";
225 };
226
227 &mmc1 {
228         pinctrl-names = "default";
229         pinctrl-0 = <&mmc1_pins>;
230         vmmc-supply = <&reg_vbat_wifi>;
231         vqmmc-supply = <&reg_dldo4>;
232         bus-width = <4>;
233         non-removable;
234         status = "okay";
235
236         rtl8723cs: wifi@1 {
237                 reg = <1>;
238         };
239 };
240
241 &mmc2 {
242         pinctrl-names = "default";
243         pinctrl-0 = <&mmc2_pins>;
244         vmmc-supply = <&reg_dcdc1>;
245         vqmmc-supply = <&reg_dcdc1>;
246         bus-width = <8>;
247         non-removable;
248         cap-mmc-hw-reset;
249         status = "okay";
250 };
251
252 &ohci0 {
253         status = "okay";
254 };
255
256 &ohci1 {
257         status = "okay";
258 };
259
260 &pio {
261         vcc-pb-supply = <&reg_dcdc1>;
262         vcc-pc-supply = <&reg_dcdc1>;
263         vcc-pd-supply = <&reg_dcdc1>;
264         vcc-pe-supply = <&reg_aldo1>;
265         vcc-pf-supply = <&reg_dcdc1>;
266         vcc-pg-supply = <&reg_dldo4>;
267         vcc-ph-supply = <&reg_dcdc1>;
268 };
269
270 &r_pio {
271         /*
272          * FIXME: We can't add that supply for now since it would
273          * create a circular dependency between pinctrl, the regulator
274          * and the RSB Bus.
275          *
276          * vcc-pl-supply = <&reg_aldo2>;
277          */
278 };
279
280 &r_pwm {
281         status = "okay";
282 };
283
284 &r_rsb {
285         status = "okay";
286
287         axp803: pmic@3a3 {
288                 compatible = "x-powers,axp803";
289                 reg = <0x3a3>;
290                 interrupt-parent = <&r_intc>;
291                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
292         };
293 };
294
295 #include "axp803.dtsi"
296
297 &battery_power_supply {
298         status = "okay";
299 };
300
301 &reg_aldo1 {
302         regulator-min-microvolt = <1800000>;
303         regulator-max-microvolt = <1800000>;
304         regulator-name = "dovdd-csi";
305 };
306
307 &reg_aldo2 {
308         regulator-always-on;
309         regulator-min-microvolt = <1800000>;
310         regulator-max-microvolt = <1800000>;
311         regulator-name = "vcc-pl";
312 };
313
314 &reg_aldo3 {
315         regulator-always-on;
316         regulator-min-microvolt = <3000000>;
317         regulator-max-microvolt = <3000000>;
318         regulator-name = "vcc-pll-avcc";
319 };
320
321 &reg_dcdc1 {
322         regulator-always-on;
323         regulator-min-microvolt = <3300000>;
324         regulator-max-microvolt = <3300000>;
325         regulator-name = "vcc-3v3";
326 };
327
328 &reg_dcdc2 {
329         regulator-always-on;
330         regulator-min-microvolt = <1000000>;
331         regulator-max-microvolt = <1300000>;
332         regulator-name = "vdd-cpux";
333 };
334
335 /* DCDC3 is polyphased with DCDC2 */
336
337 &reg_dcdc5 {
338         regulator-always-on;
339         regulator-min-microvolt = <1200000>;
340         regulator-max-microvolt = <1200000>;
341         regulator-name = "vcc-dram";
342 };
343
344 &reg_dcdc6 {
345         regulator-always-on;
346         regulator-min-microvolt = <1100000>;
347         regulator-max-microvolt = <1100000>;
348         regulator-name = "vdd-sys";
349 };
350
351 &reg_dldo1 {
352         regulator-min-microvolt = <3300000>;
353         regulator-max-microvolt = <3300000>;
354         regulator-name = "vcc-dsi-sensor";
355 };
356
357 &reg_dldo2 {
358         regulator-min-microvolt = <1800000>;
359         regulator-max-microvolt = <1800000>;
360         regulator-name = "vcc-mipi-io";
361 };
362
363 &reg_dldo3 {
364         regulator-min-microvolt = <2800000>;
365         regulator-max-microvolt = <2800000>;
366         regulator-name = "avdd-csi";
367 };
368
369 &reg_dldo4 {
370         regulator-min-microvolt = <1800000>;
371         regulator-max-microvolt = <1800000>;
372         regulator-name = "vcc-wifi-io";
373 };
374
375 &reg_eldo1 {
376         regulator-always-on;
377         regulator-min-microvolt = <1800000>;
378         regulator-max-microvolt = <1800000>;
379         regulator-name = "vcc-lpddr";
380 };
381
382 &reg_eldo3 {
383         regulator-min-microvolt = <1800000>;
384         regulator-max-microvolt = <1800000>;
385         regulator-name = "dvdd-1v8-csi";
386 };
387
388 &reg_fldo1 {
389         regulator-min-microvolt = <1200000>;
390         regulator-max-microvolt = <1200000>;
391         regulator-name = "vcc-1v2-hsic";
392 };
393
394 &reg_fldo2 {
395         regulator-always-on;
396         regulator-min-microvolt = <1100000>;
397         regulator-max-microvolt = <1100000>;
398         regulator-name = "vdd-cpus";
399 };
400
401 &reg_ldo_io0 {
402         regulator-min-microvolt = <3300000>;
403         regulator-max-microvolt = <3300000>;
404         regulator-name = "vcc-lcd-ctp-stk";
405         status = "okay";
406 };
407
408 &reg_ldo_io1 {
409         regulator-min-microvolt = <1800000>;
410         regulator-max-microvolt = <1800000>;
411         regulator-name = "vcc-1v8-typec";
412         status = "okay";
413 };
414
415 &reg_rtc_ldo {
416         regulator-name = "vcc-rtc";
417 };
418
419 &sound {
420         status = "okay";
421         simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
422         simple-audio-card,widgets = "Microphone", "Headset Microphone",
423                                     "Microphone", "Internal Microphone",
424                                     "Headphone", "Headphone Jack",
425                                     "Speaker", "Internal Earpiece",
426                                     "Speaker", "Internal Speaker";
427         simple-audio-card,routing =
428                         "Headphone Jack", "HP",
429                         "Internal Earpiece", "EARPIECE",
430                         "Internal Speaker", "Speaker Amp OUTL",
431                         "Internal Speaker", "Speaker Amp OUTR",
432                         "Speaker Amp INL", "LINEOUT",
433                         "Speaker Amp INR", "LINEOUT",
434                         "Left DAC", "DACL",
435                         "Right DAC", "DACR",
436                         "ADCL", "Left ADC",
437                         "ADCR", "Right ADC",
438                         "Internal Microphone", "MBIAS",
439                         "MIC1", "Internal Microphone",
440                         "Headset Microphone", "HBIAS",
441                         "MIC2", "Headset Microphone";
442 };
443
444 &uart0 {
445         pinctrl-names = "default";
446         pinctrl-0 = <&uart0_pb_pins>;
447         status = "okay";
448 };
449
450 &uart1 {
451         pinctrl-names = "default";
452         pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
453         status = "okay";
454
455         bluetooth {
456                 compatible = "realtek,rtl8723cs-bt";
457                 device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
458                 enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
459                 host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
460         };
461 };
462
463 /* Connected to the modem (hardware flow control can't be used) */
464 &uart3 {
465         pinctrl-names = "default";
466         pinctrl-0 = <&uart3_pins>;
467         status = "okay";
468 };
469
470 &usb_otg {
471         dr_mode = "peripheral";
472         status = "okay";
473 };
474
475 &usb_power_supply {
476         status = "okay";
477 };
478
479 &usbphy {
480         status = "okay";
481 };