191f480d4SOndrej Jirman// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
291f480d4SOndrej Jirman// Copyright (C) 2019 Icenowy Zheng <icenowy@aosc.xyz>
391f480d4SOndrej Jirman// Copyright (C) 2020 Martijn Braam <martijn@brixit.nl>
491f480d4SOndrej Jirman// Copyright (C) 2020 Ondrej Jirman <megous@megous.com>
591f480d4SOndrej Jirman
691f480d4SOndrej Jirman#include "sun50i-a64.dtsi"
791f480d4SOndrej Jirman#include "sun50i-a64-cpu-opp.dtsi"
891f480d4SOndrej Jirman
991f480d4SOndrej Jirman#include <dt-bindings/gpio/gpio.h>
1091f480d4SOndrej Jirman#include <dt-bindings/input/input.h>
1191f480d4SOndrej Jirman#include <dt-bindings/leds/common.h>
1291f480d4SOndrej Jirman#include <dt-bindings/pwm/pwm.h>
1391f480d4SOndrej Jirman
1491f480d4SOndrej Jirman/ {
1591f480d4SOndrej Jirman	aliases {
164fcf6f34SOndrej Jirman		ethernet0 = &rtl8723cs;
1791f480d4SOndrej Jirman		serial0 = &uart0;
1891f480d4SOndrej Jirman	};
1991f480d4SOndrej Jirman
20a6a22f82SIcenowy Zheng	backlight: backlight {
21a6a22f82SIcenowy Zheng		compatible = "pwm-backlight";
22a6a22f82SIcenowy Zheng		pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
23a6a22f82SIcenowy Zheng		enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
2486131fb9SMaxime Ripard		power-supply = <&reg_ps>;
25a6a22f82SIcenowy Zheng		/* Backlight configuration differs per PinePhone revision. */
26a6a22f82SIcenowy Zheng	};
27a6a22f82SIcenowy Zheng
2836777d96SSamuel Holland	bt_sco_codec: bt-sco-codec {
2936777d96SSamuel Holland		#sound-dai-cells = <1>;
3036777d96SSamuel Holland		compatible = "linux,bt-sco";
3136777d96SSamuel Holland	};
3236777d96SSamuel Holland
3391f480d4SOndrej Jirman	chosen {
3491f480d4SOndrej Jirman		stdout-path = "serial0:115200n8";
3591f480d4SOndrej Jirman	};
3691f480d4SOndrej Jirman
3791f480d4SOndrej Jirman	leds {
3891f480d4SOndrej Jirman		compatible = "gpio-leds";
3991f480d4SOndrej Jirman
40e299e6ddSMaxime Ripard		led-0 {
4191f480d4SOndrej Jirman			function = LED_FUNCTION_INDICATOR;
4291f480d4SOndrej Jirman			color = <LED_COLOR_ID_BLUE>;
4391f480d4SOndrej Jirman			gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
4491f480d4SOndrej Jirman		};
4591f480d4SOndrej Jirman
46e299e6ddSMaxime Ripard		led-1 {
4791f480d4SOndrej Jirman			function = LED_FUNCTION_INDICATOR;
4891f480d4SOndrej Jirman			color = <LED_COLOR_ID_GREEN>;
4991f480d4SOndrej Jirman			gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
5091f480d4SOndrej Jirman		};
5191f480d4SOndrej Jirman
52e299e6ddSMaxime Ripard		led-2 {
5391f480d4SOndrej Jirman			function = LED_FUNCTION_INDICATOR;
5491f480d4SOndrej Jirman			color = <LED_COLOR_ID_RED>;
5591f480d4SOndrej Jirman			gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
5691f480d4SOndrej Jirman		};
5791f480d4SOndrej Jirman	};
5891f480d4SOndrej Jirman
5986131fb9SMaxime Ripard	reg_ps: ps-regulator {
6086131fb9SMaxime Ripard		compatible = "regulator-fixed";
6186131fb9SMaxime Ripard		regulator-name = "ps";
6286131fb9SMaxime Ripard		regulator-min-microvolt = <5000000>;
6386131fb9SMaxime Ripard		regulator-max-microvolt = <5000000>;
6486131fb9SMaxime Ripard		regulator-boot-on;
6586131fb9SMaxime Ripard	};
6686131fb9SMaxime Ripard
674fcf6f34SOndrej Jirman	reg_vbat_wifi: vbat-wifi {
684fcf6f34SOndrej Jirman		compatible = "regulator-fixed";
694fcf6f34SOndrej Jirman		regulator-min-microvolt = <3300000>;
704fcf6f34SOndrej Jirman		regulator-max-microvolt = <3300000>;
714fcf6f34SOndrej Jirman		regulator-name = "vbat-wifi";
724fcf6f34SOndrej Jirman	};
734fcf6f34SOndrej Jirman
74085d96b8SLuca Weiss	sgm3140: led-controller {
75085d96b8SLuca Weiss		compatible = "sgmicro,sgm3140";
76085d96b8SLuca Weiss		vin-supply = <&reg_dcdc1>;
77085d96b8SLuca Weiss
78085d96b8SLuca Weiss		sgm3140_flash: led {
79085d96b8SLuca Weiss			function = LED_FUNCTION_FLASH;
80085d96b8SLuca Weiss			color = <LED_COLOR_ID_WHITE>;
81085d96b8SLuca Weiss			flash-max-timeout-us = <250000>;
82085d96b8SLuca Weiss		};
83085d96b8SLuca Weiss	};
84085d96b8SLuca Weiss
8591f480d4SOndrej Jirman	speaker_amp: audio-amplifier {
8691f480d4SOndrej Jirman		compatible = "simple-audio-amplifier";
8791f480d4SOndrej Jirman		enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
8891f480d4SOndrej Jirman		sound-name-prefix = "Speaker Amp";
8991f480d4SOndrej Jirman	};
9091f480d4SOndrej Jirman
9191f480d4SOndrej Jirman	vibrator {
9291f480d4SOndrej Jirman		compatible = "gpio-vibrator";
9391f480d4SOndrej Jirman		enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
9491f480d4SOndrej Jirman		vcc-supply = <&reg_dcdc1>;
9591f480d4SOndrej Jirman	};
9691f480d4SOndrej Jirman};
9791f480d4SOndrej Jirman
9891f480d4SOndrej Jirman&codec {
9936777d96SSamuel Holland	pinctrl-names = "default";
10036777d96SSamuel Holland	pinctrl-0 = <&aif3_pins>;
10191f480d4SOndrej Jirman	status = "okay";
10291f480d4SOndrej Jirman};
10391f480d4SOndrej Jirman
10491f480d4SOndrej Jirman&codec_analog {
10591f480d4SOndrej Jirman	cpvdd-supply = <&reg_eldo1>;
10691f480d4SOndrej Jirman	status = "okay";
10791f480d4SOndrej Jirman};
10891f480d4SOndrej Jirman
10991f480d4SOndrej Jirman&cpu0 {
11091f480d4SOndrej Jirman	cpu-supply = <&reg_dcdc2>;
11191f480d4SOndrej Jirman};
11291f480d4SOndrej Jirman
11391f480d4SOndrej Jirman&cpu1 {
11491f480d4SOndrej Jirman	cpu-supply = <&reg_dcdc2>;
11591f480d4SOndrej Jirman};
11691f480d4SOndrej Jirman
11791f480d4SOndrej Jirman&cpu2 {
11891f480d4SOndrej Jirman	cpu-supply = <&reg_dcdc2>;
11991f480d4SOndrej Jirman};
12091f480d4SOndrej Jirman
12191f480d4SOndrej Jirman&cpu3 {
12291f480d4SOndrej Jirman	cpu-supply = <&reg_dcdc2>;
12391f480d4SOndrej Jirman};
12491f480d4SOndrej Jirman
12591f480d4SOndrej Jirman&dai {
12691f480d4SOndrej Jirman	status = "okay";
12791f480d4SOndrej Jirman};
12891f480d4SOndrej Jirman
129a6a22f82SIcenowy Zheng&de {
130a6a22f82SIcenowy Zheng	status = "okay";
131a6a22f82SIcenowy Zheng};
132a6a22f82SIcenowy Zheng
133a6a22f82SIcenowy Zheng&dphy {
134a6a22f82SIcenowy Zheng	status = "okay";
135a6a22f82SIcenowy Zheng};
136a6a22f82SIcenowy Zheng
137a6a22f82SIcenowy Zheng&dsi {
138a6a22f82SIcenowy Zheng	vcc-dsi-supply = <&reg_dldo1>;
139a6a22f82SIcenowy Zheng	status = "okay";
140a6a22f82SIcenowy Zheng
141a6a22f82SIcenowy Zheng	panel@0 {
142a6a22f82SIcenowy Zheng		compatible = "xingbangda,xbd599";
143a6a22f82SIcenowy Zheng		reg = <0>;
144a6a22f82SIcenowy Zheng		reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
145a6a22f82SIcenowy Zheng		iovcc-supply = <&reg_dldo2>;
146a6a22f82SIcenowy Zheng		vcc-supply = <&reg_ldo_io0>;
147a6a22f82SIcenowy Zheng		backlight = <&backlight>;
148a6a22f82SIcenowy Zheng	};
149a6a22f82SIcenowy Zheng};
150a6a22f82SIcenowy Zheng
15191f480d4SOndrej Jirman&ehci0 {
15291f480d4SOndrej Jirman	status = "okay";
15391f480d4SOndrej Jirman};
15491f480d4SOndrej Jirman
15591f480d4SOndrej Jirman&ehci1 {
15691f480d4SOndrej Jirman	status = "okay";
15791f480d4SOndrej Jirman};
15891f480d4SOndrej Jirman
15960f2de5fSOndrej Jirman&i2c0 {
16060f2de5fSOndrej Jirman	status = "okay";
16160f2de5fSOndrej Jirman
16260f2de5fSOndrej Jirman	touchscreen@5d {
16360f2de5fSOndrej Jirman		compatible = "goodix,gt917s";
16460f2de5fSOndrej Jirman		reg = <0x5d>;
16560f2de5fSOndrej Jirman		interrupt-parent = <&pio>;
16660f2de5fSOndrej Jirman		interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
16760f2de5fSOndrej Jirman		irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
16860f2de5fSOndrej Jirman		reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
16960f2de5fSOndrej Jirman		AVDD28-supply = <&reg_ldo_io0>;
17060f2de5fSOndrej Jirman		VDDIO-supply = <&reg_ldo_io0>;
17160f2de5fSOndrej Jirman		touchscreen-size-x = <720>;
17260f2de5fSOndrej Jirman		touchscreen-size-y = <1440>;
17360f2de5fSOndrej Jirman	};
17460f2de5fSOndrej Jirman};
17560f2de5fSOndrej Jirman
17691f480d4SOndrej Jirman&i2c1 {
17791f480d4SOndrej Jirman	status = "okay";
17891f480d4SOndrej Jirman
17991f480d4SOndrej Jirman	/* Magnetometer */
180030eea2aSSamuel Holland	lis3mdl: magnetometer@1e {
18191f480d4SOndrej Jirman		compatible = "st,lis3mdl-magn";
18291f480d4SOndrej Jirman		reg = <0x1e>;
18391f480d4SOndrej Jirman		vdd-supply = <&reg_dldo1>;
18491f480d4SOndrej Jirman		vddio-supply = <&reg_dldo1>;
18591f480d4SOndrej Jirman	};
18691f480d4SOndrej Jirman
187a966ef62SOndrej Jirman	/* Light/proximity sensor */
188030eea2aSSamuel Holland	light-sensor@48 {
189a966ef62SOndrej Jirman		compatible = "sensortek,stk3311";
190a966ef62SOndrej Jirman		reg = <0x48>;
191a966ef62SOndrej Jirman		interrupt-parent = <&pio>;
192a966ef62SOndrej Jirman		interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
193a966ef62SOndrej Jirman	};
194a966ef62SOndrej Jirman
19591f480d4SOndrej Jirman	/* Accelerometer/gyroscope */
196030eea2aSSamuel Holland	accelerometer@68 {
19791f480d4SOndrej Jirman		compatible = "invensense,mpu6050";
19891f480d4SOndrej Jirman		reg = <0x68>;
19991f480d4SOndrej Jirman		interrupt-parent = <&pio>;
20091f480d4SOndrej Jirman		interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
20191f480d4SOndrej Jirman		vdd-supply = <&reg_dldo1>;
20291f480d4SOndrej Jirman		vddio-supply = <&reg_dldo1>;
20391f480d4SOndrej Jirman	};
20491f480d4SOndrej Jirman};
20591f480d4SOndrej Jirman
20691f480d4SOndrej Jirman/* Connected to pogo pins (external spring based pinheader for user addons) */
20791f480d4SOndrej Jirman&i2c2 {
20891f480d4SOndrej Jirman	status = "okay";
20991f480d4SOndrej Jirman};
21091f480d4SOndrej Jirman
21191f480d4SOndrej Jirman&lradc {
21291f480d4SOndrej Jirman	vref-supply = <&reg_aldo3>;
2130b26926aSSamuel Holland	wakeup-source;
21491f480d4SOndrej Jirman	status = "okay";
21591f480d4SOndrej Jirman
21691f480d4SOndrej Jirman	button-200 {
21791f480d4SOndrej Jirman		label = "Volume Up";
21891f480d4SOndrej Jirman		linux,code = <KEY_VOLUMEUP>;
21991f480d4SOndrej Jirman		channel = <0>;
22091f480d4SOndrej Jirman		voltage = <200000>;
22191f480d4SOndrej Jirman	};
22291f480d4SOndrej Jirman
22391f480d4SOndrej Jirman	button-400 {
22491f480d4SOndrej Jirman		label = "Volume Down";
22591f480d4SOndrej Jirman		linux,code = <KEY_VOLUMEDOWN>;
22691f480d4SOndrej Jirman		channel = <0>;
22791f480d4SOndrej Jirman		voltage = <400000>;
22891f480d4SOndrej Jirman	};
22991f480d4SOndrej Jirman};
23091f480d4SOndrej Jirman
23191f480d4SOndrej Jirman&mmc0 {
23291f480d4SOndrej Jirman	pinctrl-names = "default";
23391f480d4SOndrej Jirman	pinctrl-0 = <&mmc0_pins>;
23491f480d4SOndrej Jirman	vmmc-supply = <&reg_dcdc1>;
23591f480d4SOndrej Jirman	vqmmc-supply = <&reg_dcdc1>;
23691f480d4SOndrej Jirman	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
23791f480d4SOndrej Jirman	disable-wp;
23891f480d4SOndrej Jirman	bus-width = <4>;
23991f480d4SOndrej Jirman	status = "okay";
24091f480d4SOndrej Jirman};
24191f480d4SOndrej Jirman
2424fcf6f34SOndrej Jirman&mmc1 {
2434fcf6f34SOndrej Jirman	pinctrl-names = "default";
2444fcf6f34SOndrej Jirman	pinctrl-0 = <&mmc1_pins>;
2454fcf6f34SOndrej Jirman	vmmc-supply = <&reg_vbat_wifi>;
2464fcf6f34SOndrej Jirman	vqmmc-supply = <&reg_dldo4>;
2474fcf6f34SOndrej Jirman	bus-width = <4>;
2484fcf6f34SOndrej Jirman	non-removable;
2494fcf6f34SOndrej Jirman	status = "okay";
2504fcf6f34SOndrej Jirman
2514fcf6f34SOndrej Jirman	rtl8723cs: wifi@1 {
2524fcf6f34SOndrej Jirman		reg = <1>;
2534fcf6f34SOndrej Jirman	};
2544fcf6f34SOndrej Jirman};
2554fcf6f34SOndrej Jirman
25691f480d4SOndrej Jirman&mmc2 {
25791f480d4SOndrej Jirman	pinctrl-names = "default";
25891f480d4SOndrej Jirman	pinctrl-0 = <&mmc2_pins>;
25991f480d4SOndrej Jirman	vmmc-supply = <&reg_dcdc1>;
26091f480d4SOndrej Jirman	vqmmc-supply = <&reg_dcdc1>;
26191f480d4SOndrej Jirman	bus-width = <8>;
26291f480d4SOndrej Jirman	non-removable;
26391f480d4SOndrej Jirman	cap-mmc-hw-reset;
26491f480d4SOndrej Jirman	status = "okay";
26591f480d4SOndrej Jirman};
26691f480d4SOndrej Jirman
26791f480d4SOndrej Jirman&ohci0 {
26891f480d4SOndrej Jirman	status = "okay";
26991f480d4SOndrej Jirman};
27091f480d4SOndrej Jirman
27191f480d4SOndrej Jirman&ohci1 {
27291f480d4SOndrej Jirman	status = "okay";
27391f480d4SOndrej Jirman};
27491f480d4SOndrej Jirman
27591f480d4SOndrej Jirman&pio {
27691f480d4SOndrej Jirman	vcc-pb-supply = <&reg_dcdc1>;
27791f480d4SOndrej Jirman	vcc-pc-supply = <&reg_dcdc1>;
27891f480d4SOndrej Jirman	vcc-pd-supply = <&reg_dcdc1>;
27991f480d4SOndrej Jirman	vcc-pe-supply = <&reg_aldo1>;
28091f480d4SOndrej Jirman	vcc-pf-supply = <&reg_dcdc1>;
28191f480d4SOndrej Jirman	vcc-pg-supply = <&reg_dldo4>;
28291f480d4SOndrej Jirman	vcc-ph-supply = <&reg_dcdc1>;
28391f480d4SOndrej Jirman};
28491f480d4SOndrej Jirman
28591f480d4SOndrej Jirman&r_pio {
28691f480d4SOndrej Jirman	/*
28791f480d4SOndrej Jirman	 * FIXME: We can't add that supply for now since it would
28891f480d4SOndrej Jirman	 * create a circular dependency between pinctrl, the regulator
28991f480d4SOndrej Jirman	 * and the RSB Bus.
29091f480d4SOndrej Jirman	 *
29191f480d4SOndrej Jirman	 * vcc-pl-supply = <&reg_aldo2>;
29291f480d4SOndrej Jirman	 */
29391f480d4SOndrej Jirman};
29491f480d4SOndrej Jirman
295a6a22f82SIcenowy Zheng&r_pwm {
296a6a22f82SIcenowy Zheng	status = "okay";
297a6a22f82SIcenowy Zheng};
298a6a22f82SIcenowy Zheng
29991f480d4SOndrej Jirman&r_rsb {
30091f480d4SOndrej Jirman	status = "okay";
30191f480d4SOndrej Jirman
30291f480d4SOndrej Jirman	axp803: pmic@3a3 {
30391f480d4SOndrej Jirman		compatible = "x-powers,axp803";
30491f480d4SOndrej Jirman		reg = <0x3a3>;
30591f480d4SOndrej Jirman		interrupt-parent = <&r_intc>;
30673088dfeSSamuel Holland		interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
30791f480d4SOndrej Jirman	};
30891f480d4SOndrej Jirman};
30991f480d4SOndrej Jirman
31091f480d4SOndrej Jirman#include "axp803.dtsi"
31191f480d4SOndrej Jirman
31291f480d4SOndrej Jirman&battery_power_supply {
31391f480d4SOndrej Jirman	status = "okay";
31491f480d4SOndrej Jirman};
31591f480d4SOndrej Jirman
31691f480d4SOndrej Jirman&reg_aldo1 {
31791f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
31891f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
31991f480d4SOndrej Jirman	regulator-name = "dovdd-csi";
32091f480d4SOndrej Jirman};
32191f480d4SOndrej Jirman
32291f480d4SOndrej Jirman&reg_aldo2 {
32391f480d4SOndrej Jirman	regulator-always-on;
32491f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
32591f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
32691f480d4SOndrej Jirman	regulator-name = "vcc-pl";
32791f480d4SOndrej Jirman};
32891f480d4SOndrej Jirman
32991f480d4SOndrej Jirman&reg_aldo3 {
33091f480d4SOndrej Jirman	regulator-always-on;
3313cf9bf3bSSamuel Holland	regulator-min-microvolt = <3000000>;
3323cf9bf3bSSamuel Holland	regulator-max-microvolt = <3000000>;
33391f480d4SOndrej Jirman	regulator-name = "vcc-pll-avcc";
33491f480d4SOndrej Jirman};
33591f480d4SOndrej Jirman
33691f480d4SOndrej Jirman&reg_dcdc1 {
33791f480d4SOndrej Jirman	regulator-always-on;
33891f480d4SOndrej Jirman	regulator-min-microvolt = <3300000>;
33991f480d4SOndrej Jirman	regulator-max-microvolt = <3300000>;
34091f480d4SOndrej Jirman	regulator-name = "vcc-3v3";
34191f480d4SOndrej Jirman};
34291f480d4SOndrej Jirman
34391f480d4SOndrej Jirman&reg_dcdc2 {
34491f480d4SOndrej Jirman	regulator-always-on;
34591f480d4SOndrej Jirman	regulator-min-microvolt = <1000000>;
34691f480d4SOndrej Jirman	regulator-max-microvolt = <1300000>;
34791f480d4SOndrej Jirman	regulator-name = "vdd-cpux";
34891f480d4SOndrej Jirman};
34991f480d4SOndrej Jirman
35091f480d4SOndrej Jirman/* DCDC3 is polyphased with DCDC2 */
35191f480d4SOndrej Jirman
35291f480d4SOndrej Jirman&reg_dcdc5 {
35391f480d4SOndrej Jirman	regulator-always-on;
35491f480d4SOndrej Jirman	regulator-min-microvolt = <1200000>;
35591f480d4SOndrej Jirman	regulator-max-microvolt = <1200000>;
35691f480d4SOndrej Jirman	regulator-name = "vcc-dram";
35791f480d4SOndrej Jirman};
35891f480d4SOndrej Jirman
35991f480d4SOndrej Jirman&reg_dcdc6 {
36091f480d4SOndrej Jirman	regulator-always-on;
36191f480d4SOndrej Jirman	regulator-min-microvolt = <1100000>;
36291f480d4SOndrej Jirman	regulator-max-microvolt = <1100000>;
36391f480d4SOndrej Jirman	regulator-name = "vdd-sys";
36491f480d4SOndrej Jirman};
36591f480d4SOndrej Jirman
36691f480d4SOndrej Jirman&reg_dldo1 {
36791f480d4SOndrej Jirman	regulator-min-microvolt = <3300000>;
36891f480d4SOndrej Jirman	regulator-max-microvolt = <3300000>;
36991f480d4SOndrej Jirman	regulator-name = "vcc-dsi-sensor";
37091f480d4SOndrej Jirman};
37191f480d4SOndrej Jirman
37291f480d4SOndrej Jirman&reg_dldo2 {
37391f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
37491f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
37591f480d4SOndrej Jirman	regulator-name = "vcc-mipi-io";
37691f480d4SOndrej Jirman};
37791f480d4SOndrej Jirman
37891f480d4SOndrej Jirman&reg_dldo3 {
37991f480d4SOndrej Jirman	regulator-min-microvolt = <2800000>;
38091f480d4SOndrej Jirman	regulator-max-microvolt = <2800000>;
38191f480d4SOndrej Jirman	regulator-name = "avdd-csi";
38291f480d4SOndrej Jirman};
38391f480d4SOndrej Jirman
38491f480d4SOndrej Jirman&reg_dldo4 {
38591f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
38686be5c78SOndrej Jirman	regulator-max-microvolt = <1800000>;
38791f480d4SOndrej Jirman	regulator-name = "vcc-wifi-io";
38891f480d4SOndrej Jirman};
38991f480d4SOndrej Jirman
39091f480d4SOndrej Jirman&reg_eldo1 {
39191f480d4SOndrej Jirman	regulator-always-on;
39291f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
39391f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
39491f480d4SOndrej Jirman	regulator-name = "vcc-lpddr";
39591f480d4SOndrej Jirman};
39691f480d4SOndrej Jirman
39791f480d4SOndrej Jirman&reg_eldo3 {
39891f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
39991f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
40091f480d4SOndrej Jirman	regulator-name = "dvdd-1v8-csi";
40191f480d4SOndrej Jirman};
40291f480d4SOndrej Jirman
40391f480d4SOndrej Jirman&reg_fldo1 {
40491f480d4SOndrej Jirman	regulator-min-microvolt = <1200000>;
40591f480d4SOndrej Jirman	regulator-max-microvolt = <1200000>;
40691f480d4SOndrej Jirman	regulator-name = "vcc-1v2-hsic";
40791f480d4SOndrej Jirman};
40891f480d4SOndrej Jirman
40991f480d4SOndrej Jirman&reg_fldo2 {
41091f480d4SOndrej Jirman	regulator-always-on;
41191f480d4SOndrej Jirman	regulator-min-microvolt = <1100000>;
41291f480d4SOndrej Jirman	regulator-max-microvolt = <1100000>;
41391f480d4SOndrej Jirman	regulator-name = "vdd-cpus";
41491f480d4SOndrej Jirman};
41591f480d4SOndrej Jirman
41691f480d4SOndrej Jirman&reg_ldo_io0 {
41791f480d4SOndrej Jirman	regulator-min-microvolt = <3300000>;
41891f480d4SOndrej Jirman	regulator-max-microvolt = <3300000>;
41991f480d4SOndrej Jirman	regulator-name = "vcc-lcd-ctp-stk";
42091f480d4SOndrej Jirman	status = "okay";
42191f480d4SOndrej Jirman};
42291f480d4SOndrej Jirman
42391f480d4SOndrej Jirman&reg_ldo_io1 {
42491f480d4SOndrej Jirman	regulator-min-microvolt = <1800000>;
42591f480d4SOndrej Jirman	regulator-max-microvolt = <1800000>;
42691f480d4SOndrej Jirman	regulator-name = "vcc-1v8-typec";
42791f480d4SOndrej Jirman	status = "okay";
42891f480d4SOndrej Jirman};
42991f480d4SOndrej Jirman
43091f480d4SOndrej Jirman&reg_rtc_ldo {
43191f480d4SOndrej Jirman	regulator-name = "vcc-rtc";
43291f480d4SOndrej Jirman};
43391f480d4SOndrej Jirman
43491f480d4SOndrej Jirman&sound {
43591f480d4SOndrej Jirman	status = "okay";
436*091d5db0SArnaud Ferraris	simple-audio-card,name = "PinePhone";
43791f480d4SOndrej Jirman	simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
43891f480d4SOndrej Jirman	simple-audio-card,widgets = "Microphone", "Headset Microphone",
43991f480d4SOndrej Jirman				    "Microphone", "Internal Microphone",
44091f480d4SOndrej Jirman				    "Headphone", "Headphone Jack",
44191f480d4SOndrej Jirman				    "Speaker", "Internal Earpiece",
44291f480d4SOndrej Jirman				    "Speaker", "Internal Speaker";
44391f480d4SOndrej Jirman	simple-audio-card,routing =
44491f480d4SOndrej Jirman			"Headphone Jack", "HP",
44591f480d4SOndrej Jirman			"Internal Earpiece", "EARPIECE",
44691f480d4SOndrej Jirman			"Internal Speaker", "Speaker Amp OUTL",
44791f480d4SOndrej Jirman			"Internal Speaker", "Speaker Amp OUTR",
44891f480d4SOndrej Jirman			"Speaker Amp INL", "LINEOUT",
44991f480d4SOndrej Jirman			"Speaker Amp INR", "LINEOUT",
450631e6a35SSamuel Holland			"Left DAC", "DACL",
451631e6a35SSamuel Holland			"Right DAC", "DACR",
452631e6a35SSamuel Holland			"ADCL", "Left ADC",
453631e6a35SSamuel Holland			"ADCR", "Right ADC",
45491f480d4SOndrej Jirman			"Internal Microphone", "MBIAS",
45591f480d4SOndrej Jirman			"MIC1", "Internal Microphone",
45691f480d4SOndrej Jirman			"Headset Microphone", "HBIAS",
45791f480d4SOndrej Jirman			"MIC2", "Headset Microphone";
45836777d96SSamuel Holland
45936777d96SSamuel Holland	simple-audio-card,dai-link@2 {
46036777d96SSamuel Holland		format = "dsp_a";
46136777d96SSamuel Holland		frame-master = <&link2_codec>;
46236777d96SSamuel Holland		bitclock-master = <&link2_codec>;
46336777d96SSamuel Holland		bitclock-inversion;
46436777d96SSamuel Holland
46536777d96SSamuel Holland		link2_cpu: cpu {
46636777d96SSamuel Holland			sound-dai = <&bt_sco_codec 0>;
46736777d96SSamuel Holland		};
46836777d96SSamuel Holland
46936777d96SSamuel Holland		link2_codec: codec {
47036777d96SSamuel Holland			sound-dai = <&codec 2>;
47136777d96SSamuel Holland			dai-tdm-slot-num = <1>;
47236777d96SSamuel Holland			dai-tdm-slot-width = <32>;
47336777d96SSamuel Holland		};
47436777d96SSamuel Holland	};
47591f480d4SOndrej Jirman};
47691f480d4SOndrej Jirman
47791f480d4SOndrej Jirman&uart0 {
47891f480d4SOndrej Jirman	pinctrl-names = "default";
47991f480d4SOndrej Jirman	pinctrl-0 = <&uart0_pb_pins>;
48091f480d4SOndrej Jirman	status = "okay";
48191f480d4SOndrej Jirman};
48291f480d4SOndrej Jirman
483976843d5SOndrej Jirman&uart1 {
484976843d5SOndrej Jirman	pinctrl-names = "default";
485976843d5SOndrej Jirman	pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
486976843d5SOndrej Jirman	status = "okay";
487976843d5SOndrej Jirman
488976843d5SOndrej Jirman	bluetooth {
489976843d5SOndrej Jirman		compatible = "realtek,rtl8723cs-bt";
490976843d5SOndrej Jirman		device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
491976843d5SOndrej Jirman		enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
492976843d5SOndrej Jirman		host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
493976843d5SOndrej Jirman	};
494976843d5SOndrej Jirman};
495976843d5SOndrej Jirman
49691f480d4SOndrej Jirman/* Connected to the modem (hardware flow control can't be used) */
49791f480d4SOndrej Jirman&uart3 {
49891f480d4SOndrej Jirman	pinctrl-names = "default";
49991f480d4SOndrej Jirman	pinctrl-0 = <&uart3_pins>;
50091f480d4SOndrej Jirman	status = "okay";
50191f480d4SOndrej Jirman};
50291f480d4SOndrej Jirman
50391f480d4SOndrej Jirman&usb_otg {
50491f480d4SOndrej Jirman	dr_mode = "peripheral";
50591f480d4SOndrej Jirman	status = "okay";
50691f480d4SOndrej Jirman};
50791f480d4SOndrej Jirman
50891f480d4SOndrej Jirman&usb_power_supply {
50991f480d4SOndrej Jirman	status = "okay";
51091f480d4SOndrej Jirman};
51191f480d4SOndrej Jirman
51291f480d4SOndrej Jirman&usbphy {
51391f480d4SOndrej Jirman	status = "okay";
51491f480d4SOndrej Jirman};
515