1// SPDX-License-Identifier: BSD-3-Clause 2/* 3 * Lenovo Yoga C630 4 * 5 * Copyright (c) 2019, Linaro Ltd. 6 */ 7 8/dts-v1/; 9 10#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/input/gpio-keys.h> 12#include <dt-bindings/input/input.h> 13#include <dt-bindings/regulator/qcom,rpmh-regulator.h> 14#include <dt-bindings/sound/qcom,q6afe.h> 15#include <dt-bindings/sound/qcom,q6asm.h> 16#include "sdm850.dtsi" 17#include "pm8998.dtsi" 18 19/ { 20 model = "Lenovo Yoga C630"; 21 compatible = "lenovo,yoga-c630", "qcom,sdm845"; 22 23 aliases { 24 hsuart0 = &uart6; 25 }; 26 27 gpio-keys { 28 compatible = "gpio-keys"; 29 30 pinctrl-names = "default"; 31 pinctrl-0 = <&lid_pin_active>, <&mode_pin_active>; 32 33 lid { 34 gpios = <&tlmm 124 GPIO_ACTIVE_HIGH>; 35 linux,input-type = <EV_SW>; 36 linux,code = <SW_LID>; 37 wakeup-source; 38 wakeup-event-action = <EV_ACT_DEASSERTED>; 39 }; 40 41 mode { 42 gpios = <&tlmm 95 GPIO_ACTIVE_HIGH>; 43 linux,input-type = <EV_SW>; 44 linux,code = <SW_TABLET_MODE>; 45 }; 46 }; 47 48 panel { 49 compatible = "boe,nv133fhm-n61"; 50 no-hpd; 51 52 ports { 53 port { 54 panel_in_edp: endpoint { 55 remote-endpoint = <&sn65dsi86_out>; 56 }; 57 }; 58 }; 59 }; 60 61 sn65dsi86_refclk: sn65dsi86-refclk { 62 compatible = "fixed-clock"; 63 #clock-cells = <0>; 64 65 clock-frequency = <19200000>; 66 }; 67}; 68 69&adsp_pas { 70 firmware-name = "qcom/LENOVO/81JL/qcadsp850.mbn"; 71 status = "okay"; 72}; 73 74&apps_rsc { 75 pm8998-rpmh-regulators { 76 compatible = "qcom,pm8998-rpmh-regulators"; 77 qcom,pmic-id = "a"; 78 79 vdd-l2-l8-l17-supply = <&vreg_s3a_1p35>; 80 vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p04>; 81 82 vreg_s2a_1p125: smps2 { 83 }; 84 85 vreg_s3a_1p35: smps3 { 86 regulator-min-microvolt = <1352000>; 87 regulator-max-microvolt = <1352000>; 88 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 89 }; 90 91 vreg_s4a_1p8: smps4 { 92 regulator-min-microvolt = <1800000>; 93 regulator-max-microvolt = <1800000>; 94 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 95 }; 96 97 vreg_s5a_2p04: smps5 { 98 regulator-min-microvolt = <2040000>; 99 regulator-max-microvolt = <2040000>; 100 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 101 }; 102 103 vreg_s7a_1p025: smps7 { 104 }; 105 106 vdd_qusb_hs0: 107 vdda_hp_pcie_core: 108 vdda_mipi_csi0_0p9: 109 vdda_mipi_csi1_0p9: 110 vdda_mipi_csi2_0p9: 111 vdda_mipi_dsi0_pll: 112 vdda_mipi_dsi1_pll: 113 vdda_qlink_lv: 114 vdda_qlink_lv_ck: 115 vdda_qrefs_0p875: 116 vdda_pcie_core: 117 vdda_pll_cc_ebi01: 118 vdda_pll_cc_ebi23: 119 vdda_sp_sensor: 120 vdda_ufs1_core: 121 vdda_ufs2_core: 122 vdda_usb1_ss_core: 123 vdda_usb2_ss_core: 124 vreg_l1a_0p875: ldo1 { 125 regulator-min-microvolt = <880000>; 126 regulator-max-microvolt = <880000>; 127 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 128 }; 129 130 vddpx_10: 131 vreg_l2a_1p2: ldo2 { 132 regulator-min-microvolt = <1200000>; 133 regulator-max-microvolt = <1200000>; 134 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 135 regulator-always-on; 136 }; 137 138 vreg_l3a_1p0: ldo3 { 139 }; 140 141 vdd_wcss_cx: 142 vdd_wcss_mx: 143 vdda_wcss_pll: 144 vreg_l5a_0p8: ldo5 { 145 regulator-min-microvolt = <800000>; 146 regulator-max-microvolt = <800000>; 147 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 148 }; 149 150 vddpx_13: 151 vreg_l6a_1p8: ldo6 { 152 regulator-min-microvolt = <1800000>; 153 regulator-max-microvolt = <1800000>; 154 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 155 }; 156 157 vreg_l7a_1p8: ldo7 { 158 regulator-min-microvolt = <1800000>; 159 regulator-max-microvolt = <1800000>; 160 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 161 }; 162 163 vreg_l8a_1p2: ldo8 { 164 }; 165 166 vreg_l9a_1p8: ldo9 { 167 }; 168 169 vreg_l10a_1p8: ldo10 { 170 }; 171 172 vreg_l11a_1p0: ldo11 { 173 }; 174 175 vdd_qfprom: 176 vdd_qfprom_sp: 177 vdda_apc1_cs_1p8: 178 vdda_gfx_cs_1p8: 179 vdda_qrefs_1p8: 180 vdda_qusb_hs0_1p8: 181 vddpx_11: 182 vreg_l12a_1p8: ldo12 { 183 regulator-min-microvolt = <1800000>; 184 regulator-max-microvolt = <1800000>; 185 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 186 }; 187 188 vddpx_2: 189 vreg_l13a_2p95: ldo13 { 190 }; 191 192 vreg_l14a_1p88: ldo14 { 193 regulator-min-microvolt = <1880000>; 194 regulator-max-microvolt = <1880000>; 195 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 196 regulator-always-on; 197 }; 198 199 vreg_l15a_1p8: ldo15 { 200 }; 201 202 vreg_l16a_2p7: ldo16 { 203 }; 204 205 vreg_l17a_1p3: ldo17 { 206 regulator-min-microvolt = <1304000>; 207 regulator-max-microvolt = <1304000>; 208 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 209 }; 210 211 vreg_l18a_2p7: ldo18 { 212 }; 213 214 vreg_l19a_3p0: ldo19 { 215 regulator-min-microvolt = <3100000>; 216 regulator-max-microvolt = <3108000>; 217 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 218 }; 219 220 vreg_l20a_2p95: ldo20 { 221 regulator-min-microvolt = <2960000>; 222 regulator-max-microvolt = <2960000>; 223 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 224 }; 225 226 vreg_l21a_2p95: ldo21 { 227 }; 228 229 vreg_l22a_2p85: ldo22 { 230 }; 231 232 vreg_l23a_3p3: ldo23 { 233 }; 234 235 vdda_qusb_hs0_3p1: 236 vreg_l24a_3p075: ldo24 { 237 regulator-min-microvolt = <3075000>; 238 regulator-max-microvolt = <3083000>; 239 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 240 }; 241 242 vreg_l25a_3p3: ldo25 { 243 regulator-min-microvolt = <3104000>; 244 regulator-max-microvolt = <3112000>; 245 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 246 }; 247 248 vdda_hp_pcie_1p2: 249 vdda_hv_ebi0: 250 vdda_hv_ebi1: 251 vdda_hv_ebi2: 252 vdda_hv_ebi3: 253 vdda_mipi_csi_1p25: 254 vdda_mipi_dsi0_1p2: 255 vdda_mipi_dsi1_1p2: 256 vdda_pcie_1p2: 257 vdda_ufs1_1p2: 258 vdda_ufs2_1p2: 259 vdda_usb1_ss_1p2: 260 vdda_usb2_ss_1p2: 261 vreg_l26a_1p2: ldo26 { 262 regulator-min-microvolt = <1200000>; 263 regulator-max-microvolt = <1208000>; 264 regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>; 265 }; 266 267 vreg_l28a_3p0: ldo28 { 268 }; 269 270 vreg_lvs1a_1p8: lvs1 { 271 }; 272 273 vreg_lvs2a_1p8: lvs2 { 274 }; 275 }; 276}; 277 278&cdsp_pas { 279 firmware-name = "qcom/LENOVO/81JL/qccdsp850.mbn"; 280 status = "okay"; 281}; 282 283&dsi0 { 284 status = "okay"; 285 vdda-supply = <&vreg_l26a_1p2>; 286 287 ports { 288 port@1 { 289 endpoint { 290 remote-endpoint = <&sn65dsi86_in_a>; 291 data-lanes = <0 1 2 3>; 292 }; 293 }; 294 }; 295}; 296 297&dsi0_phy { 298 status = "okay"; 299 vdds-supply = <&vreg_l1a_0p875>; 300}; 301 302&gcc { 303 protected-clocks = <GCC_QSPI_CORE_CLK>, 304 <GCC_QSPI_CORE_CLK_SRC>, 305 <GCC_QSPI_CNOC_PERIPH_AHB_CLK>, 306 <GCC_LPASS_Q6_AXI_CLK>, 307 <GCC_LPASS_SWAY_CLK>; 308}; 309 310&gpu { 311 zap-shader { 312 memory-region = <&gpu_mem>; 313 firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn"; 314 }; 315}; 316 317&i2c1 { 318 status = "okay"; 319 clock-frequency = <400000>; 320}; 321 322&i2c3 { 323 status = "okay"; 324 clock-frequency = <400000>; 325 /* Overwrite pinctrl-0 from sdm845.dtsi */ 326 pinctrl-0 = <&qup_i2c3_default &i2c3_hid_active>; 327 328 tsel: hid@15 { 329 compatible = "hid-over-i2c"; 330 reg = <0x15>; 331 hid-descr-addr = <0x1>; 332 333 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; 334 }; 335 336 tsc2: hid@2c { 337 compatible = "hid-over-i2c"; 338 reg = <0x2c>; 339 hid-descr-addr = <0x20>; 340 341 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; 342 }; 343}; 344 345&i2c5 { 346 status = "okay"; 347 clock-frequency = <400000>; 348 349 tsc1: hid@10 { 350 compatible = "hid-over-i2c"; 351 reg = <0x10>; 352 hid-descr-addr = <0x1>; 353 354 interrupts-extended = <&tlmm 125 IRQ_TYPE_LEVEL_LOW>; 355 356 pinctrl-names = "default"; 357 pinctrl-0 = <&i2c5_hid_active>; 358 }; 359}; 360 361&i2c10 { 362 status = "okay"; 363 clock-frequency = <400000>; 364 365 sn65dsi86: bridge@2c { 366 compatible = "ti,sn65dsi86"; 367 reg = <0x2c>; 368 pinctrl-names = "default"; 369 pinctrl-0 = <&sn65dsi86_pin_active>; 370 371 enable-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>; 372 373 vpll-supply = <&vreg_l14a_1p88>; 374 vccio-supply = <&vreg_l14a_1p88>; 375 376 clocks = <&sn65dsi86_refclk>; 377 clock-names = "refclk"; 378 379 no-hpd; 380 381 ports { 382 #address-cells = <1>; 383 #size-cells = <0>; 384 385 port@0 { 386 reg = <0>; 387 sn65dsi86_in_a: endpoint { 388 remote-endpoint = <&dsi0_out>; 389 }; 390 }; 391 392 port@1 { 393 reg = <1>; 394 sn65dsi86_out: endpoint { 395 remote-endpoint = <&panel_in_edp>; 396 }; 397 }; 398 }; 399 }; 400}; 401 402&i2c11 { 403 status = "okay"; 404 clock-frequency = <400000>; 405 406 ecsh: hid@5c { 407 compatible = "hid-over-i2c"; 408 reg = <0x5c>; 409 hid-descr-addr = <0x1>; 410 411 interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>; 412 413 pinctrl-names = "default"; 414 pinctrl-0 = <&i2c11_hid_active>; 415 }; 416}; 417 418&mdss { 419 status = "okay"; 420}; 421 422&mdss_mdp { 423 status = "okay"; 424}; 425 426&mss_pil { 427 firmware-name = "qcom/LENOVO/81JL/qcdsp1v2850.mbn", "qcom/LENOVO/81JL/qcdsp2850.mbn"; 428}; 429 430&qup_i2c10_default { 431 pinconf { 432 pins = "gpio55", "gpio56"; 433 drive-strength = <2>; 434 bias-disable; 435 }; 436}; 437 438&qup_i2c12_default { 439 drive-strength = <2>; 440 bias-disable; 441}; 442 443&qup_uart6_default { 444 pinmux { 445 pins = "gpio45", "gpio46", "gpio47", "gpio48"; 446 function = "qup6"; 447 }; 448 449 cts { 450 pins = "gpio45"; 451 bias-pull-down; 452 }; 453 454 rts-tx { 455 pins = "gpio46", "gpio47"; 456 drive-strength = <2>; 457 bias-disable; 458 }; 459 460 rx { 461 pins = "gpio48"; 462 bias-pull-up; 463 }; 464}; 465 466&qupv3_id_0 { 467 status = "okay"; 468}; 469 470&qupv3_id_1 { 471 status = "okay"; 472}; 473 474&q6asmdai { 475 dai@0 { 476 reg = <0>; 477 }; 478 479 dai@1 { 480 reg = <1>; 481 }; 482}; 483 484&sound { 485 compatible = "qcom,db845c-sndcard"; 486 model = "Lenovo-YOGA-C630-13Q50"; 487 488 audio-routing = 489 "RX_BIAS", "MCLK", 490 "AMIC2", "MIC BIAS2", 491 "SpkrLeft IN", "SPK1 OUT", 492 "SpkrRight IN", "SPK2 OUT", 493 "MM_DL1", "MultiMedia1 Playback", 494 "MultiMedia2 Capture", "MM_UL2"; 495 496 mm1-dai-link { 497 link-name = "MultiMedia1"; 498 cpu { 499 sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; 500 }; 501 }; 502 503 mm2-dai-link { 504 link-name = "MultiMedia2"; 505 cpu { 506 sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; 507 }; 508 }; 509 510 slim-dai-link { 511 link-name = "SLIM Playback"; 512 cpu { 513 sound-dai = <&q6afedai SLIMBUS_0_RX>; 514 }; 515 516 platform { 517 sound-dai = <&q6routing>; 518 }; 519 520 codec { 521 sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>; 522 }; 523 }; 524 525 slimcap-dai-link { 526 link-name = "SLIM Capture"; 527 cpu { 528 sound-dai = <&q6afedai SLIMBUS_0_TX>; 529 }; 530 531 platform { 532 sound-dai = <&q6routing>; 533 }; 534 535 codec { 536 sound-dai = <&wcd9340 1>; 537 }; 538 }; 539}; 540 541&tlmm { 542 gpio-reserved-ranges = <0 4>, <81 4>; 543 544 sn65dsi86_pin_active: sn65dsi86-enable { 545 pins = "gpio96"; 546 drive-strength = <2>; 547 bias-disable; 548 }; 549 550 i2c3_hid_active: i2c2-hid-active { 551 pins = "gpio37"; 552 function = "gpio"; 553 554 input-enable; 555 bias-pull-up; 556 drive-strength = <2>; 557 }; 558 559 i2c5_hid_active: i2c5-hid-active { 560 pins = "gpio125"; 561 function = "gpio"; 562 563 input-enable; 564 bias-pull-up; 565 drive-strength = <2>; 566 }; 567 568 i2c11_hid_active: i2c11-hid-active { 569 pins = "gpio92"; 570 function = "gpio"; 571 572 input-enable; 573 bias-pull-up; 574 drive-strength = <2>; 575 }; 576 577 wcd_intr_default: wcd_intr_default { 578 pins = "gpio54"; 579 function = "gpio"; 580 581 input-enable; 582 bias-pull-down; 583 drive-strength = <2>; 584 }; 585 586 lid_pin_active: lid-pin { 587 pins = "gpio124"; 588 function = "gpio"; 589 590 input-enable; 591 bias-disable; 592 }; 593 594 mode_pin_active: mode-pin { 595 pins = "gpio95"; 596 function = "gpio"; 597 598 input-enable; 599 bias-disable; 600 }; 601}; 602 603&uart6 { 604 status = "okay"; 605 606 bluetooth { 607 compatible = "qcom,wcn3990-bt"; 608 609 vddio-supply = <&vreg_s4a_1p8>; 610 vddxo-supply = <&vreg_l7a_1p8>; 611 vddrf-supply = <&vreg_l17a_1p3>; 612 vddch0-supply = <&vreg_l25a_3p3>; 613 max-speed = <3200000>; 614 }; 615}; 616 617&ufs_mem_hc { 618 status = "okay"; 619 620 reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>; 621 622 vcc-supply = <&vreg_l20a_2p95>; 623 vcc-max-microamp = <600000>; 624}; 625 626&ufs_mem_phy { 627 status = "okay"; 628 629 vdda-phy-supply = <&vdda_ufs1_core>; 630 vdda-pll-supply = <&vdda_ufs1_1p2>; 631}; 632 633&usb_1 { 634 status = "okay"; 635}; 636 637&usb_1_dwc3 { 638 dr_mode = "host"; 639}; 640 641&usb_1_hsphy { 642 status = "okay"; 643 644 vdd-supply = <&vdda_usb1_ss_core>; 645 vdda-pll-supply = <&vdda_qusb_hs0_1p8>; 646 vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; 647 648 qcom,imp-res-offset-value = <8>; 649 qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>; 650 qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>; 651 qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>; 652}; 653 654&usb_1_qmpphy { 655 status = "okay"; 656 657 vdda-phy-supply = <&vdda_usb1_ss_1p2>; 658 vdda-pll-supply = <&vdda_usb1_ss_core>; 659}; 660 661&usb_2 { 662 status = "okay"; 663}; 664 665&usb_2_dwc3 { 666 dr_mode = "host"; 667}; 668 669&usb_2_hsphy { 670 status = "okay"; 671 672 vdd-supply = <&vdda_usb2_ss_core>; 673 vdda-pll-supply = <&vdda_qusb_hs0_1p8>; 674 vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; 675 676 qcom,imp-res-offset-value = <8>; 677 qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>; 678}; 679 680&usb_2_qmpphy { 681 status = "okay"; 682 683 vdda-phy-supply = <&vdda_usb2_ss_1p2>; 684 vdda-pll-supply = <&vdda_usb2_ss_core>; 685}; 686 687&wcd9340{ 688 pinctrl-0 = <&wcd_intr_default>; 689 pinctrl-names = "default"; 690 clock-names = "extclk"; 691 clocks = <&rpmhcc RPMH_LN_BB_CLK2>; 692 reset-gpios = <&tlmm 64 0>; 693 vdd-buck-supply = <&vreg_s4a_1p8>; 694 vdd-buck-sido-supply = <&vreg_s4a_1p8>; 695 vdd-tx-supply = <&vreg_s4a_1p8>; 696 vdd-rx-supply = <&vreg_s4a_1p8>; 697 vdd-io-supply = <&vreg_s4a_1p8>; 698 699 swm: swm@c85 { 700 left_spkr: wsa8810-left{ 701 compatible = "sdw10217211000"; 702 reg = <0 3>; 703 powerdown-gpios = <&wcdgpio 1 GPIO_ACTIVE_HIGH>; 704 #thermal-sensor-cells = <0>; 705 sound-name-prefix = "SpkrLeft"; 706 #sound-dai-cells = <0>; 707 }; 708 709 right_spkr: wsa8810-right{ 710 compatible = "sdw10217211000"; 711 powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>; 712 reg = <0 4>; 713 #thermal-sensor-cells = <0>; 714 sound-name-prefix = "SpkrRight"; 715 #sound-dai-cells = <0>; 716 }; 717 }; 718}; 719 720&wifi { 721 status = "okay"; 722 723 vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>; 724 vdd-1.8-xo-supply = <&vreg_l7a_1p8>; 725 vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; 726 vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; 727 728 qcom,snoc-host-cap-8bit-quirk; 729}; 730