Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
0002 /*
0003  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
0004  * Copyright (c) 2018 Akash Gajjar <Akash_Gajjar@mentor.com>
0005  * Copyright (c) 2020 Tobias Schramm <t.schramm@manjaro.org>
0006  */
0007 
0008 /dts-v1/;
0009 #include <dt-bindings/input/gpio-keys.h>
0010 #include <dt-bindings/input/linux-event-codes.h>
0011 #include <dt-bindings/pwm/pwm.h>
0012 #include <dt-bindings/usb/pd.h>
0013 #include <dt-bindings/leds/common.h>
0014 #include "rk3399.dtsi"
0015 #include "rk3399-opp.dtsi"
0016 
0017 / {
0018         model = "Pine64 Pinebook Pro";
0019         compatible = "pine64,pinebook-pro", "rockchip,rk3399";
0020         chassis-type = "laptop";
0021 
0022         aliases {
0023                 mmc0 = &sdio0;
0024                 mmc1 = &sdmmc;
0025                 mmc2 = &sdhci;
0026         };
0027 
0028         chosen {
0029                 stdout-path = "serial2:1500000n8";
0030         };
0031 
0032         backlight: edp-backlight {
0033                 compatible = "pwm-backlight";
0034                 power-supply = <&vcc_12v>;
0035                 pwms = <&pwm0 0 740740 0>;
0036         };
0037 
0038         bat: battery {
0039                 compatible = "simple-battery";
0040                 charge-full-design-microamp-hours = <9800000>;
0041                 voltage-max-design-microvolt = <4350000>;
0042                 voltage-min-design-microvolt = <3000000>;
0043         };
0044 
0045         edp_panel: edp-panel {
0046                 compatible = "boe,nv140fhmn49";
0047                 backlight = <&backlight>;
0048                 enable-gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
0049                 pinctrl-names = "default";
0050                 pinctrl-0 = <&panel_en_pin>;
0051                 power-supply = <&vcc3v3_panel>;
0052 
0053                 ports {
0054                         #address-cells = <1>;
0055                         #size-cells = <0>;
0056 
0057                         port@0 {
0058                                 reg = <0>;
0059                                 #address-cells = <1>;
0060                                 #size-cells = <0>;
0061 
0062                                 panel_in_edp: endpoint@0 {
0063                                         reg = <0>;
0064                                         remote-endpoint = <&edp_out_panel>;
0065                                 };
0066                         };
0067                 };
0068         };
0069 
0070         /*
0071          * Use separate nodes for gpio-keys to allow for selective deactivation
0072          * of wakeup sources via sysfs without disabling the whole key
0073          */
0074         gpio-key-lid {
0075                 compatible = "gpio-keys";
0076                 pinctrl-names = "default";
0077                 pinctrl-0 = <&lidbtn_pin>;
0078 
0079                 switch-lid {
0080                         debounce-interval = <20>;
0081                         gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_LOW>;
0082                         label = "Lid";
0083                         linux,code = <SW_LID>;
0084                         linux,input-type = <EV_SW>;
0085                         wakeup-event-action = <EV_ACT_DEASSERTED>;
0086                         wakeup-source;
0087                 };
0088         };
0089 
0090         gpio-key-power {
0091                 compatible = "gpio-keys";
0092                 pinctrl-names = "default";
0093                 pinctrl-0 = <&pwrbtn_pin>;
0094 
0095                 key-power {
0096                         debounce-interval = <20>;
0097                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
0098                         label = "Power";
0099                         linux,code = <KEY_POWER>;
0100                         wakeup-source;
0101                 };
0102         };
0103 
0104         leds {
0105                 compatible = "gpio-leds";
0106                 pinctrl-names = "default";
0107                 pinctrl-0 = <&pwr_led_pin &slp_led_pin>;
0108 
0109                 green_led: led-0 {
0110                         color = <LED_COLOR_ID_GREEN>;
0111                         default-state = "on";
0112                         function = LED_FUNCTION_POWER;
0113                         gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>;
0114                         label = "green:power";
0115                 };
0116 
0117                 red_led: led-1 {
0118                         color = <LED_COLOR_ID_RED>;
0119                         default-state = "off";
0120                         function = LED_FUNCTION_STANDBY;
0121                         gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
0122                         label = "red:standby";
0123                         panic-indicator;
0124                         retain-state-suspended;
0125                 };
0126         };
0127 
0128         /* Power sequence for SDIO WiFi module */
0129         sdio_pwrseq: sdio-pwrseq {
0130                 compatible = "mmc-pwrseq-simple";
0131                 clocks = <&rk808 1>;
0132                 clock-names = "ext_clock";
0133                 pinctrl-names = "default";
0134                 pinctrl-0 = <&wifi_enable_h_pin>;
0135                 post-power-on-delay-ms = <100>;
0136                 power-off-delay-us = <500000>;
0137 
0138                 /* WL_REG_ON on module */
0139                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
0140         };
0141 
0142         /* Audio components */
0143         es8316-sound {
0144                 compatible = "simple-audio-card";
0145                 pinctrl-names = "default";
0146                 pinctrl-0 = <&hp_det_pin>;
0147                 simple-audio-card,name = "rockchip,es8316-codec";
0148                 simple-audio-card,format = "i2s";
0149                 simple-audio-card,mclk-fs = <256>;
0150 
0151                 simple-audio-card,widgets =
0152                         "Microphone", "Mic Jack",
0153                         "Headphone", "Headphones",
0154                         "Speaker", "Speaker";
0155                 simple-audio-card,routing =
0156                         "MIC1", "Mic Jack",
0157                         "Headphones", "HPOL",
0158                         "Headphones", "HPOR",
0159                         "Speaker Amplifier INL", "HPOL",
0160                         "Speaker Amplifier INR", "HPOR",
0161                         "Speaker", "Speaker Amplifier OUTL",
0162                         "Speaker", "Speaker Amplifier OUTR";
0163 
0164                 simple-audio-card,hp-det-gpio = <&gpio0 RK_PB0 GPIO_ACTIVE_HIGH>;
0165                 simple-audio-card,aux-devs = <&speaker_amp>;
0166                 simple-audio-card,pin-switches = "Speaker";
0167 
0168                 simple-audio-card,cpu {
0169                         sound-dai = <&i2s1>;
0170                 };
0171 
0172                 simple-audio-card,codec {
0173                         sound-dai = <&es8316>;
0174                 };
0175         };
0176 
0177         speaker_amp: speaker-amplifier {
0178                 compatible = "simple-audio-amplifier";
0179                 enable-gpios = <&gpio4 RK_PD3 GPIO_ACTIVE_HIGH>;
0180                 sound-name-prefix = "Speaker Amplifier";
0181                 VCC-supply = <&pa_5v>;
0182         };
0183 
0184         /* Power tree */
0185         /* Root power source */
0186         vcc_sysin: vcc-sysin {
0187                 compatible = "regulator-fixed";
0188                 regulator-name = "vcc_sysin";
0189                 regulator-always-on;
0190                 regulator-boot-on;
0191         };
0192 
0193         /* Regulators supplied by vcc_sysin */
0194         /* LCD backlight supply */
0195         vcc_12v: vcc-12v {
0196                 compatible = "regulator-fixed";
0197                 regulator-name = "vcc_12v";
0198                 regulator-always-on;
0199                 regulator-boot-on;
0200                 regulator-min-microvolt = <12000000>;
0201                 regulator-max-microvolt = <12000000>;
0202                 vin-supply = <&vcc_sysin>;
0203 
0204                 regulator-state-mem {
0205                         regulator-off-in-suspend;
0206                 };
0207         };
0208 
0209         /* Main 3.3 V supply */
0210         vcc3v3_sys: wifi_bat: vcc3v3-sys {
0211                 compatible = "regulator-fixed";
0212                 regulator-name = "vcc3v3_sys";
0213                 regulator-always-on;
0214                 regulator-boot-on;
0215                 regulator-min-microvolt = <3300000>;
0216                 regulator-max-microvolt = <3300000>;
0217                 vin-supply = <&vcc_sysin>;
0218 
0219                 regulator-state-mem {
0220                         regulator-on-in-suspend;
0221                 };
0222         };
0223 
0224         /* 5 V USB power supply */
0225         vcc5v0_usb: pa_5v: vcc5v0-usb-regulator {
0226                 compatible = "regulator-fixed";
0227                 enable-active-high;
0228                 gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
0229                 pinctrl-names = "default";
0230                 pinctrl-0 = <&pwr_5v_pin>;
0231                 regulator-name = "vcc5v0_usb";
0232                 regulator-always-on;
0233                 regulator-min-microvolt = <5000000>;
0234                 regulator-max-microvolt = <5000000>;
0235                 vin-supply = <&vcc_sysin>;
0236 
0237                 regulator-state-mem {
0238                         regulator-off-in-suspend;
0239                 };
0240         };
0241 
0242         /* RK3399 logic supply */
0243         vdd_log: vdd-log {
0244                 compatible = "pwm-regulator";
0245                 pwms = <&pwm2 0 25000 1>;
0246                 pwm-supply = <&vcc_sysin>;
0247                 regulator-name = "vdd_log";
0248                 regulator-always-on;
0249                 regulator-boot-on;
0250                 regulator-min-microvolt = <800000>;
0251                 regulator-max-microvolt = <1400000>;
0252 
0253                 regulator-state-mem {
0254                         regulator-on-in-suspend;
0255                 };
0256         };
0257 
0258         /* Regulators supplied by vcc3v3_sys */
0259         /* 0.9 V supply, always on */
0260         vcc_0v9: vcc-0v9 {
0261                 compatible = "regulator-fixed";
0262                 regulator-name = "vcc_0v9";
0263                 regulator-always-on;
0264                 regulator-boot-on;
0265                 regulator-min-microvolt = <900000>;
0266                 regulator-max-microvolt = <900000>;
0267                 vin-supply = <&vcc3v3_sys>;
0268         };
0269 
0270         /* S3 1.8 V supply, switched by vcc1v8_s3 */
0271         vcca1v8_s3: vcc1v8-s3 {
0272                 compatible = "regulator-fixed";
0273                 regulator-name = "vcca1v8_s3";
0274                 regulator-always-on;
0275                 regulator-boot-on;
0276                 regulator-min-microvolt = <1800000>;
0277                 regulator-max-microvolt = <1800000>;
0278                 vin-supply = <&vcc3v3_sys>;
0279         };
0280 
0281         /* micro SD card power */
0282         vcc3v0_sd: vcc3v0-sd {
0283                 compatible = "regulator-fixed";
0284                 enable-active-high;
0285                 gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
0286                 pinctrl-names = "default";
0287                 pinctrl-0 = <&sdmmc0_pwr_h_pin>;
0288                 regulator-name = "vcc3v0_sd";
0289                 regulator-always-on;
0290                 regulator-min-microvolt = <3000000>;
0291                 regulator-max-microvolt = <3000000>;
0292                 vin-supply = <&vcc3v3_sys>;
0293 
0294                 regulator-state-mem {
0295                         regulator-off-in-suspend;
0296                 };
0297         };
0298 
0299         /* LCD panel power, called VCC3V3_S0 in schematic */
0300         vcc3v3_panel: vcc3v3-panel {
0301                 compatible = "regulator-fixed";
0302                 enable-active-high;
0303                 gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
0304                 pinctrl-names = "default";
0305                 pinctrl-0 = <&lcdvcc_en_pin>;
0306                 regulator-name = "vcc3v3_panel";
0307                 regulator-always-on;
0308                 regulator-min-microvolt = <3300000>;
0309                 regulator-max-microvolt = <3300000>;
0310                 regulator-enable-ramp-delay = <100000>;
0311                 vin-supply = <&vcc3v3_sys>;
0312 
0313                 regulator-state-mem {
0314                         regulator-off-in-suspend;
0315                 };
0316         };
0317 
0318         /* M.2 adapter power, switched by vcc1v8_s3 */
0319         vcc3v3_ssd: vcc3v3-ssd {
0320                 compatible = "regulator-fixed";
0321                 regulator-name = "vcc3v3_ssd";
0322                 regulator-min-microvolt = <3300000>;
0323                 regulator-max-microvolt = <3300000>;
0324                 vin-supply = <&vcc3v3_sys>;
0325         };
0326 
0327         /* Regulators supplied by vcc5v0_usb */
0328         /* USB 3 port power supply regulator  */
0329         vcc5v0_otg: vcc5v0-otg {
0330                 compatible = "regulator-fixed";
0331                 enable-active-high;
0332                 gpio = <&gpio4 RK_PD2 GPIO_ACTIVE_HIGH>;
0333                 pinctrl-names = "default";
0334                 pinctrl-0 = <&vcc5v0_host_en_pin>;
0335                 regulator-name = "vcc5v0_otg";
0336                 regulator-always-on;
0337                 regulator-min-microvolt = <5000000>;
0338                 regulator-max-microvolt = <5000000>;
0339                 vin-supply = <&vcc5v0_usb>;
0340 
0341                 regulator-state-mem {
0342                         regulator-off-in-suspend;
0343                 };
0344         };
0345 
0346         /* Regulators supplied by vcc5v0_usb */
0347         /* Type C port power supply regulator */
0348         vbus_5vout: vbus_typec: vbus-5vout {
0349                 compatible = "regulator-fixed";
0350                 enable-active-high;
0351                 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
0352                 pinctrl-names = "default";
0353                 pinctrl-0 = <&vcc5v0_typec0_en_pin>;
0354                 regulator-name = "vbus_5vout";
0355                 regulator-min-microvolt = <5000000>;
0356                 regulator-max-microvolt = <5000000>;
0357                 vin-supply = <&vcc5v0_usb>;
0358 
0359                 regulator-state-mem {
0360                         regulator-off-in-suspend;
0361                 };
0362         };
0363 
0364         /* Regulators supplied by vcc_1v8 */
0365         /* Primary 0.9 V LDO */
0366         vcca0v9_s3: vcca0v9-s3 {
0367                 compatible = "regulator-fixed";
0368                 regulator-name = "vcc0v9_s3";
0369                 regulator-min-microvolt = <5000000>;
0370                 regulator-max-microvolt = <5000000>;
0371                 vin-supply = <&vcc_1v8>;
0372 
0373                 regulator-state-mem {
0374                         regulator-on-in-suspend;
0375                 };
0376         };
0377 
0378         mains_charger: dc-charger {
0379                 compatible = "gpio-charger";
0380                 charger-type = "mains";
0381                 gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_LOW>;
0382 
0383                 /* Also triggered by USB charger */
0384                 pinctrl-names = "default";
0385                 pinctrl-0 = <&dc_det_pin>;
0386         };
0387 };
0388 
0389 &cpu_b0 {
0390         cpu-supply = <&vdd_cpu_b>;
0391 };
0392 
0393 &cpu_b1 {
0394         cpu-supply = <&vdd_cpu_b>;
0395 };
0396 
0397 &cpu_l0 {
0398         cpu-supply = <&vdd_cpu_l>;
0399 };
0400 
0401 &cpu_l1 {
0402         cpu-supply = <&vdd_cpu_l>;
0403 };
0404 
0405 &cpu_l2 {
0406         cpu-supply = <&vdd_cpu_l>;
0407 };
0408 
0409 &cpu_l3 {
0410         cpu-supply = <&vdd_cpu_l>;
0411 };
0412 
0413 &edp {
0414         force-hpd;
0415         pinctrl-names = "default";
0416         pinctrl-0 = <&edp_hpd>;
0417         status = "okay";
0418 
0419         ports {
0420                 edp_out: port@1 {
0421                         reg = <1>;
0422                         #address-cells = <1>;
0423                         #size-cells = <0>;
0424 
0425                         edp_out_panel: endpoint@0 {
0426                                 reg = <0>;
0427                                 remote-endpoint = <&panel_in_edp>;
0428                         };
0429                 };
0430         };
0431 };
0432 
0433 &emmc_phy {
0434         status = "okay";
0435 };
0436 
0437 &gpu {
0438         mali-supply = <&vdd_gpu>;
0439         status = "okay";
0440 };
0441 
0442 &hdmi_sound {
0443         status = "okay";
0444 };
0445 
0446 &i2c0 {
0447         clock-frequency = <400000>;
0448         i2c-scl-falling-time-ns = <4>;
0449         i2c-scl-rising-time-ns = <168>;
0450         status = "okay";
0451 
0452         rk808: pmic@1b {
0453                 compatible = "rockchip,rk808";
0454                 reg = <0x1b>;
0455                 #clock-cells = <1>;
0456                 clock-output-names = "xin32k", "rk808-clkout2";
0457                 interrupt-parent = <&gpio3>;
0458                 interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
0459                 pinctrl-names = "default";
0460                 pinctrl-0 = <&pmic_int_l_pin>;
0461                 rockchip,system-power-controller;
0462                 wakeup-source;
0463 
0464                 vcc1-supply = <&vcc_sysin>;
0465                 vcc2-supply = <&vcc_sysin>;
0466                 vcc3-supply = <&vcc_sysin>;
0467                 vcc4-supply = <&vcc_sysin>;
0468                 vcc6-supply = <&vcc_sysin>;
0469                 vcc7-supply = <&vcc_sysin>;
0470                 vcc8-supply = <&vcc3v3_sys>;
0471                 vcc9-supply = <&vcc_sysin>;
0472                 vcc10-supply = <&vcc_sysin>;
0473                 vcc11-supply = <&vcc_sysin>;
0474                 vcc12-supply = <&vcc3v3_sys>;
0475 
0476                 regulators {
0477                         /* rk3399 center logic supply */
0478                         vdd_center: DCDC_REG1 {
0479                                 regulator-name = "vdd_center";
0480                                 regulator-always-on;
0481                                 regulator-boot-on;
0482                                 regulator-min-microvolt = <750000>;
0483                                 regulator-max-microvolt = <1350000>;
0484                                 regulator-ramp-delay = <6001>;
0485 
0486                                 regulator-state-mem {
0487                                         regulator-off-in-suspend;
0488                                 };
0489                         };
0490 
0491                         vdd_cpu_l: DCDC_REG2 {
0492                                 regulator-name = "vdd_cpu_l";
0493                                 regulator-always-on;
0494                                 regulator-boot-on;
0495                                 regulator-min-microvolt = <750000>;
0496                                 regulator-max-microvolt = <1350000>;
0497                                 regulator-ramp-delay = <6001>;
0498 
0499                                 regulator-state-mem {
0500                                         regulator-off-in-suspend;
0501                                 };
0502                         };
0503 
0504                         vcc_ddr: DCDC_REG3 {
0505                                 regulator-name = "vcc_ddr";
0506                                 regulator-always-on;
0507                                 regulator-boot-on;
0508 
0509                                 regulator-state-mem {
0510                                         regulator-on-in-suspend;
0511                                 };
0512                         };
0513 
0514                         vcc_1v8: vcc_wl: DCDC_REG4 {
0515                                 regulator-name = "vcc_1v8";
0516                                 regulator-always-on;
0517                                 regulator-boot-on;
0518                                 regulator-min-microvolt = <1800000>;
0519                                 regulator-max-microvolt = <1800000>;
0520 
0521                                 regulator-state-mem {
0522                                         regulator-on-in-suspend;
0523                                         regulator-suspend-microvolt = <1800000>;
0524                                 };
0525                         };
0526 
0527                         /* not used */
0528                         LDO_REG1 {
0529                         };
0530 
0531                         /* not used */
0532                         LDO_REG2 {
0533                         };
0534 
0535                         vcc1v8_pmupll: LDO_REG3 {
0536                                 regulator-name = "vcc1v8_pmupll";
0537                                 regulator-always-on;
0538                                 regulator-boot-on;
0539                                 regulator-min-microvolt = <1800000>;
0540                                 regulator-max-microvolt = <1800000>;
0541 
0542                                 regulator-state-mem {
0543                                         regulator-on-in-suspend;
0544                                         regulator-suspend-microvolt = <1800000>;
0545                                 };
0546                         };
0547 
0548                         vcc_sdio: LDO_REG4 {
0549                                 regulator-name = "vcc_sdio";
0550                                 regulator-always-on;
0551                                 regulator-boot-on;
0552                                 regulator-min-microvolt = <1800000>;
0553                                 regulator-max-microvolt = <3000000>;
0554 
0555                                 regulator-state-mem {
0556                                         regulator-on-in-suspend;
0557                                         regulator-suspend-microvolt = <3000000>;
0558                                 };
0559                         };
0560 
0561                         vcca3v0_codec: LDO_REG5 {
0562                                 regulator-name = "vcca3v0_codec";
0563                                 regulator-always-on;
0564                                 regulator-boot-on;
0565                                 regulator-min-microvolt = <3000000>;
0566                                 regulator-max-microvolt = <3000000>;
0567 
0568                                 regulator-state-mem {
0569                                         regulator-off-in-suspend;
0570                                 };
0571                         };
0572 
0573                         vcc_1v5: LDO_REG6 {
0574                                 regulator-name = "vcc_1v5";
0575                                 regulator-always-on;
0576                                 regulator-boot-on;
0577                                 regulator-min-microvolt = <1500000>;
0578                                 regulator-max-microvolt = <1500000>;
0579 
0580                                 regulator-state-mem {
0581                                         regulator-on-in-suspend;
0582                                         regulator-suspend-microvolt = <1500000>;
0583                                 };
0584                         };
0585 
0586                         vcca1v8_codec: LDO_REG7 {
0587                                 regulator-name = "vcca1v8_codec";
0588                                 regulator-always-on;
0589                                 regulator-boot-on;
0590                                 regulator-min-microvolt = <1800000>;
0591                                 regulator-max-microvolt = <1800000>;
0592 
0593                                 regulator-state-mem {
0594                                         regulator-off-in-suspend;
0595                                 };
0596                         };
0597 
0598                         vcc_3v0: LDO_REG8 {
0599                                 regulator-name = "vcc_3v0";
0600                                 regulator-always-on;
0601                                 regulator-boot-on;
0602                                 regulator-min-microvolt = <3000000>;
0603                                 regulator-max-microvolt = <3000000>;
0604 
0605                                 regulator-state-mem {
0606                                         regulator-on-in-suspend;
0607                                         regulator-suspend-microvolt = <3000000>;
0608                                 };
0609                         };
0610 
0611                         vcc3v3_s3: SWITCH_REG1 {
0612                                 regulator-name = "vcc3v3_s3";
0613                                 regulator-always-on;
0614                                 regulator-boot-on;
0615 
0616                                 regulator-state-mem {
0617                                         regulator-off-in-suspend;
0618                                 };
0619                         };
0620 
0621                         vcc3v3_s0: SWITCH_REG2 {
0622                                 regulator-name = "vcc3v3_s0";
0623                                 regulator-always-on;
0624                                 regulator-boot-on;
0625 
0626                                 regulator-state-mem {
0627                                         regulator-off-in-suspend;
0628                                 };
0629                         };
0630                 };
0631         };
0632 
0633         vdd_cpu_b: regulator@40 {
0634                 compatible = "silergy,syr827";
0635                 reg = <0x40>;
0636                 fcs,suspend-voltage-selector = <1>;
0637                 pinctrl-names = "default";
0638                 pinctrl-0 = <&vsel1_pin>;
0639                 regulator-name = "vdd_cpu_b";
0640                 regulator-always-on;
0641                 regulator-boot-on;
0642                 regulator-min-microvolt = <712500>;
0643                 regulator-max-microvolt = <1500000>;
0644                 regulator-ramp-delay = <1000>;
0645                 vin-supply = <&vcc_1v8>;
0646 
0647                 regulator-state-mem {
0648                         regulator-off-in-suspend;
0649                 };
0650         };
0651 
0652         vdd_gpu: regulator@41 {
0653                 compatible = "silergy,syr828";
0654                 reg = <0x41>;
0655                 fcs,suspend-voltage-selector = <1>;
0656                 pinctrl-names = "default";
0657                 pinctrl-0 = <&vsel2_pin>;
0658                 regulator-name = "vdd_gpu";
0659                 regulator-always-on;
0660                 regulator-boot-on;
0661                 regulator-min-microvolt = <712500>;
0662                 regulator-max-microvolt = <1500000>;
0663                 regulator-ramp-delay = <1000>;
0664                 vin-supply = <&vcc_1v8>;
0665 
0666                 regulator-state-mem {
0667                         regulator-off-in-suspend;
0668                 };
0669         };
0670 };
0671 
0672 &i2c1 {
0673         clock-frequency = <100000>;
0674         i2c-scl-falling-time-ns = <4>;
0675         i2c-scl-rising-time-ns = <168>;
0676         status = "okay";
0677 
0678         es8316: es8316@11 {
0679                 compatible = "everest,es8316";
0680                 reg = <0x11>;
0681                 clocks = <&cru SCLK_I2S_8CH_OUT>;
0682                 clock-names = "mclk";
0683                 #sound-dai-cells = <0>;
0684         };
0685 };
0686 
0687 &i2c3 {
0688         i2c-scl-falling-time-ns = <15>;
0689         i2c-scl-rising-time-ns = <450>;
0690         status = "okay";
0691 };
0692 
0693 &i2c4 {
0694         i2c-scl-falling-time-ns = <20>;
0695         i2c-scl-rising-time-ns = <600>;
0696         status = "okay";
0697 
0698         fusb0: fusb30x@22 {
0699                 compatible = "fcs,fusb302";
0700                 reg = <0x22>;
0701                 interrupt-parent = <&gpio1>;
0702                 interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
0703                 pinctrl-names = "default";
0704                 pinctrl-0 = <&fusb0_int_pin>;
0705                 vbus-supply = <&vbus_typec>;
0706 
0707                 connector {
0708                         compatible = "usb-c-connector";
0709                         data-role = "dual";
0710                         label = "USB-C";
0711                         op-sink-microwatt = <1000000>;
0712                         power-role = "dual";
0713                         sink-pdos =
0714                                 <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
0715                         source-pdos =
0716                                 <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
0717                         try-power-role = "sink";
0718 
0719                         ports {
0720                                 #address-cells = <1>;
0721                                 #size-cells = <0>;
0722 
0723                                 port@0 {
0724                                         reg = <0>;
0725 
0726                                         usbc_hs: endpoint {
0727                                                 remote-endpoint =
0728                                                         <&u2phy0_typec_hs>;
0729                                         };
0730                                 };
0731 
0732                                 port@1 {
0733                                         reg = <1>;
0734 
0735                                         usbc_ss: endpoint {
0736                                                 remote-endpoint =
0737                                                         <&tcphy0_typec_ss>;
0738                                         };
0739                                 };
0740 
0741                                 port@2 {
0742                                         reg = <2>;
0743 
0744                                         usbc_dp: endpoint {
0745                                                 remote-endpoint =
0746                                                         <&tcphy0_typec_dp>;
0747                                         };
0748                                 };
0749                         };
0750                 };
0751         };
0752 
0753         cw2015@62 {
0754                 compatible = "cellwise,cw2015";
0755                 reg = <0x62>;
0756                 cellwise,battery-profile = /bits/ 8 <
0757                         0x17 0x67 0x80 0x73 0x6E 0x6C 0x6B 0x63
0758                         0x77 0x51 0x5C 0x58 0x50 0x4C 0x48 0x36
0759                         0x15 0x0C 0x0C 0x19 0x5B 0x7D 0x6F 0x69
0760                         0x69 0x5B 0x0C 0x29 0x20 0x40 0x52 0x59
0761                         0x57 0x56 0x54 0x4F 0x3B 0x1F 0x7F 0x17
0762                         0x06 0x1A 0x30 0x5A 0x85 0x93 0x96 0x2D
0763                         0x48 0x77 0x9C 0xB3 0x80 0x52 0x94 0xCB
0764                         0x2F 0x00 0x64 0xA5 0xB5 0x11 0xF0 0x11
0765                 >;
0766                 cellwise,monitor-interval-ms = <5000>;
0767                 monitored-battery = <&bat>;
0768                 power-supplies = <&mains_charger>, <&fusb0>;
0769         };
0770 };
0771 
0772 &i2s1 {
0773         pinctrl-names = "default";
0774         pinctrl-0 = <&i2s_8ch_mclk_pin>, <&i2s1_2ch_bus>;
0775         rockchip,capture-channels = <8>;
0776         rockchip,playback-channels = <8>;
0777         status = "okay";
0778 };
0779 
0780 &io_domains {
0781         audio-supply = <&vcc_3v0>;
0782         gpio1830-supply = <&vcc_3v0>;
0783         sdmmc-supply = <&vcc_sdio>;
0784         status = "okay";
0785 };
0786 
0787 &pcie_phy {
0788         status = "okay";
0789 };
0790 
0791 &pcie0 {
0792         bus-scan-delay-ms = <1000>;
0793         ep-gpios = <&gpio2 RK_PD4 GPIO_ACTIVE_HIGH>;
0794         num-lanes = <4>;
0795         pinctrl-names = "default";
0796         pinctrl-0 = <&pcie_clkreqn_cpm>;
0797         vpcie0v9-supply = <&vcca0v9_s3>;
0798         vpcie1v8-supply = <&vcca1v8_s3>;
0799         vpcie3v3-supply = <&vcc3v3_ssd>;
0800         status = "okay";
0801 };
0802 
0803 &pinctrl {
0804         buttons {
0805                 pwrbtn_pin: pwrbtn-pin {
0806                         rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
0807                 };
0808 
0809                 lidbtn_pin: lidbtn-pin {
0810                         rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
0811                 };
0812         };
0813 
0814         dc-charger {
0815                 dc_det_pin: dc-det-pin {
0816                         rockchip,pins = <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_up>;
0817                 };
0818         };
0819 
0820         es8316 {
0821                 hp_det_pin: hp-det-pin {
0822                         rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_up>;
0823                 };
0824         };
0825 
0826         fusb302x {
0827                 fusb0_int_pin: fusb0-int-pin {
0828                         rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
0829                 };
0830         };
0831 
0832         i2s1 {
0833                 i2s_8ch_mclk_pin: i2s-8ch-mclk-pin {
0834                         rockchip,pins = <4 RK_PA0 1 &pcfg_pull_none>;
0835                 };
0836         };
0837 
0838         lcd-panel {
0839                 lcdvcc_en_pin: lcdvcc-en-pin {
0840                         rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
0841                 };
0842 
0843                 panel_en_pin: panel-en-pin {
0844                         rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
0845                 };
0846 
0847                 lcd_panel_reset_pin: lcd-panel-reset-pin {
0848                         rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
0849                 };
0850         };
0851 
0852         leds {
0853                 pwr_led_pin: pwr-led-pin {
0854                         rockchip,pins = <0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
0855                 };
0856 
0857                 slp_led_pin: slp-led-pin {
0858                         rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
0859                 };
0860         };
0861 
0862         pmic {
0863                 pmic_int_l_pin: pmic-int-l-pin {
0864                         rockchip,pins = <3 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>;
0865                 };
0866 
0867                 vsel1_pin: vsel1-pin {
0868                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
0869                 };
0870 
0871                 vsel2_pin: vsel2-pin {
0872                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
0873                 };
0874         };
0875 
0876         sdcard {
0877                 sdmmc0_pwr_h_pin: sdmmc0-pwr-h-pin {
0878                         rockchip,pins = <0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
0879                 };
0880 
0881         };
0882 
0883         sdio-pwrseq {
0884                 wifi_enable_h_pin: wifi-enable-h-pin {
0885                         rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
0886                 };
0887         };
0888 
0889         usb-typec {
0890                 vcc5v0_typec0_en_pin: vcc5v0-typec0-en-pin {
0891                         rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
0892                 };
0893         };
0894 
0895         usb2 {
0896                 pwr_5v_pin: pwr-5v-pin {
0897                         rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
0898                 };
0899 
0900                 vcc5v0_host_en_pin: vcc5v0-host-en-pin {
0901                         rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
0902                 };
0903         };
0904 
0905         wireless-bluetooth {
0906                 bt_wake_pin: bt-wake-pin {
0907                         rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
0908                 };
0909 
0910                 bt_host_wake_pin: bt-host-wake-pin {
0911                         rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
0912                 };
0913 
0914                 bt_reset_pin: bt-reset-pin {
0915                         rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
0916                 };
0917         };
0918 };
0919 
0920 &pmu_io_domains {
0921         pmu1830-supply = <&vcc_3v0>;
0922         status = "okay";
0923 };
0924 
0925 &pwm0 {
0926         status = "okay";
0927 };
0928 
0929 &pwm2 {
0930         status = "okay";
0931 };
0932 
0933 &saradc {
0934         vref-supply = <&vcca1v8_s3>;
0935         status = "okay";
0936 };
0937 
0938 &sdmmc {
0939         bus-width = <4>;
0940         cap-mmc-highspeed;
0941         cap-sd-highspeed;
0942         cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
0943         disable-wp;
0944         pinctrl-names = "default";
0945         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
0946         sd-uhs-sdr104;
0947         vmmc-supply = <&vcc3v0_sd>;
0948         vqmmc-supply = <&vcc_sdio>;
0949         status = "okay";
0950 };
0951 
0952 &sdio0 {
0953         bus-width = <4>;
0954         cap-sd-highspeed;
0955         cap-sdio-irq;
0956         keep-power-in-suspend;
0957         mmc-pwrseq = <&sdio_pwrseq>;
0958         non-removable;
0959         pinctrl-names = "default";
0960         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
0961         sd-uhs-sdr104;
0962         status = "okay";
0963 };
0964 
0965 &sdhci {
0966         bus-width = <8>;
0967         mmc-hs200-1_8v;
0968         non-removable;
0969         status = "okay";
0970 };
0971 
0972 &spi1 {
0973         max-freq = <10000000>;
0974         status = "okay";
0975 
0976         spiflash: flash@0 {
0977                 compatible = "jedec,spi-nor";
0978                 reg = <0>;
0979                 m25p,fast-read;
0980                 spi-max-frequency = <10000000>;
0981         };
0982 };
0983 
0984 &tcphy0 {
0985         status = "okay";
0986 };
0987 
0988 &tcphy0_dp {
0989         port {
0990                 tcphy0_typec_dp: endpoint {
0991                         remote-endpoint = <&usbc_dp>;
0992                 };
0993         };
0994 };
0995 
0996 &tcphy0_usb3 {
0997         port {
0998                 tcphy0_typec_ss: endpoint {
0999                         remote-endpoint = <&usbc_ss>;
1000                 };
1001         };
1002 };
1003 
1004 &tcphy1 {
1005         status = "okay";
1006 };
1007 
1008 &tsadc {
1009         /* tshut mode 0:CRU 1:GPIO */
1010         rockchip,hw-tshut-mode = <1>;
1011         /* tshut polarity 0:LOW 1:HIGH */
1012         rockchip,hw-tshut-polarity = <1>;
1013         status = "okay";
1014 };
1015 
1016 &u2phy0 {
1017         status = "okay";
1018 
1019         u2phy0_otg: otg-port {
1020                 status = "okay";
1021         };
1022 
1023         u2phy0_host: host-port {
1024                 phy-supply = <&vcc5v0_otg>;
1025                 status = "okay";
1026         };
1027 
1028         port {
1029                 u2phy0_typec_hs: endpoint {
1030                         remote-endpoint = <&usbc_hs>;
1031                 };
1032         };
1033 };
1034 
1035 &u2phy1 {
1036         status = "okay";
1037 
1038         u2phy1_otg: otg-port {
1039                 status = "okay";
1040         };
1041 
1042         u2phy1_host: host-port {
1043                 phy-supply = <&vcc5v0_otg>;
1044                 status = "okay";
1045         };
1046 };
1047 
1048 &uart0 {
1049         pinctrl-names = "default";
1050         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
1051         uart-has-rtscts;
1052         status = "okay";
1053 
1054         bluetooth {
1055                 compatible = "brcm,bcm4345c5";
1056                 clocks = <&rk808 1>;
1057                 clock-names = "lpo";
1058                 device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
1059                 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
1060                 max-speed = <1500000>;
1061                 pinctrl-names = "default";
1062                 pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
1063                 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
1064                 vbat-supply = <&wifi_bat>;
1065                 vddio-supply = <&vcc_wl>;
1066         };
1067 };
1068 
1069 &uart2 {
1070         status = "okay";
1071 };
1072 
1073 &usb_host0_ehci {
1074         status = "okay";
1075 };
1076 
1077 &usb_host0_ohci {
1078         status = "okay";
1079 };
1080 
1081 &usb_host1_ehci {
1082         status = "okay";
1083 };
1084 
1085 &usb_host1_ohci {
1086         status = "okay";
1087 };
1088 
1089 &usbdrd3_0 {
1090         status = "okay";
1091 };
1092 
1093 &usbdrd_dwc3_0 {
1094         dr_mode = "host";
1095         status = "okay";
1096 };
1097 
1098 &usbdrd3_1 {
1099         status = "okay";
1100 };
1101 
1102 &usbdrd_dwc3_1 {
1103         dr_mode = "host";
1104         status = "okay";
1105 };
1106 
1107 &vopb {
1108         status = "okay";
1109 };
1110 
1111 &vopb_mmu {
1112         status = "okay";
1113 };
1114 
1115 &vopl {
1116         status = "okay";
1117 };
1118 
1119 &vopl_mmu {
1120         status = "okay";
1121 };