Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Copyright 2016 MediaTek Inc.
0004  */
0005 
0006 #include <dt-bindings/input/input.h>
0007 #include <dt-bindings/input/linux-event-codes.h>
0008 #include <dt-bindings/regulator/dlg,da9211-regulator.h>
0009 #include <dt-bindings/gpio/gpio.h>
0010 #include "mt8173.dtsi"
0011 
0012 / {
0013         aliases {
0014                 mmc0 = &mmc0;
0015                 mmc1 = &mmc1;
0016                 mmc2 = &mmc3;
0017         };
0018 
0019         memory@40000000 {
0020                 device_type = "memory";
0021                 reg = <0 0x40000000 0 0x80000000>;
0022         };
0023 
0024         backlight: backlight {
0025                 compatible = "pwm-backlight";
0026                 pwms = <&pwm0 0 1000000>;
0027                 power-supply = <&bl_fixed_reg>;
0028                 enable-gpios = <&pio 95 GPIO_ACTIVE_HIGH>;
0029 
0030                 pinctrl-names = "default";
0031                 pinctrl-0 = <&panel_backlight_en_pins>;
0032                 status = "okay";
0033         };
0034 
0035         bl_fixed_reg: fixedregulator2 {
0036                 compatible = "regulator-fixed";
0037                 regulator-name = "bl_fixed";
0038                 regulator-min-microvolt = <1800000>;
0039                 regulator-max-microvolt = <1800000>;
0040                 startup-delay-us = <1000>;
0041                 enable-active-high;
0042                 gpio = <&pio 32 GPIO_ACTIVE_HIGH>;
0043                 pinctrl-names = "default";
0044                 pinctrl-0 = <&bl_fixed_pins>;
0045         };
0046 
0047         chosen {
0048                 stdout-path = "serial0:115200n8";
0049         };
0050 
0051         gpio_keys: gpio-keys {
0052                 compatible = "gpio-keys";
0053                 pinctrl-names = "default";
0054                 pinctrl-0 = <&gpio_keys_pins>;
0055 
0056                 switch-lid {
0057                         label = "Lid";
0058                         gpios = <&pio 69 GPIO_ACTIVE_LOW>;
0059                         linux,code = <SW_LID>;
0060                         linux,input-type = <EV_SW>;
0061                         gpio-key,wakeup;
0062                 };
0063 
0064                 switch-power {
0065                         label = "Power";
0066                         gpios = <&pio 14 GPIO_ACTIVE_HIGH>;
0067                         linux,code = <KEY_POWER>;
0068                         debounce-interval = <30>;
0069                         gpio-key,wakeup;
0070                 };
0071 
0072                 switch-tablet-mode {
0073                         label = "Tablet_mode";
0074                         gpios = <&pio 121 GPIO_ACTIVE_HIGH>;
0075                         linux,code = <SW_TABLET_MODE>;
0076                         linux,input-type = <EV_SW>;
0077                         gpio-key,wakeup;
0078                 };
0079 
0080                 switch-volume-down {
0081                         label = "Volume_down";
0082                         gpios = <&pio 123 GPIO_ACTIVE_LOW>;
0083                         linux,code = <KEY_VOLUMEDOWN>;
0084                 };
0085 
0086                 switch-volume-up {
0087                         label = "Volume_up";
0088                         gpios = <&pio 124 GPIO_ACTIVE_LOW>;
0089                         linux,code = <KEY_VOLUMEUP>;
0090                 };
0091         };
0092 
0093         panel: panel {
0094                 compatible = "lg,lp120up1";
0095                 power-supply = <&panel_fixed_3v3>;
0096                 backlight = <&backlight>;
0097 
0098                 port {
0099                         panel_in: endpoint {
0100                                 remote-endpoint = <&ps8640_out>;
0101                         };
0102                 };
0103         };
0104 
0105         panel_fixed_3v3: regulator1 {
0106                 compatible = "regulator-fixed";
0107                 regulator-name = "PANEL_3V3";
0108                 regulator-min-microvolt = <3300000>;
0109                 regulator-max-microvolt = <3300000>;
0110                 enable-active-high;
0111                 gpio = <&pio 41 GPIO_ACTIVE_HIGH>;
0112                 pinctrl-names = "default";
0113                 pinctrl-0 = <&panel_fixed_pins>;
0114         };
0115 
0116         ps8640_fixed_1v2: regulator2 {
0117                 compatible = "regulator-fixed";
0118                 regulator-name = "PS8640_1V2";
0119                 regulator-min-microvolt = <1200000>;
0120                 regulator-max-microvolt = <1200000>;
0121                 regulator-enable-ramp-delay = <2000>;
0122                 enable-active-high;
0123                 regulator-boot-on;
0124                 gpio = <&pio 30 GPIO_ACTIVE_HIGH>;
0125                 pinctrl-names = "default";
0126                 pinctrl-0 = <&ps8640_fixed_pins>;
0127         };
0128 
0129         sdio_fixed_3v3: fixedregulator0 {
0130                 compatible = "regulator-fixed";
0131                 regulator-name = "3V3";
0132                 regulator-min-microvolt = <3300000>;
0133                 regulator-max-microvolt = <3300000>;
0134                 gpio = <&pio 85 GPIO_ACTIVE_HIGH>;
0135                 pinctrl-names = "default";
0136                 pinctrl-0 = <&sdio_fixed_3v3_pins>;
0137         };
0138 
0139         sound: sound {
0140                 compatible = "mediatek,mt8173-rt5650";
0141                 mediatek,audio-codec = <&rt5650 &hdmi0>;
0142                 mediatek,platform = <&afe>;
0143                 pinctrl-names = "default";
0144                 pinctrl-0 = <&aud_i2s2>;
0145 
0146                 mediatek,mclk = <1>;
0147                 codec-capture {
0148                         sound-dai = <&rt5650 1>;
0149                 };
0150         };
0151 
0152         hdmicon: connector {
0153                 compatible = "hdmi-connector";
0154                 label = "hdmi";
0155                 type = "a";
0156                 ddc-i2c-bus = <&hdmiddc0>;
0157 
0158                 port {
0159                         hdmi_connector_in: endpoint {
0160                                 remote-endpoint = <&hdmi0_out>;
0161                         };
0162                 };
0163         };
0164 };
0165 
0166 &mfg_async {
0167         domain-supply = <&da9211_vgpu_reg>;
0168 };
0169 
0170 &cec {
0171         status = "okay";
0172 };
0173 
0174 &cpu0 {
0175         proc-supply = <&mt6397_vpca15_reg>;
0176 };
0177 
0178 &cpu1 {
0179         proc-supply = <&mt6397_vpca15_reg>;
0180 };
0181 
0182 &cpu2 {
0183         proc-supply = <&da9211_vcpu_reg>;
0184         sram-supply = <&mt6397_vsramca7_reg>;
0185 };
0186 
0187 &cpu3 {
0188         proc-supply = <&da9211_vcpu_reg>;
0189         sram-supply = <&mt6397_vsramca7_reg>;
0190 };
0191 
0192 &cpu_thermal {
0193         sustainable-power = <4500>; /* milliwatts */
0194         trips {
0195                 threshold: trip-point0 {
0196                         temperature = <60000>;
0197                 };
0198 
0199                 target: trip-point1 {
0200                         temperature = <65000>;
0201                 };
0202         };
0203 };
0204 
0205 &dsi0 {
0206         status = "okay";
0207         ports {
0208                 port {
0209                         dsi0_out: endpoint {
0210                                 remote-endpoint = <&ps8640_in>;
0211                         };
0212                 };
0213         };
0214 };
0215 
0216 &dpi0 {
0217         status = "okay";
0218 };
0219 
0220 &hdmi0 {
0221         status = "okay";
0222         ports {
0223                 port@1 {
0224                         reg = <1>;
0225 
0226                         hdmi0_out: endpoint {
0227                                 remote-endpoint = <&hdmi_connector_in>;
0228                         };
0229                 };
0230         };
0231 };
0232 
0233 &hdmi_phy {
0234         status = "okay";
0235         mediatek,ibias = <0xc>;
0236 };
0237 
0238 &i2c0 {
0239         status = "okay";
0240 
0241         rt5650: audio-codec@1a {
0242                 compatible = "realtek,rt5650";
0243                 reg = <0x1a>;
0244                 avdd-supply = <&mt6397_vgp1_reg>;
0245                 cpvdd-supply = <&mt6397_vcama_reg>;
0246                 interrupt-parent = <&pio>;
0247                 interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
0248                 pinctrl-names = "default";
0249                 pinctrl-0 = <&rt5650_irq>;
0250                 #sound-dai-cells = <1>;
0251                 realtek,dmic1-data-pin = <2>;
0252                 realtek,jd-mode = <2>;
0253         };
0254 
0255         ps8640: edp-bridge@8 {
0256                 compatible = "parade,ps8640";
0257                 reg = <0x8>;
0258                 powerdown-gpios = <&pio 127 GPIO_ACTIVE_LOW>;
0259                 reset-gpios = <&pio 115 GPIO_ACTIVE_LOW>;
0260                 pinctrl-names = "default";
0261                 pinctrl-0 = <&ps8640_pins>;
0262                 vdd12-supply = <&ps8640_fixed_1v2>;
0263                 vdd33-supply = <&mt6397_vgp2_reg>;
0264 
0265                 ports {
0266                         #address-cells = <1>;
0267                         #size-cells = <0>;
0268 
0269                         port@0 {
0270                                 reg = <0>;
0271 
0272                                 ps8640_in: endpoint {
0273                                         remote-endpoint = <&dsi0_out>;
0274                                 };
0275                         };
0276 
0277                         port@1 {
0278                                 reg = <1>;
0279 
0280                                 ps8640_out: endpoint {
0281                                         remote-endpoint = <&panel_in>;
0282                                 };
0283                         };
0284                 };
0285         };
0286 };
0287 
0288 &i2c1 {
0289         clock-frequency = <1500000>;
0290         status = "okay";
0291 
0292         da9211: da9211@68 {
0293                 compatible = "dlg,da9211";
0294                 reg = <0x68>;
0295                 interrupt-parent = <&pio>;
0296                 interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
0297 
0298                 regulators {
0299                         da9211_vcpu_reg: BUCKA {
0300                                 regulator-name = "VBUCKA";
0301                                 regulator-min-microvolt = < 700000>;
0302                                 regulator-max-microvolt = <1310000>;
0303                                 regulator-min-microamp = <2000000>;
0304                                 regulator-max-microamp = <4400000>;
0305                                 regulator-ramp-delay = <10000>;
0306                                 regulator-always-on;
0307                                 regulator-allowed-modes = <DA9211_BUCK_MODE_SYNC
0308                                                            DA9211_BUCK_MODE_AUTO>;
0309                         };
0310 
0311                         da9211_vgpu_reg: BUCKB {
0312                                 regulator-name = "VBUCKB";
0313                                 regulator-min-microvolt = < 700000>;
0314                                 regulator-max-microvolt = <1310000>;
0315                                 regulator-min-microamp = <2000000>;
0316                                 regulator-max-microamp = <3000000>;
0317                                 regulator-ramp-delay = <10000>;
0318                         };
0319                 };
0320         };
0321 };
0322 
0323 &i2c2 {
0324         status = "okay";
0325 
0326         tpm: tpm@20 {
0327                 compatible = "infineon,slb9645tt";
0328                 reg = <0x20>;
0329                 powered-while-suspended;
0330         };
0331 };
0332 
0333 &i2c3 {
0334         clock-frequency = <400000>;
0335         status = "okay";
0336 
0337         touchscreen: touchscreen@10 {
0338                 compatible = "elan,ekth3500";
0339                 reg = <0x10>;
0340                 interrupt-parent = <&pio>;
0341                 interrupts = <88 IRQ_TYPE_LEVEL_LOW>;
0342         };
0343 };
0344 
0345 &i2c4 {
0346         clock-frequency = <400000>;
0347         status = "okay";
0348         pinctrl-names = "default";
0349         pinctrl-0 = <&trackpad_irq>;
0350 
0351         trackpad: trackpad@15 {
0352                 compatible = "elan,ekth3000";
0353                 interrupt-parent = <&pio>;
0354                 interrupts = <117 IRQ_TYPE_LEVEL_LOW>;
0355                 reg = <0x15>;
0356                 vcc-supply = <&mt6397_vgp6_reg>;
0357                 wakeup-source;
0358         };
0359 };
0360 
0361 &mipi_tx0 {
0362         status = "okay";
0363 };
0364 
0365 &mmc0 {
0366         status = "okay";
0367         pinctrl-names = "default", "state_uhs";
0368         pinctrl-0 = <&mmc0_pins_default>;
0369         pinctrl-1 = <&mmc0_pins_uhs>;
0370         bus-width = <8>;
0371         max-frequency = <200000000>;
0372         cap-mmc-highspeed;
0373         mmc-hs200-1_8v;
0374         mmc-hs400-1_8v;
0375         cap-mmc-hw-reset;
0376         hs400-ds-delay = <0x14015>;
0377         mediatek,hs200-cmd-int-delay = <30>;
0378         mediatek,hs400-cmd-int-delay = <14>;
0379         mediatek,hs400-cmd-resp-sel-rising;
0380         vmmc-supply = <&mt6397_vemc_3v3_reg>;
0381         vqmmc-supply = <&mt6397_vio18_reg>;
0382         assigned-clocks = <&topckgen CLK_TOP_MSDC50_0_SEL>;
0383         assigned-clock-parents = <&topckgen CLK_TOP_MSDCPLL_D2>;
0384         non-removable;
0385 };
0386 
0387 &mmc1 {
0388         status = "okay";
0389         pinctrl-names = "default", "state_uhs";
0390         pinctrl-0 = <&mmc1_pins_default>;
0391         pinctrl-1 = <&mmc1_pins_uhs>;
0392         bus-width = <4>;
0393         max-frequency = <200000000>;
0394         cap-sd-highspeed;
0395         sd-uhs-sdr50;
0396         sd-uhs-sdr104;
0397         cd-gpios = <&pio 1 GPIO_ACTIVE_LOW>;
0398         vmmc-supply = <&mt6397_vmch_reg>;
0399         vqmmc-supply = <&mt6397_vmc_reg>;
0400 };
0401 
0402 &mmc3 {
0403         status = "okay";
0404         pinctrl-names = "default", "state_uhs";
0405         pinctrl-0 = <&mmc3_pins_default>;
0406         pinctrl-1 = <&mmc3_pins_uhs>;
0407         bus-width = <4>;
0408         max-frequency = <200000000>;
0409         cap-sd-highspeed;
0410         sd-uhs-sdr50;
0411         sd-uhs-sdr104;
0412         keep-power-in-suspend;
0413         wakeup-source;
0414         cap-sdio-irq;
0415         vmmc-supply = <&sdio_fixed_3v3>;
0416         vqmmc-supply = <&mt6397_vgp3_reg>;
0417         non-removable;
0418         cap-power-off-card;
0419 
0420         #address-cells = <1>;
0421         #size-cells = <0>;
0422 
0423         btmrvl: btmrvl@2 {
0424                 compatible = "marvell,sd8897-bt";
0425                 reg = <2>;
0426                 interrupt-parent = <&pio>;
0427                 interrupts = <119 IRQ_TYPE_LEVEL_LOW>;
0428                 marvell,wakeup-pin = /bits/ 16 <0x0d>;
0429                 marvell,wakeup-gap-ms = /bits/ 16 <0x64>;
0430         };
0431 
0432         mwifiex: mwifiex@1 {
0433                 compatible = "marvell,sd8897";
0434                 reg = <1>;
0435                 interrupt-parent = <&pio>;
0436                 interrupts = <38 IRQ_TYPE_LEVEL_LOW>;
0437                 marvell,wakeup-pin = <3>;
0438         };
0439 };
0440 
0441 &nor_flash {
0442         status = "okay";
0443         pinctrl-names = "default";
0444         pinctrl-0 = <&nor_gpio1_pins>;
0445 
0446         flash@0 {
0447                 compatible = "jedec,spi-nor";
0448                 reg = <0>;
0449                 spi-max-frequency = <50000000>;
0450         };
0451 };
0452 
0453 &pio {
0454         gpio-line-names = "EC_INT_1V8",
0455                           "SD_CD_L",
0456                           "ALC5514_IRQ",
0457                           "ALC5650_IRQ",
0458                           /*
0459                            * AP_FLASH_WP_L is crossystem ABI. Schematics
0460                            * call it SFWP_B.
0461                            */
0462                           "AP_FLASH_WP_L",
0463                           "SFIN",
0464                           "SFCS0",
0465                           "SFHOLD",
0466                           "SFOUT",
0467                           "SFCK",
0468                           "WRAP_EVENT_S_EINT10",
0469                           "PMU_INT",
0470                           "I2S2_WS_ALC5650",
0471                           "I2S2_BCK_ALC5650",
0472                           "PWR_BTN_1V8",
0473                           "DA9212_IRQ",
0474                           "IDDIG",
0475                           "WATCHDOG",
0476                           "CEC",
0477                           "HDMISCK",
0478                           "HDMISD",
0479                           "HTPLG",
0480                           "MSDC3_DAT0",
0481                           "MSDC3_DAT1",
0482                           "MSDC3_DAT2",
0483                           "MSDC3_DAT3",
0484                           "MSDC3_CLK",
0485                           "MSDC3_CMD",
0486                           "USB_C0_OC_FLAGB",
0487                           "USBA_OC1_L",
0488                           "PS8640_1V2_ENABLE",
0489                           "THERM_ALERT_N",
0490                           "PANEL_LCD_POWER_EN",
0491                           "ANX7688_CHIP_PD_C",
0492                           "EC_IN_RW_1V8",
0493                           "ANX7688_1V_EN_C",
0494                           "USB_DP_HPD_C",
0495                           "TPM_DAVINT_N",
0496                           "MARVELL8897_IRQ",
0497                           "EN_USB_A0_PWR",
0498                           "USBA_A0_OC_L",
0499                           "EN_PP3300_DX_EDP",
0500                           "",
0501                           "SOC_I2C2_1V8_SDA_400K",
0502                           "SOC_I2C2_1V8_SCL_400K",
0503                           "SOC_I2C0_1V8_SDA_400K",
0504                           "SOC_I2C0_1V8_SCL_400K",
0505                           "EMMC_ID1",
0506                           "EMMC_ID0",
0507                           "MEM_CONFIG3",
0508                           "EMMC_ID2",
0509                           "MEM_CONFIG1",
0510                           "MEM_CONFIG2",
0511                           "BRD_ID2",
0512                           "MEM_CONFIG0",
0513                           "BRD_ID0",
0514                           "BRD_ID1",
0515                           "EMMC_DAT0",
0516                           "EMMC_DAT1",
0517                           "EMMC_DAT2",
0518                           "EMMC_DAT3",
0519                           "EMMC_DAT4",
0520                           "EMMC_DAT5",
0521                           "EMMC_DAT6",
0522                           "EMMC_DAT7",
0523                           "EMMC_CLK",
0524                           "EMMC_CMD",
0525                           "EMMC_RCLK",
0526                           "PLT_RST_L",
0527                           "LID_OPEN_1V8_L",
0528                           "AUDIO_SPI_MISO_R",
0529                           "",
0530                           "AC_OK_1V8",
0531                           "SD_DATA0",
0532                           "SD_DATA1",
0533                           "SD_DATA2",
0534                           "SD_DATA3",
0535                           "SD_CLK",
0536                           "SD_CMD",
0537                           "PWRAP_SPI0_MI",
0538                           "PWRAP_SPI0_MO",
0539                           "PWRAP_SPI0_CK",
0540                           "PWRAP_SPI0_CSN",
0541                           "",
0542                           "",
0543                           "WIFI_PDN",
0544                           "RTC32K_1V8",
0545                           "DISP_PWM0",
0546                           "TOUCHSCREEN_INT_L",
0547                           "",
0548                           "SRCLKENA0",
0549                           "SRCLKENA1",
0550                           "PS8640_MODE_CONF",
0551                           "TOUCHSCREEN_RESET_R",
0552                           "PLATFORM_PROCHOT_L",
0553                           "PANEL_POWER_EN",
0554                           "REC_MODE_L",
0555                           "EC_FW_UPDATE_L",
0556                           "ACCEL2_INT_L",
0557                           "HDMI_DP_INT",
0558                           "ACCELGYRO3_INT_L",
0559                           "ACCELGYRO4_INT_L",
0560                           "SPI_EC_CLK",
0561                           "SPI_EC_MI",
0562                           "SPI_EC_MO",
0563                           "SPI_EC_CSN",
0564                           "SOC_I2C3_1V8_SDA_400K",
0565                           "SOC_I2C3_1V8_SCL_400K",
0566                           "",
0567                           "",
0568                           "",
0569                           "",
0570                           "",
0571                           "",
0572                           "",
0573                           "PS8640_SYSRSTN_1V8",
0574                           "APIN_MAX98090_DOUT2",
0575                           "TP_INT_1V8_L_R",
0576                           "RST_USB_HUB_R",
0577                           "BT_WAKE_L",
0578                           "ACCEL1_INT_L",
0579                           "TABLET_MODE_L",
0580                           "",
0581                           "V_UP_IN_L_R",
0582                           "V_DOWN_IN_L_R",
0583                           "SOC_I2C1_1V8_SDA_1M",
0584                           "SOC_I2C1_1V8_SCL_1M",
0585                           "PS8640_PDN_1V8",
0586                           "MAX98090_LRCLK",
0587                           "MAX98090_BCLK",
0588                           "MAX98090_MCLK",
0589                           "APOUT_MAX98090_DIN",
0590                           "APIN_MAX98090_DOUT",
0591                           "SOC_I2C4_1V8_SDA_400K",
0592                           "SOC_I2C4_1V8_SCL_400K";
0593 
0594         aud_i2s2: aud_i2s2 {
0595                 pins1 {
0596                         pinmux = <MT8173_PIN_128_I2S0_LRCK__FUNC_I2S1_WS>,
0597                                  <MT8173_PIN_129_I2S0_BCK__FUNC_I2S1_BCK>,
0598                                  <MT8173_PIN_130_I2S0_MCK__FUNC_I2S1_MCK>,
0599                                  <MT8173_PIN_131_I2S0_DATA0__FUNC_I2S1_DO_1>,
0600                                  <MT8173_PIN_12_EINT12__FUNC_I2S2_WS>,
0601                                  <MT8173_PIN_13_EINT13__FUNC_I2S2_BCK>,
0602                                  <MT8173_PIN_132_I2S0_DATA1__FUNC_I2S2_DI_2>;
0603                         bias-pull-down;
0604                 };
0605         };
0606 
0607         bl_fixed_pins: bl_fixed_pins {
0608                 pins1 {
0609                         pinmux = <MT8173_PIN_32_UTXD2__FUNC_GPIO32>;
0610                         output-low;
0611                 };
0612         };
0613 
0614         bt_wake_pins: bt_wake_pins {
0615                 pins1 {
0616                         pinmux = <MT8173_PIN_119_KPROW0__FUNC_GPIO119>;
0617                         bias-pull-up;
0618                 };
0619         };
0620 
0621         disp_pwm0_pins: disp_pwm0_pins {
0622                 pins1 {
0623                         pinmux = <MT8173_PIN_87_DISP_PWM0__FUNC_DISP_PWM0>;
0624                         output-low;
0625                 };
0626         };
0627 
0628         gpio_keys_pins: gpio_keys_pins {
0629                 volume_pins {
0630                         pinmux = <MT8173_PIN_123_KPCOL1__FUNC_GPIO123>,
0631                                  <MT8173_PIN_124_KPCOL2__FUNC_GPIO124>;
0632                         bias-pull-up;
0633                 };
0634 
0635                 tablet_mode_pins {
0636                         pinmux = <MT8173_PIN_121_KPROW2__FUNC_GPIO121>;
0637                         bias-pull-up;
0638                 };
0639         };
0640 
0641         hdmi_mux_pins: hdmi_mux_pins {
0642                 pins1 {
0643                         pinmux = <MT8173_PIN_36_DAISYNC__FUNC_GPIO36>;
0644                 };
0645         };
0646 
0647         i2c1_pins_a: i2c1 {
0648                 da9211_pins {
0649                         pinmux = <MT8173_PIN_15_EINT15__FUNC_GPIO15>;
0650                         bias-pull-up;
0651                 };
0652         };
0653 
0654         mmc0_pins_default: mmc0default {
0655                 pins_cmd_dat {
0656                         pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
0657                                  <MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
0658                                  <MT8173_PIN_59_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
0659                                  <MT8173_PIN_60_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
0660                                  <MT8173_PIN_61_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
0661                                  <MT8173_PIN_62_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
0662                                  <MT8173_PIN_63_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
0663                                  <MT8173_PIN_64_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
0664                                  <MT8173_PIN_66_MSDC0_CMD__FUNC_MSDC0_CMD>;
0665                         bias-pull-up;
0666                 };
0667 
0668                 pins_clk {
0669                         pinmux = <MT8173_PIN_65_MSDC0_CLK__FUNC_MSDC0_CLK>;
0670                         bias-pull-down;
0671                 };
0672 
0673                 pins_rst {
0674                         pinmux = <MT8173_PIN_68_MSDC0_RST___FUNC_MSDC0_RSTB>;
0675                         bias-pull-up;
0676                 };
0677         };
0678 
0679         mmc1_pins_default: mmc1default {
0680                 pins_cmd_dat {
0681                         pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
0682                                  <MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
0683                                  <MT8173_PIN_75_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
0684                                  <MT8173_PIN_76_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
0685                                  <MT8173_PIN_78_MSDC1_CMD__FUNC_MSDC1_CMD>;
0686                         input-enable;
0687                         drive-strength = <MTK_DRIVE_4mA>;
0688                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0689                 };
0690 
0691                 pins_clk {
0692                         pinmux = <MT8173_PIN_77_MSDC1_CLK__FUNC_MSDC1_CLK>;
0693                         bias-pull-down;
0694                         drive-strength = <MTK_DRIVE_4mA>;
0695                 };
0696 
0697                 pins_insert {
0698                         pinmux = <MT8173_PIN_1_EINT1__FUNC_GPIO1>;
0699                         bias-pull-up;
0700                 };
0701         };
0702 
0703         mmc3_pins_default: mmc3default {
0704                 pins_dat {
0705                         pinmux = <MT8173_PIN_22_MSDC3_DAT0__FUNC_MSDC3_DAT0>,
0706                                  <MT8173_PIN_23_MSDC3_DAT1__FUNC_MSDC3_DAT1>,
0707                                  <MT8173_PIN_24_MSDC3_DAT2__FUNC_MSDC3_DAT2>,
0708                                  <MT8173_PIN_25_MSDC3_DAT3__FUNC_MSDC3_DAT3>;
0709                         input-enable;
0710                         drive-strength = <MTK_DRIVE_8mA>;
0711                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0712                 };
0713 
0714                 pins_cmd {
0715                         pinmux = <MT8173_PIN_27_MSDC3_CMD__FUNC_MSDC3_CMD>;
0716                         input-enable;
0717                         drive-strength = <MTK_DRIVE_8mA>;
0718                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0719                 };
0720 
0721                 pins_clk {
0722                         pinmux = <MT8173_PIN_26_MSDC3_CLK__FUNC_MSDC3_CLK>;
0723                         bias-pull-down;
0724                         drive-strength = <MTK_DRIVE_8mA>;
0725                 };
0726         };
0727 
0728         mmc0_pins_uhs: mmc0 {
0729                 pins_cmd_dat {
0730                         pinmux = <MT8173_PIN_57_MSDC0_DAT0__FUNC_MSDC0_DAT0>,
0731                                  <MT8173_PIN_58_MSDC0_DAT1__FUNC_MSDC0_DAT1>,
0732                                  <MT8173_PIN_59_MSDC0_DAT2__FUNC_MSDC0_DAT2>,
0733                                  <MT8173_PIN_60_MSDC0_DAT3__FUNC_MSDC0_DAT3>,
0734                                  <MT8173_PIN_61_MSDC0_DAT4__FUNC_MSDC0_DAT4>,
0735                                  <MT8173_PIN_62_MSDC0_DAT5__FUNC_MSDC0_DAT5>,
0736                                  <MT8173_PIN_63_MSDC0_DAT6__FUNC_MSDC0_DAT6>,
0737                                  <MT8173_PIN_64_MSDC0_DAT7__FUNC_MSDC0_DAT7>,
0738                                  <MT8173_PIN_66_MSDC0_CMD__FUNC_MSDC0_CMD>;
0739                         input-enable;
0740                         drive-strength = <MTK_DRIVE_6mA>;
0741                         bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
0742                 };
0743 
0744                 pins_clk {
0745                         pinmux = <MT8173_PIN_65_MSDC0_CLK__FUNC_MSDC0_CLK>;
0746                         drive-strength = <MTK_DRIVE_6mA>;
0747                         bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
0748                 };
0749 
0750                 pins_ds {
0751                         pinmux = <MT8173_PIN_67_MSDC0_DSL__FUNC_MSDC0_DSL>;
0752                         drive-strength = <MTK_DRIVE_10mA>;
0753                         bias-pull-down = <MTK_PUPD_SET_R1R0_01>;
0754                 };
0755 
0756                 pins_rst {
0757                         pinmux = <MT8173_PIN_68_MSDC0_RST___FUNC_MSDC0_RSTB>;
0758                         bias-pull-up;
0759                 };
0760         };
0761 
0762         mmc1_pins_uhs: mmc1 {
0763                 pins_cmd_dat {
0764                         pinmux = <MT8173_PIN_73_MSDC1_DAT0__FUNC_MSDC1_DAT0>,
0765                                  <MT8173_PIN_74_MSDC1_DAT1__FUNC_MSDC1_DAT1>,
0766                                  <MT8173_PIN_75_MSDC1_DAT2__FUNC_MSDC1_DAT2>,
0767                                  <MT8173_PIN_76_MSDC1_DAT3__FUNC_MSDC1_DAT3>,
0768                                  <MT8173_PIN_78_MSDC1_CMD__FUNC_MSDC1_CMD>;
0769                         input-enable;
0770                         drive-strength = <MTK_DRIVE_6mA>;
0771                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0772                 };
0773 
0774                 pins_clk {
0775                         pinmux = <MT8173_PIN_77_MSDC1_CLK__FUNC_MSDC1_CLK>;
0776                         drive-strength = <MTK_DRIVE_8mA>;
0777                         bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
0778                 };
0779         };
0780 
0781         mmc3_pins_uhs: mmc3 {
0782                 pins_dat {
0783                         pinmux = <MT8173_PIN_22_MSDC3_DAT0__FUNC_MSDC3_DAT0>,
0784                                  <MT8173_PIN_23_MSDC3_DAT1__FUNC_MSDC3_DAT1>,
0785                                  <MT8173_PIN_24_MSDC3_DAT2__FUNC_MSDC3_DAT2>,
0786                                  <MT8173_PIN_25_MSDC3_DAT3__FUNC_MSDC3_DAT3>;
0787                         input-enable;
0788                         drive-strength = <MTK_DRIVE_8mA>;
0789                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0790                 };
0791 
0792                 pins_cmd {
0793                         pinmux = <MT8173_PIN_27_MSDC3_CMD__FUNC_MSDC3_CMD>;
0794                         input-enable;
0795                         drive-strength = <MTK_DRIVE_8mA>;
0796                         bias-pull-up = <MTK_PUPD_SET_R1R0_10>;
0797                 };
0798 
0799                 pins_clk {
0800                         pinmux = <MT8173_PIN_26_MSDC3_CLK__FUNC_MSDC3_CLK>;
0801                         drive-strength = <MTK_DRIVE_8mA>;
0802                         bias-pull-down = <MTK_PUPD_SET_R1R0_10>;
0803                 };
0804         };
0805 
0806         nor_gpio1_pins: nor {
0807                 pins1 {
0808                         pinmux = <MT8173_PIN_6_EINT6__FUNC_SFCS0>,
0809                                  <MT8173_PIN_7_EINT7__FUNC_SFHOLD>,
0810                                  <MT8173_PIN_8_EINT8__FUNC_SFIN>;
0811                         input-enable;
0812                         drive-strength = <MTK_DRIVE_4mA>;
0813                         bias-pull-up;
0814                 };
0815 
0816                 pins2 {
0817                         pinmux = <MT8173_PIN_5_EINT5__FUNC_SFOUT>;
0818                         drive-strength = <MTK_DRIVE_4mA>;
0819                         bias-pull-up;
0820                 };
0821 
0822                 pins_clk {
0823                         pinmux = <MT8173_PIN_9_EINT9__FUNC_SFCK>;
0824                         input-enable;
0825                         drive-strength = <MTK_DRIVE_4mA>;
0826                         bias-pull-up;
0827                 };
0828         };
0829 
0830         panel_backlight_en_pins: panel_backlight_en_pins {
0831                 pins1 {
0832                         pinmux = <MT8173_PIN_95_PCM_TX__FUNC_GPIO95>;
0833                 };
0834         };
0835 
0836         panel_fixed_pins: panel_fixed_pins {
0837                 pins1 {
0838                         pinmux = <MT8173_PIN_41_CMMCLK__FUNC_GPIO41>;
0839                 };
0840         };
0841 
0842         ps8640_pins: ps8640_pins {
0843                 pins1 {
0844                         pinmux = <MT8173_PIN_92_PCM_CLK__FUNC_GPIO92>,
0845                                  <MT8173_PIN_115_URTS0__FUNC_GPIO115>,
0846                                  <MT8173_PIN_127_LCM_RST__FUNC_GPIO127>;
0847                 };
0848         };
0849 
0850         ps8640_fixed_pins: ps8640_fixed_pins {
0851                 pins1 {
0852                         pinmux = <MT8173_PIN_30_URTS2__FUNC_GPIO30>;
0853                 };
0854         };
0855 
0856         rt5650_irq: rt5650_irq {
0857                 pins1 {
0858                         pinmux = <MT8173_PIN_3_EINT3__FUNC_GPIO3>;
0859                         bias-pull-down;
0860                 };
0861         };
0862 
0863         sdio_fixed_3v3_pins: sdio_fixed_3v3_pins {
0864                 pins1 {
0865                         pinmux = <MT8173_PIN_85_AUD_DAT_MOSI__FUNC_GPIO85>;
0866                         output-low;
0867                 };
0868         };
0869 
0870         spi_pins_a: spi1 {
0871                 pins1 {
0872                         pinmux = <MT8173_PIN_0_EINT0__FUNC_GPIO0>;
0873                         bias-pull-up;
0874                 };
0875 
0876                 pins_spi {
0877                         pinmux = <MT8173_PIN_102_MSDC2_DAT2__FUNC_SPI_CK_1_>,
0878                                  <MT8173_PIN_103_MSDC2_DAT3__FUNC_SPI_MI_1_>,
0879                                  <MT8173_PIN_104_MSDC2_CLK__FUNC_SPI_MO_1_>,
0880                                  <MT8173_PIN_105_MSDC2_CMD__FUNC_SPI_CS_1_>;
0881                         bias-disable;
0882                 };
0883         };
0884 
0885         trackpad_irq: trackpad_irq {
0886                 pins1 {
0887                         pinmux = <MT8173_PIN_117_URXD3__FUNC_GPIO117>;
0888                         input-enable;
0889                         bias-pull-up;
0890                 };
0891         };
0892 
0893         usb_pins: usb {
0894                 pins1 {
0895                         pinmux = <MT8173_PIN_101_MSDC2_DAT1__FUNC_GPIO101>;
0896                         output-high;
0897                         bias-disable;
0898                 };
0899         };
0900 
0901         wifi_wake_pins: wifi_wake_pins {
0902                 pins1 {
0903                         pinmux = <MT8173_PIN_38_CONN_RST__FUNC_GPIO38>;
0904                         bias-pull-up;
0905                 };
0906         };
0907 };
0908 
0909 &pwm0 {
0910         pinctrl-names = "default";
0911         pinctrl-0 = <&disp_pwm0_pins>;
0912         status = "okay";
0913 };
0914 
0915 &pwrap {
0916         pmic: mt6397 {
0917                 compatible = "mediatek,mt6397";
0918                 #address-cells = <1>;
0919                 #size-cells = <1>;
0920                 interrupt-parent = <&pio>;
0921                 interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
0922                 interrupt-controller;
0923                 #interrupt-cells = <2>;
0924 
0925                 clock: mt6397clock {
0926                         compatible = "mediatek,mt6397-clk";
0927                         #clock-cells = <1>;
0928                 };
0929 
0930                 pio6397: pinctrl {
0931                         compatible = "mediatek,mt6397-pinctrl";
0932                         pins-are-numbered;
0933                         gpio-controller;
0934                         #gpio-cells = <2>;
0935                 };
0936 
0937                 regulator: mt6397regulator {
0938                         compatible = "mediatek,mt6397-regulator";
0939 
0940                         mt6397_vpca15_reg: buck_vpca15 {
0941                                 regulator-compatible = "buck_vpca15";
0942                                 regulator-name = "vpca15";
0943                                 regulator-min-microvolt = < 700000>;
0944                                 regulator-max-microvolt = <1350000>;
0945                                 regulator-ramp-delay = <12500>;
0946                                 regulator-always-on;
0947                                 regulator-allowed-modes = <0 1>;
0948                         };
0949 
0950                         mt6397_vpca7_reg: buck_vpca7 {
0951                                 regulator-compatible = "buck_vpca7";
0952                                 regulator-name = "vpca7";
0953                                 regulator-min-microvolt = < 700000>;
0954                                 regulator-max-microvolt = <1350000>;
0955                                 regulator-ramp-delay = <12500>;
0956                                 regulator-enable-ramp-delay = <115>;
0957                                 regulator-always-on;
0958                         };
0959 
0960                         mt6397_vsramca15_reg: buck_vsramca15 {
0961                                 regulator-compatible = "buck_vsramca15";
0962                                 regulator-name = "vsramca15";
0963                                 regulator-min-microvolt = < 700000>;
0964                                 regulator-max-microvolt = <1350000>;
0965                                 regulator-ramp-delay = <12500>;
0966                                 regulator-always-on;
0967                         };
0968 
0969                         mt6397_vsramca7_reg: buck_vsramca7 {
0970                                 regulator-compatible = "buck_vsramca7";
0971                                 regulator-name = "vsramca7";
0972                                 regulator-min-microvolt = < 700000>;
0973                                 regulator-max-microvolt = <1350000>;
0974                                 regulator-ramp-delay = <12500>;
0975                                 regulator-always-on;
0976                         };
0977 
0978                         mt6397_vcore_reg: buck_vcore {
0979                                 regulator-compatible = "buck_vcore";
0980                                 regulator-name = "vcore";
0981                                 regulator-min-microvolt = < 700000>;
0982                                 regulator-max-microvolt = <1350000>;
0983                                 regulator-ramp-delay = <12500>;
0984                                 regulator-always-on;
0985                         };
0986 
0987                         mt6397_vgpu_reg: buck_vgpu {
0988                                 regulator-compatible = "buck_vgpu";
0989                                 regulator-name = "vgpu";
0990                                 regulator-min-microvolt = < 700000>;
0991                                 regulator-max-microvolt = <1350000>;
0992                                 regulator-ramp-delay = <12500>;
0993                                 regulator-enable-ramp-delay = <115>;
0994                         };
0995 
0996                         mt6397_vdrm_reg: buck_vdrm {
0997                                 regulator-compatible = "buck_vdrm";
0998                                 regulator-name = "vdrm";
0999                                 regulator-min-microvolt = <1200000>;
1000                                 regulator-max-microvolt = <1400000>;
1001                                 regulator-ramp-delay = <12500>;
1002                                 regulator-always-on;
1003                         };
1004 
1005                         mt6397_vio18_reg: buck_vio18 {
1006                                 regulator-compatible = "buck_vio18";
1007                                 regulator-name = "vio18";
1008                                 regulator-min-microvolt = <1620000>;
1009                                 regulator-max-microvolt = <1980000>;
1010                                 regulator-ramp-delay = <12500>;
1011                                 regulator-always-on;
1012                         };
1013 
1014                         mt6397_vtcxo_reg: ldo_vtcxo {
1015                                 regulator-compatible = "ldo_vtcxo";
1016                                 regulator-name = "vtcxo";
1017                                 regulator-always-on;
1018                         };
1019 
1020                         mt6397_va28_reg: ldo_va28 {
1021                                 regulator-compatible = "ldo_va28";
1022                                 regulator-name = "va28";
1023                         };
1024 
1025                         mt6397_vcama_reg: ldo_vcama {
1026                                 regulator-compatible = "ldo_vcama";
1027                                 regulator-name = "vcama";
1028                                 regulator-min-microvolt = <1800000>;
1029                                 regulator-max-microvolt = <1800000>;
1030                                 regulator-enable-ramp-delay = <218>;
1031                         };
1032 
1033                         mt6397_vio28_reg: ldo_vio28 {
1034                                 regulator-compatible = "ldo_vio28";
1035                                 regulator-name = "vio28";
1036                                 regulator-always-on;
1037                         };
1038 
1039                         mt6397_vusb_reg: ldo_vusb {
1040                                 regulator-compatible = "ldo_vusb";
1041                                 regulator-name = "vusb";
1042                         };
1043 
1044                         mt6397_vmc_reg: ldo_vmc {
1045                                 regulator-compatible = "ldo_vmc";
1046                                 regulator-name = "vmc";
1047                                 regulator-min-microvolt = <1800000>;
1048                                 regulator-max-microvolt = <3300000>;
1049                                 regulator-enable-ramp-delay = <218>;
1050                         };
1051 
1052                         mt6397_vmch_reg: ldo_vmch {
1053                                 regulator-compatible = "ldo_vmch";
1054                                 regulator-name = "vmch";
1055                                 regulator-min-microvolt = <3000000>;
1056                                 regulator-max-microvolt = <3300000>;
1057                                 regulator-enable-ramp-delay = <218>;
1058                         };
1059 
1060                         mt6397_vemc_3v3_reg: ldo_vemc3v3 {
1061                                 regulator-compatible = "ldo_vemc3v3";
1062                                 regulator-name = "vemc_3v3";
1063                                 regulator-min-microvolt = <3000000>;
1064                                 regulator-max-microvolt = <3300000>;
1065                                 regulator-enable-ramp-delay = <218>;
1066                         };
1067 
1068                         mt6397_vgp1_reg: ldo_vgp1 {
1069                                 regulator-compatible = "ldo_vgp1";
1070                                 regulator-name = "vcamd";
1071                                 regulator-min-microvolt = <1800000>;
1072                                 regulator-max-microvolt = <1800000>;
1073                                 regulator-enable-ramp-delay = <240>;
1074                         };
1075 
1076                         mt6397_vgp2_reg: ldo_vgp2 {
1077                                 regulator-compatible = "ldo_vgp2";
1078                                 regulator-name = "vcamio";
1079                                 regulator-min-microvolt = <3300000>;
1080                                 regulator-max-microvolt = <3300000>;
1081                                 regulator-enable-ramp-delay = <218>;
1082                         };
1083 
1084                         mt6397_vgp3_reg: ldo_vgp3 {
1085                                 regulator-compatible = "ldo_vgp3";
1086                                 regulator-name = "vcamaf";
1087                                 regulator-min-microvolt = <1800000>;
1088                                 regulator-max-microvolt = <1800000>;
1089                                 regulator-enable-ramp-delay = <218>;
1090                         };
1091 
1092                         mt6397_vgp4_reg: ldo_vgp4 {
1093                                 regulator-compatible = "ldo_vgp4";
1094                                 regulator-name = "vgp4";
1095                                 regulator-min-microvolt = <1200000>;
1096                                 regulator-max-microvolt = <3300000>;
1097                                 regulator-enable-ramp-delay = <218>;
1098                         };
1099 
1100                         mt6397_vgp5_reg: ldo_vgp5 {
1101                                 regulator-compatible = "ldo_vgp5";
1102                                 regulator-name = "vgp5";
1103                                 regulator-min-microvolt = <1200000>;
1104                                 regulator-max-microvolt = <3000000>;
1105                                 regulator-enable-ramp-delay = <218>;
1106                         };
1107 
1108                         mt6397_vgp6_reg: ldo_vgp6 {
1109                                 regulator-compatible = "ldo_vgp6";
1110                                 regulator-name = "vgp6";
1111                                 regulator-min-microvolt = <3300000>;
1112                                 regulator-max-microvolt = <3300000>;
1113                                 regulator-enable-ramp-delay = <218>;
1114                                 regulator-always-on;
1115                         };
1116 
1117                         mt6397_vibr_reg: ldo_vibr {
1118                                 regulator-compatible = "ldo_vibr";
1119                                 regulator-name = "vibr";
1120                                 regulator-min-microvolt = <1300000>;
1121                                 regulator-max-microvolt = <3300000>;
1122                                 regulator-enable-ramp-delay = <218>;
1123                         };
1124                 };
1125 
1126                 rtc: mt6397rtc {
1127                         compatible = "mediatek,mt6397-rtc";
1128                 };
1129 
1130                 syscfg_pctl_pmic: syscfg_pctl_pmic@c000 {
1131                         compatible = "mediatek,mt6397-pctl-pmic-syscfg",
1132                                      "syscon";
1133                         reg = <0 0x0000c000 0 0x0108>;
1134                 };
1135         };
1136 };
1137 
1138 &spi {
1139         pinctrl-names = "default";
1140         pinctrl-0 = <&spi_pins_a>;
1141         mediatek,pad-select = <1>;
1142         status = "okay";
1143         /* clients */
1144         cros_ec: ec@0 {
1145                 compatible = "google,cros-ec-spi";
1146                 reg = <0x0>;
1147                 spi-max-frequency = <12000000>;
1148                 interrupt-parent = <&pio>;
1149                 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
1150                 google,cros-ec-spi-msg-delay = <500>;
1151 
1152                 i2c_tunnel: i2c-tunnel0 {
1153                         compatible = "google,cros-ec-i2c-tunnel";
1154                         google,remote-bus = <0>;
1155                         #address-cells = <1>;
1156                         #size-cells = <0>;
1157 
1158                         battery: sbs-battery@b {
1159                                 compatible = "sbs,sbs-battery";
1160                                 reg = <0xb>;
1161                                 sbs,i2c-retry-count = <2>;
1162                                 sbs,poll-retry-count = <1>;
1163                         };
1164                 };
1165         };
1166 };
1167 
1168 &ssusb {
1169         dr_mode = "host";
1170         wakeup-source;
1171         vusb33-supply = <&mt6397_vusb_reg>;
1172         status = "okay";
1173 };
1174 
1175 &thermal {
1176         bank0-supply = <&mt6397_vpca15_reg>;
1177         bank1-supply = <&da9211_vcpu_reg>;
1178 };
1179 
1180 &uart0 {
1181         status = "okay";
1182 };
1183 
1184 &usb_host {
1185         pinctrl-names = "default";
1186         pinctrl-0 = <&usb_pins>;
1187         vusb33-supply = <&mt6397_vusb_reg>;
1188         status = "okay";
1189 };
1190 
1191 #include <arm/cros-ec-keyboard.dtsi>