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>
6 #include "sun50i-a64.dtsi"
7 #include "sun50i-a64-cpu-opp.dtsi"
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>
15 chassis-type = "handset";
18 ethernet0 = &rtl8723cs;
22 backlight: backlight {
23 compatible = "pwm-backlight";
24 pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
25 enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
26 power-supply = <®_ps>;
27 /* Backlight configuration differs per PinePhone revision. */
30 bt_sco_codec: bt-sco-codec {
31 #sound-dai-cells = <1>;
32 compatible = "linux,bt-sco";
36 stdout-path = "serial0:115200n8";
40 compatible = "gpio-leds";
43 function = LED_FUNCTION_INDICATOR;
44 color = <LED_COLOR_ID_BLUE>;
45 gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
49 function = LED_FUNCTION_INDICATOR;
50 color = <LED_COLOR_ID_GREEN>;
51 gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
55 function = LED_FUNCTION_INDICATOR;
56 color = <LED_COLOR_ID_RED>;
57 gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
61 reg_ps: ps-regulator {
62 compatible = "regulator-fixed";
63 regulator-name = "ps";
64 regulator-min-microvolt = <5000000>;
65 regulator-max-microvolt = <5000000>;
69 reg_vbat_wifi: vbat-wifi {
70 compatible = "regulator-fixed";
71 regulator-min-microvolt = <3300000>;
72 regulator-max-microvolt = <3300000>;
73 regulator-name = "vbat-wifi";
76 sgm3140: led-controller {
77 compatible = "sgmicro,sgm3140";
78 vin-supply = <®_dcdc1>;
81 function = LED_FUNCTION_FLASH;
82 color = <LED_COLOR_ID_WHITE>;
83 flash-max-timeout-us = <250000>;
87 speaker_amp: audio-amplifier {
88 compatible = "simple-audio-amplifier";
89 enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
90 sound-name-prefix = "Speaker Amp";
94 compatible = "gpio-vibrator";
95 enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
96 vcc-supply = <®_dcdc1>;
101 pinctrl-names = "default";
102 pinctrl-0 = <&aif3_pins>;
107 cpvdd-supply = <®_eldo1>;
112 cpu-supply = <®_dcdc2>;
116 cpu-supply = <®_dcdc2>;
120 cpu-supply = <®_dcdc2>;
124 cpu-supply = <®_dcdc2>;
140 vcc-dsi-supply = <®_dldo1>;
144 compatible = "xingbangda,xbd599";
146 reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
147 iovcc-supply = <®_dldo2>;
148 vcc-supply = <®_ldo_io0>;
149 backlight = <&backlight>;
165 compatible = "goodix,gt917s";
167 interrupt-parent = <&pio>;
168 interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
169 irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
170 reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
171 AVDD28-supply = <®_ldo_io0>;
172 VDDIO-supply = <®_ldo_io0>;
173 touchscreen-size-x = <720>;
174 touchscreen-size-y = <1440>;
182 lis3mdl: magnetometer@1e {
183 compatible = "st,lis3mdl-magn";
185 vdd-supply = <®_dldo1>;
186 vddio-supply = <®_dldo1>;
189 /* Light/proximity sensor */
191 compatible = "sensortek,stk3311";
193 interrupt-parent = <&pio>;
194 interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
197 /* Accelerometer/gyroscope */
199 compatible = "invensense,mpu6050";
201 interrupt-parent = <&pio>;
202 interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
203 vdd-supply = <®_dldo1>;
204 vddio-supply = <®_dldo1>;
208 /* Connected to pogo pins (external spring based pinheader for user addons) */
214 vref-supply = <®_aldo3>;
220 linux,code = <KEY_VOLUMEUP>;
226 label = "Volume Down";
227 linux,code = <KEY_VOLUMEDOWN>;
234 pinctrl-names = "default";
235 pinctrl-0 = <&mmc0_pins>;
236 vmmc-supply = <®_dcdc1>;
237 vqmmc-supply = <®_dcdc1>;
238 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
245 pinctrl-names = "default";
246 pinctrl-0 = <&mmc1_pins>;
247 vmmc-supply = <®_vbat_wifi>;
248 vqmmc-supply = <®_dldo4>;
259 pinctrl-names = "default";
260 pinctrl-0 = <&mmc2_pins>;
261 vmmc-supply = <®_dcdc1>;
262 vqmmc-supply = <®_dcdc1>;
278 vcc-pb-supply = <®_dcdc1>;
279 vcc-pc-supply = <®_dcdc1>;
280 vcc-pd-supply = <®_dcdc1>;
281 vcc-pe-supply = <®_aldo1>;
282 vcc-pf-supply = <®_dcdc1>;
283 vcc-pg-supply = <®_dldo4>;
284 vcc-ph-supply = <®_dcdc1>;
289 * FIXME: We can't add that supply for now since it would
290 * create a circular dependency between pinctrl, the regulator
293 * vcc-pl-supply = <®_aldo2>;
305 compatible = "x-powers,axp803";
307 interrupt-parent = <&r_intc>;
308 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
312 #include "axp803.dtsi"
314 &battery_power_supply {
319 regulator-min-microvolt = <1800000>;
320 regulator-max-microvolt = <1800000>;
321 regulator-name = "dovdd-csi";
326 regulator-min-microvolt = <1800000>;
327 regulator-max-microvolt = <1800000>;
328 regulator-name = "vcc-pl";
333 regulator-min-microvolt = <3000000>;
334 regulator-max-microvolt = <3000000>;
335 regulator-name = "vcc-pll-avcc";
340 regulator-min-microvolt = <3300000>;
341 regulator-max-microvolt = <3300000>;
342 regulator-name = "vcc-3v3";
347 regulator-min-microvolt = <1000000>;
348 regulator-max-microvolt = <1300000>;
349 regulator-name = "vdd-cpux";
352 /* DCDC3 is polyphased with DCDC2 */
356 regulator-min-microvolt = <1200000>;
357 regulator-max-microvolt = <1200000>;
358 regulator-name = "vcc-dram";
363 regulator-min-microvolt = <1100000>;
364 regulator-max-microvolt = <1100000>;
365 regulator-name = "vdd-sys";
369 regulator-min-microvolt = <3300000>;
370 regulator-max-microvolt = <3300000>;
371 regulator-name = "vcc-dsi-sensor";
375 regulator-min-microvolt = <1800000>;
376 regulator-max-microvolt = <1800000>;
377 regulator-name = "vcc-mipi-io";
381 regulator-min-microvolt = <2800000>;
382 regulator-max-microvolt = <2800000>;
383 regulator-name = "avdd-csi";
387 regulator-min-microvolt = <1800000>;
388 regulator-max-microvolt = <1800000>;
389 regulator-name = "vcc-wifi-io";
394 regulator-min-microvolt = <1800000>;
395 regulator-max-microvolt = <1800000>;
396 regulator-name = "vcc-lpddr";
400 regulator-min-microvolt = <1800000>;
401 regulator-max-microvolt = <1800000>;
402 regulator-name = "dvdd-1v8-csi";
406 regulator-min-microvolt = <1200000>;
407 regulator-max-microvolt = <1200000>;
408 regulator-name = "vcc-1v2-hsic";
413 regulator-min-microvolt = <1100000>;
414 regulator-max-microvolt = <1100000>;
415 regulator-name = "vdd-cpus";
419 regulator-min-microvolt = <3300000>;
420 regulator-max-microvolt = <3300000>;
421 regulator-name = "vcc-lcd-ctp-stk";
426 regulator-min-microvolt = <1800000>;
427 regulator-max-microvolt = <1800000>;
428 regulator-name = "vcc-1v8-typec";
433 regulator-name = "vcc-rtc";
438 simple-audio-card,name = "PinePhone";
439 simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
440 simple-audio-card,widgets = "Microphone", "Headset Microphone",
441 "Microphone", "Internal Microphone",
442 "Headphone", "Headphone Jack",
443 "Speaker", "Internal Earpiece",
444 "Speaker", "Internal Speaker";
445 simple-audio-card,routing =
446 "Headphone Jack", "HP",
447 "Internal Earpiece", "EARPIECE",
448 "Internal Speaker", "Speaker Amp OUTL",
449 "Internal Speaker", "Speaker Amp OUTR",
450 "Speaker Amp INL", "LINEOUT",
451 "Speaker Amp INR", "LINEOUT",
456 "Internal Microphone", "MBIAS",
457 "MIC1", "Internal Microphone",
458 "Headset Microphone", "HBIAS",
459 "MIC2", "Headset Microphone";
461 simple-audio-card,dai-link@2 {
463 frame-master = <&link2_codec>;
464 bitclock-master = <&link2_codec>;
468 sound-dai = <&bt_sco_codec 0>;
472 sound-dai = <&codec 2>;
473 dai-tdm-slot-num = <1>;
474 dai-tdm-slot-width = <32>;
480 pinctrl-names = "default";
481 pinctrl-0 = <&uart0_pb_pins>;
486 pinctrl-names = "default";
487 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
491 compatible = "realtek,rtl8723cs-bt";
492 device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
493 enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
494 host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
498 /* Connected to the modem (hardware flow control can't be used) */
500 pinctrl-names = "default";
501 pinctrl-0 = <&uart3_pins>;
506 dr_mode = "peripheral";