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>
16 ethernet0 = &rtl8723cs;
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 power-supply = <®_ps>;
25 /* Backlight configuration differs per PinePhone revision. */
28 bt_sco_codec: bt-sco-codec {
29 #sound-dai-cells = <1>;
30 compatible = "linux,bt-sco";
34 stdout-path = "serial0:115200n8";
38 compatible = "gpio-leds";
41 function = LED_FUNCTION_INDICATOR;
42 color = <LED_COLOR_ID_BLUE>;
43 gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
47 function = LED_FUNCTION_INDICATOR;
48 color = <LED_COLOR_ID_GREEN>;
49 gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
53 function = LED_FUNCTION_INDICATOR;
54 color = <LED_COLOR_ID_RED>;
55 gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
59 reg_ps: ps-regulator {
60 compatible = "regulator-fixed";
61 regulator-name = "ps";
62 regulator-min-microvolt = <5000000>;
63 regulator-max-microvolt = <5000000>;
67 reg_vbat_wifi: vbat-wifi {
68 compatible = "regulator-fixed";
69 regulator-min-microvolt = <3300000>;
70 regulator-max-microvolt = <3300000>;
71 regulator-name = "vbat-wifi";
74 sgm3140: led-controller {
75 compatible = "sgmicro,sgm3140";
76 vin-supply = <®_dcdc1>;
79 function = LED_FUNCTION_FLASH;
80 color = <LED_COLOR_ID_WHITE>;
81 flash-max-timeout-us = <250000>;
85 speaker_amp: audio-amplifier {
86 compatible = "simple-audio-amplifier";
87 enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
88 sound-name-prefix = "Speaker Amp";
92 compatible = "gpio-vibrator";
93 enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
94 vcc-supply = <®_dcdc1>;
99 pinctrl-names = "default";
100 pinctrl-0 = <&aif3_pins>;
105 cpvdd-supply = <®_eldo1>;
110 cpu-supply = <®_dcdc2>;
114 cpu-supply = <®_dcdc2>;
118 cpu-supply = <®_dcdc2>;
122 cpu-supply = <®_dcdc2>;
138 vcc-dsi-supply = <®_dldo1>;
142 compatible = "xingbangda,xbd599";
144 reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
145 iovcc-supply = <®_dldo2>;
146 vcc-supply = <®_ldo_io0>;
147 backlight = <&backlight>;
163 compatible = "goodix,gt917s";
165 interrupt-parent = <&pio>;
166 interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
167 irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
168 reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
169 AVDD28-supply = <®_ldo_io0>;
170 VDDIO-supply = <®_ldo_io0>;
171 touchscreen-size-x = <720>;
172 touchscreen-size-y = <1440>;
180 lis3mdl: magnetometer@1e {
181 compatible = "st,lis3mdl-magn";
183 vdd-supply = <®_dldo1>;
184 vddio-supply = <®_dldo1>;
187 /* Light/proximity sensor */
189 compatible = "sensortek,stk3311";
191 interrupt-parent = <&pio>;
192 interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
195 /* Accelerometer/gyroscope */
197 compatible = "invensense,mpu6050";
199 interrupt-parent = <&pio>;
200 interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
201 vdd-supply = <®_dldo1>;
202 vddio-supply = <®_dldo1>;
206 /* Connected to pogo pins (external spring based pinheader for user addons) */
212 vref-supply = <®_aldo3>;
218 linux,code = <KEY_VOLUMEUP>;
224 label = "Volume Down";
225 linux,code = <KEY_VOLUMEDOWN>;
232 pinctrl-names = "default";
233 pinctrl-0 = <&mmc0_pins>;
234 vmmc-supply = <®_dcdc1>;
235 vqmmc-supply = <®_dcdc1>;
236 cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
243 pinctrl-names = "default";
244 pinctrl-0 = <&mmc1_pins>;
245 vmmc-supply = <®_vbat_wifi>;
246 vqmmc-supply = <®_dldo4>;
257 pinctrl-names = "default";
258 pinctrl-0 = <&mmc2_pins>;
259 vmmc-supply = <®_dcdc1>;
260 vqmmc-supply = <®_dcdc1>;
276 vcc-pb-supply = <®_dcdc1>;
277 vcc-pc-supply = <®_dcdc1>;
278 vcc-pd-supply = <®_dcdc1>;
279 vcc-pe-supply = <®_aldo1>;
280 vcc-pf-supply = <®_dcdc1>;
281 vcc-pg-supply = <®_dldo4>;
282 vcc-ph-supply = <®_dcdc1>;
287 * FIXME: We can't add that supply for now since it would
288 * create a circular dependency between pinctrl, the regulator
291 * vcc-pl-supply = <®_aldo2>;
303 compatible = "x-powers,axp803";
305 interrupt-parent = <&r_intc>;
306 interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
310 #include "axp803.dtsi"
312 &battery_power_supply {
317 regulator-min-microvolt = <1800000>;
318 regulator-max-microvolt = <1800000>;
319 regulator-name = "dovdd-csi";
324 regulator-min-microvolt = <1800000>;
325 regulator-max-microvolt = <1800000>;
326 regulator-name = "vcc-pl";
331 regulator-min-microvolt = <3000000>;
332 regulator-max-microvolt = <3000000>;
333 regulator-name = "vcc-pll-avcc";
338 regulator-min-microvolt = <3300000>;
339 regulator-max-microvolt = <3300000>;
340 regulator-name = "vcc-3v3";
345 regulator-min-microvolt = <1000000>;
346 regulator-max-microvolt = <1300000>;
347 regulator-name = "vdd-cpux";
350 /* DCDC3 is polyphased with DCDC2 */
354 regulator-min-microvolt = <1200000>;
355 regulator-max-microvolt = <1200000>;
356 regulator-name = "vcc-dram";
361 regulator-min-microvolt = <1100000>;
362 regulator-max-microvolt = <1100000>;
363 regulator-name = "vdd-sys";
367 regulator-min-microvolt = <3300000>;
368 regulator-max-microvolt = <3300000>;
369 regulator-name = "vcc-dsi-sensor";
373 regulator-min-microvolt = <1800000>;
374 regulator-max-microvolt = <1800000>;
375 regulator-name = "vcc-mipi-io";
379 regulator-min-microvolt = <2800000>;
380 regulator-max-microvolt = <2800000>;
381 regulator-name = "avdd-csi";
385 regulator-min-microvolt = <1800000>;
386 regulator-max-microvolt = <1800000>;
387 regulator-name = "vcc-wifi-io";
392 regulator-min-microvolt = <1800000>;
393 regulator-max-microvolt = <1800000>;
394 regulator-name = "vcc-lpddr";
398 regulator-min-microvolt = <1800000>;
399 regulator-max-microvolt = <1800000>;
400 regulator-name = "dvdd-1v8-csi";
404 regulator-min-microvolt = <1200000>;
405 regulator-max-microvolt = <1200000>;
406 regulator-name = "vcc-1v2-hsic";
411 regulator-min-microvolt = <1100000>;
412 regulator-max-microvolt = <1100000>;
413 regulator-name = "vdd-cpus";
417 regulator-min-microvolt = <3300000>;
418 regulator-max-microvolt = <3300000>;
419 regulator-name = "vcc-lcd-ctp-stk";
424 regulator-min-microvolt = <1800000>;
425 regulator-max-microvolt = <1800000>;
426 regulator-name = "vcc-1v8-typec";
431 regulator-name = "vcc-rtc";
436 simple-audio-card,name = "PinePhone";
437 simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
438 simple-audio-card,widgets = "Microphone", "Headset Microphone",
439 "Microphone", "Internal Microphone",
440 "Headphone", "Headphone Jack",
441 "Speaker", "Internal Earpiece",
442 "Speaker", "Internal Speaker";
443 simple-audio-card,routing =
444 "Headphone Jack", "HP",
445 "Internal Earpiece", "EARPIECE",
446 "Internal Speaker", "Speaker Amp OUTL",
447 "Internal Speaker", "Speaker Amp OUTR",
448 "Speaker Amp INL", "LINEOUT",
449 "Speaker Amp INR", "LINEOUT",
454 "Internal Microphone", "MBIAS",
455 "MIC1", "Internal Microphone",
456 "Headset Microphone", "HBIAS",
457 "MIC2", "Headset Microphone";
459 simple-audio-card,dai-link@2 {
461 frame-master = <&link2_codec>;
462 bitclock-master = <&link2_codec>;
466 sound-dai = <&bt_sco_codec 0>;
470 sound-dai = <&codec 2>;
471 dai-tdm-slot-num = <1>;
472 dai-tdm-slot-width = <32>;
478 pinctrl-names = "default";
479 pinctrl-0 = <&uart0_pb_pins>;
484 pinctrl-names = "default";
485 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
489 compatible = "realtek,rtl8723cs-bt";
490 device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
491 enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
492 host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
496 /* Connected to the modem (hardware flow control can't be used) */
498 pinctrl-names = "default";
499 pinctrl-0 = <&uart3_pins>;
504 dr_mode = "peripheral";