123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516 |
- // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
- // Copyright (C) 2019 Icenowy Zheng <[email protected]>
- // Copyright (C) 2020 Martijn Braam <[email protected]>
- // Copyright (C) 2020 Ondrej Jirman <[email protected]>
- #include "sun50i-a64.dtsi"
- #include "sun50i-a64-cpu-opp.dtsi"
- #include <dt-bindings/gpio/gpio.h>
- #include <dt-bindings/input/input.h>
- #include <dt-bindings/leds/common.h>
- #include <dt-bindings/pwm/pwm.h>
- / {
- chassis-type = "handset";
- aliases {
- ethernet0 = &rtl8723cs;
- serial0 = &uart0;
- };
- backlight: backlight {
- compatible = "pwm-backlight";
- pwms = <&r_pwm 0 50000 PWM_POLARITY_INVERTED>;
- enable-gpios = <&pio 7 10 GPIO_ACTIVE_HIGH>; /* PH10 */
- power-supply = <®_ps>;
- /* Backlight configuration differs per PinePhone revision. */
- };
- bt_sco_codec: bt-sco-codec {
- #sound-dai-cells = <1>;
- compatible = "linux,bt-sco";
- };
- chosen {
- stdout-path = "serial0:115200n8";
- };
- leds {
- compatible = "gpio-leds";
- led-0 {
- function = LED_FUNCTION_INDICATOR;
- color = <LED_COLOR_ID_BLUE>;
- gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */
- };
- led-1 {
- function = LED_FUNCTION_INDICATOR;
- color = <LED_COLOR_ID_GREEN>;
- gpios = <&pio 3 18 GPIO_ACTIVE_HIGH>; /* PD18 */
- };
- led-2 {
- function = LED_FUNCTION_INDICATOR;
- color = <LED_COLOR_ID_RED>;
- gpios = <&pio 3 19 GPIO_ACTIVE_HIGH>; /* PD19 */
- };
- };
- reg_ps: ps-regulator {
- compatible = "regulator-fixed";
- regulator-name = "ps";
- regulator-min-microvolt = <5000000>;
- regulator-max-microvolt = <5000000>;
- regulator-boot-on;
- };
- reg_vbat_wifi: vbat-wifi {
- compatible = "regulator-fixed";
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-name = "vbat-wifi";
- };
- sgm3140: led-controller {
- compatible = "sgmicro,sgm3140";
- vin-supply = <®_dcdc1>;
- sgm3140_flash: led {
- function = LED_FUNCTION_FLASH;
- color = <LED_COLOR_ID_WHITE>;
- flash-max-timeout-us = <250000>;
- };
- };
- speaker_amp: audio-amplifier {
- compatible = "simple-audio-amplifier";
- enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
- sound-name-prefix = "Speaker Amp";
- };
- vibrator {
- compatible = "gpio-vibrator";
- enable-gpios = <&pio 3 2 GPIO_ACTIVE_HIGH>; /* PD2 */
- vcc-supply = <®_dcdc1>;
- };
- };
- &codec {
- pinctrl-names = "default";
- pinctrl-0 = <&aif3_pins>;
- status = "okay";
- };
- &codec_analog {
- cpvdd-supply = <®_eldo1>;
- status = "okay";
- };
- &cpu0 {
- cpu-supply = <®_dcdc2>;
- };
- &cpu1 {
- cpu-supply = <®_dcdc2>;
- };
- &cpu2 {
- cpu-supply = <®_dcdc2>;
- };
- &cpu3 {
- cpu-supply = <®_dcdc2>;
- };
- &dai {
- status = "okay";
- };
- &de {
- status = "okay";
- };
- &dphy {
- status = "okay";
- };
- &dsi {
- vcc-dsi-supply = <®_dldo1>;
- status = "okay";
- panel@0 {
- compatible = "xingbangda,xbd599";
- reg = <0>;
- reset-gpios = <&pio 3 23 GPIO_ACTIVE_LOW>; /* PD23 */
- iovcc-supply = <®_dldo2>;
- vcc-supply = <®_ldo_io0>;
- backlight = <&backlight>;
- };
- };
- &ehci0 {
- status = "okay";
- };
- &ehci1 {
- status = "okay";
- };
- &i2c0 {
- status = "okay";
- touchscreen@5d {
- compatible = "goodix,gt917s";
- reg = <0x5d>;
- interrupt-parent = <&pio>;
- interrupts = <7 4 IRQ_TYPE_LEVEL_HIGH>; /* PH4 */
- irq-gpios = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
- reset-gpios = <&pio 7 11 GPIO_ACTIVE_HIGH>; /* PH11 */
- AVDD28-supply = <®_ldo_io0>;
- VDDIO-supply = <®_ldo_io0>;
- touchscreen-size-x = <720>;
- touchscreen-size-y = <1440>;
- };
- };
- &i2c1 {
- status = "okay";
- /* Magnetometer */
- lis3mdl: magnetometer@1e {
- compatible = "st,lis3mdl-magn";
- reg = <0x1e>;
- vdd-supply = <®_dldo1>;
- vddio-supply = <®_dldo1>;
- };
- /* Light/proximity sensor */
- light-sensor@48 {
- compatible = "sensortek,stk3311";
- reg = <0x48>;
- interrupt-parent = <&pio>;
- interrupts = <1 0 IRQ_TYPE_EDGE_FALLING>; /* PB0 */
- };
- /* Accelerometer/gyroscope */
- accelerometer@68 {
- compatible = "invensense,mpu6050";
- reg = <0x68>;
- interrupt-parent = <&pio>;
- interrupts = <7 5 IRQ_TYPE_EDGE_RISING>; /* PH5 */
- vdd-supply = <®_dldo1>;
- vddio-supply = <®_dldo1>;
- };
- };
- /* Connected to pogo pins (external spring based pinheader for user addons) */
- &i2c2 {
- status = "okay";
- };
- &lradc {
- vref-supply = <®_aldo3>;
- wakeup-source;
- status = "okay";
- button-200 {
- label = "Volume Up";
- linux,code = <KEY_VOLUMEUP>;
- channel = <0>;
- voltage = <200000>;
- };
- button-400 {
- label = "Volume Down";
- linux,code = <KEY_VOLUMEDOWN>;
- channel = <0>;
- voltage = <400000>;
- };
- };
- &mmc0 {
- pinctrl-names = "default";
- pinctrl-0 = <&mmc0_pins>;
- vmmc-supply = <®_dcdc1>;
- vqmmc-supply = <®_dcdc1>;
- cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */
- disable-wp;
- bus-width = <4>;
- status = "okay";
- };
- &mmc1 {
- pinctrl-names = "default";
- pinctrl-0 = <&mmc1_pins>;
- vmmc-supply = <®_vbat_wifi>;
- vqmmc-supply = <®_dldo4>;
- bus-width = <4>;
- non-removable;
- status = "okay";
- rtl8723cs: wifi@1 {
- reg = <1>;
- };
- };
- &mmc2 {
- pinctrl-names = "default";
- pinctrl-0 = <&mmc2_pins>;
- vmmc-supply = <®_dcdc1>;
- vqmmc-supply = <®_dcdc1>;
- bus-width = <8>;
- non-removable;
- cap-mmc-hw-reset;
- status = "okay";
- };
- &ohci0 {
- status = "okay";
- };
- &ohci1 {
- status = "okay";
- };
- &pio {
- vcc-pb-supply = <®_dcdc1>;
- vcc-pc-supply = <®_dcdc1>;
- vcc-pd-supply = <®_dcdc1>;
- vcc-pe-supply = <®_aldo1>;
- vcc-pf-supply = <®_dcdc1>;
- vcc-pg-supply = <®_dldo4>;
- vcc-ph-supply = <®_dcdc1>;
- };
- &r_pio {
- /*
- * FIXME: We can't add that supply for now since it would
- * create a circular dependency between pinctrl, the regulator
- * and the RSB Bus.
- *
- * vcc-pl-supply = <®_aldo2>;
- */
- };
- &r_pwm {
- status = "okay";
- };
- &r_rsb {
- status = "okay";
- axp803: pmic@3a3 {
- compatible = "x-powers,axp803";
- reg = <0x3a3>;
- interrupt-parent = <&r_intc>;
- interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_LOW>;
- };
- };
- #include "axp803.dtsi"
- &battery_power_supply {
- status = "okay";
- };
- ®_aldo1 {
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "dovdd-csi";
- };
- ®_aldo2 {
- regulator-always-on;
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "vcc-pl";
- };
- ®_aldo3 {
- regulator-always-on;
- regulator-min-microvolt = <3000000>;
- regulator-max-microvolt = <3000000>;
- regulator-name = "vcc-pll-avcc";
- };
- ®_dcdc1 {
- regulator-always-on;
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-name = "vcc-3v3";
- };
- ®_dcdc2 {
- regulator-always-on;
- regulator-min-microvolt = <1000000>;
- regulator-max-microvolt = <1300000>;
- regulator-name = "vdd-cpux";
- };
- /* DCDC3 is polyphased with DCDC2 */
- ®_dcdc5 {
- regulator-always-on;
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <1200000>;
- regulator-name = "vcc-dram";
- };
- ®_dcdc6 {
- regulator-always-on;
- regulator-min-microvolt = <1100000>;
- regulator-max-microvolt = <1100000>;
- regulator-name = "vdd-sys";
- };
- ®_dldo1 {
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-name = "vcc-dsi-sensor";
- };
- ®_dldo2 {
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "vcc-mipi-io";
- };
- ®_dldo3 {
- regulator-min-microvolt = <2800000>;
- regulator-max-microvolt = <2800000>;
- regulator-name = "avdd-csi";
- };
- ®_dldo4 {
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "vcc-wifi-io";
- };
- ®_eldo1 {
- regulator-always-on;
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "vcc-lpddr";
- };
- ®_eldo3 {
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "dvdd-1v8-csi";
- };
- ®_fldo1 {
- regulator-min-microvolt = <1200000>;
- regulator-max-microvolt = <1200000>;
- regulator-name = "vcc-1v2-hsic";
- };
- ®_fldo2 {
- regulator-always-on;
- regulator-min-microvolt = <1100000>;
- regulator-max-microvolt = <1100000>;
- regulator-name = "vdd-cpus";
- };
- ®_ldo_io0 {
- regulator-min-microvolt = <3300000>;
- regulator-max-microvolt = <3300000>;
- regulator-name = "vcc-lcd-ctp-stk";
- status = "okay";
- };
- ®_ldo_io1 {
- regulator-min-microvolt = <1800000>;
- regulator-max-microvolt = <1800000>;
- regulator-name = "vcc-1v8-typec";
- status = "okay";
- };
- ®_rtc_ldo {
- regulator-name = "vcc-rtc";
- };
- &sound {
- status = "okay";
- simple-audio-card,name = "PinePhone";
- simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
- simple-audio-card,widgets = "Microphone", "Headset Microphone",
- "Microphone", "Internal Microphone",
- "Headphone", "Headphone Jack",
- "Speaker", "Internal Earpiece",
- "Speaker", "Internal Speaker";
- simple-audio-card,routing =
- "Headphone Jack", "HP",
- "Internal Earpiece", "EARPIECE",
- "Internal Speaker", "Speaker Amp OUTL",
- "Internal Speaker", "Speaker Amp OUTR",
- "Speaker Amp INL", "LINEOUT",
- "Speaker Amp INR", "LINEOUT",
- "Left DAC", "DACL",
- "Right DAC", "DACR",
- "ADCL", "Left ADC",
- "ADCR", "Right ADC",
- "Internal Microphone", "MBIAS",
- "MIC1", "Internal Microphone",
- "Headset Microphone", "HBIAS",
- "MIC2", "Headset Microphone";
- simple-audio-card,dai-link@2 {
- format = "dsp_a";
- frame-master = <&link2_codec>;
- bitclock-master = <&link2_codec>;
- bitclock-inversion;
- link2_cpu: cpu {
- sound-dai = <&bt_sco_codec 0>;
- };
- link2_codec: codec {
- sound-dai = <&codec 2>;
- dai-tdm-slot-num = <1>;
- dai-tdm-slot-width = <32>;
- };
- };
- };
- &uart0 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart0_pb_pins>;
- status = "okay";
- };
- &uart1 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
- status = "okay";
- bluetooth {
- compatible = "realtek,rtl8723cs-bt";
- device-wake-gpios = <&pio 7 6 GPIO_ACTIVE_LOW>; /* PH6 */
- enable-gpios = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */
- host-wake-gpios = <&r_pio 0 5 GPIO_ACTIVE_HIGH>; /* PL5 */
- };
- };
- /* Connected to the modem (hardware flow control can't be used) */
- &uart3 {
- pinctrl-names = "default";
- pinctrl-0 = <&uart3_pins>;
- status = "okay";
- };
- &usb_otg {
- dr_mode = "peripheral";
- status = "okay";
- };
- &usb_power_supply {
- status = "okay";
- };
- &usbphy {
- status = "okay";
- };
|