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 "sdm845.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}; 307 308&gpu { 309 zap-shader { 310 memory-region = <&gpu_mem>; 311 firmware-name = "qcom/LENOVO/81JL/qcdxkmsuc850.mbn"; 312 }; 313}; 314 315&i2c1 { 316 status = "okay"; 317 clock-frequency = <400000>; 318}; 319 320&i2c3 { 321 status = "okay"; 322 clock-frequency = <400000>; 323 324 tsel: hid@15 { 325 compatible = "hid-over-i2c"; 326 reg = <0x15>; 327 hid-descr-addr = <0x1>; 328 329 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; 330 331 pinctrl-names = "default"; 332 pinctrl-0 = <&i2c3_hid_active>; 333 }; 334 335 tsc2: hid@2c { 336 compatible = "hid-over-i2c"; 337 reg = <0x2c>; 338 hid-descr-addr = <0x20>; 339 340 interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>; 341 342 pinctrl-names = "default"; 343 pinctrl-0 = <&i2c3_hid_active>; 344 345 status = "disabled"; 346 }; 347}; 348 349&i2c5 { 350 status = "okay"; 351 clock-frequency = <400000>; 352 353 tsc1: hid@10 { 354 compatible = "hid-over-i2c"; 355 reg = <0x10>; 356 hid-descr-addr = <0x1>; 357 358 interrupts-extended = <&tlmm 125 IRQ_TYPE_LEVEL_LOW>; 359 360 pinctrl-names = "default"; 361 pinctrl-0 = <&i2c5_hid_active>; 362 }; 363}; 364 365&i2c10 { 366 status = "okay"; 367 clock-frequency = <400000>; 368 369 sn65dsi86: bridge@2c { 370 compatible = "ti,sn65dsi86"; 371 reg = <0x2c>; 372 pinctrl-names = "default"; 373 pinctrl-0 = <&sn65dsi86_pin_active>; 374 375 enable-gpios = <&tlmm 96 GPIO_ACTIVE_HIGH>; 376 377 vpll-supply = <&vreg_l14a_1p88>; 378 vccio-supply = <&vreg_l14a_1p88>; 379 380 clocks = <&sn65dsi86_refclk>; 381 clock-names = "refclk"; 382 383 ports { 384 #address-cells = <1>; 385 #size-cells = <0>; 386 387 port@0 { 388 reg = <0>; 389 sn65dsi86_in_a: endpoint { 390 remote-endpoint = <&dsi0_out>; 391 }; 392 }; 393 394 port@1 { 395 reg = <1>; 396 sn65dsi86_out: endpoint { 397 remote-endpoint = <&panel_in_edp>; 398 }; 399 }; 400 }; 401 }; 402}; 403 404&i2c11 { 405 status = "okay"; 406 clock-frequency = <400000>; 407 408 ecsh: hid@5c { 409 compatible = "hid-over-i2c"; 410 reg = <0x5c>; 411 hid-descr-addr = <0x1>; 412 413 interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>; 414 415 pinctrl-names = "default"; 416 pinctrl-0 = <&i2c11_hid_active>; 417 }; 418}; 419 420&mdss { 421 status = "okay"; 422}; 423 424&mdss_mdp { 425 status = "okay"; 426}; 427 428&mss_pil { 429 firmware-name = "qcom/LENOVO/81JL/qcdsp1v2850.mbn", "qcom/LENOVO/81JL/qcdsp2850.mbn"; 430}; 431 432&qup_i2c10_default { 433 pinconf { 434 pins = "gpio55", "gpio56"; 435 drive-strength = <2>; 436 bias-disable; 437 }; 438}; 439 440&qup_i2c12_default { 441 drive-strength = <2>; 442 bias-disable; 443}; 444 445&qup_uart6_default { 446 pinmux { 447 pins = "gpio45", "gpio46", "gpio47", "gpio48"; 448 function = "qup6"; 449 }; 450 451 cts { 452 pins = "gpio45"; 453 bias-pull-down; 454 }; 455 456 rts-tx { 457 pins = "gpio46", "gpio47"; 458 drive-strength = <2>; 459 bias-disable; 460 }; 461 462 rx { 463 pins = "gpio48"; 464 bias-pull-up; 465 }; 466}; 467 468&qupv3_id_0 { 469 status = "okay"; 470}; 471 472&qupv3_id_1 { 473 status = "okay"; 474}; 475 476&q6asmdai { 477 dai@0 { 478 reg = <0>; 479 }; 480 481 dai@1 { 482 reg = <1>; 483 }; 484}; 485 486&sound { 487 compatible = "qcom,db845c-sndcard"; 488 model = "Lenovo-YOGA-C630-13Q50"; 489 490 audio-routing = 491 "RX_BIAS", "MCLK", 492 "AMIC2", "MIC BIAS2", 493 "SpkrLeft IN", "SPK1 OUT", 494 "SpkrRight IN", "SPK2 OUT", 495 "MM_DL1", "MultiMedia1 Playback", 496 "MultiMedia2 Capture", "MM_UL2"; 497 498 mm1-dai-link { 499 link-name = "MultiMedia1"; 500 cpu { 501 sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>; 502 }; 503 }; 504 505 mm2-dai-link { 506 link-name = "MultiMedia2"; 507 cpu { 508 sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>; 509 }; 510 }; 511 512 slim-dai-link { 513 link-name = "SLIM Playback"; 514 cpu { 515 sound-dai = <&q6afedai SLIMBUS_0_RX>; 516 }; 517 518 platform { 519 sound-dai = <&q6routing>; 520 }; 521 522 codec { 523 sound-dai = <&left_spkr>, <&right_spkr>, <&swm 0>, <&wcd9340 0>; 524 }; 525 }; 526 527 slimcap-dai-link { 528 link-name = "SLIM Capture"; 529 cpu { 530 sound-dai = <&q6afedai SLIMBUS_0_TX>; 531 }; 532 533 platform { 534 sound-dai = <&q6routing>; 535 }; 536 537 codec { 538 sound-dai = <&wcd9340 1>; 539 }; 540 }; 541}; 542 543&tlmm { 544 gpio-reserved-ranges = <0 4>, <81 4>; 545 546 sn65dsi86_pin_active: sn65dsi86-enable { 547 pins = "gpio96"; 548 drive-strength = <2>; 549 bias-disable; 550 }; 551 552 i2c3_hid_active: i2c2-hid-active { 553 pins = "gpio37"; 554 function = "gpio"; 555 556 input-enable; 557 bias-pull-up; 558 drive-strength = <2>; 559 }; 560 561 i2c5_hid_active: i2c5-hid-active { 562 pins = "gpio125"; 563 function = "gpio"; 564 565 input-enable; 566 bias-pull-up; 567 drive-strength = <2>; 568 }; 569 570 i2c11_hid_active: i2c11-hid-active { 571 pins = "gpio92"; 572 function = "gpio"; 573 574 input-enable; 575 bias-pull-up; 576 drive-strength = <2>; 577 }; 578 579 wcd_intr_default: wcd_intr_default { 580 pins = "gpio54"; 581 function = "gpio"; 582 583 input-enable; 584 bias-pull-down; 585 drive-strength = <2>; 586 }; 587 588 lid_pin_active: lid-pin { 589 pins = "gpio124"; 590 function = "gpio"; 591 592 input-enable; 593 bias-disable; 594 }; 595 596 mode_pin_active: mode-pin { 597 pins = "gpio95"; 598 function = "gpio"; 599 600 input-enable; 601 bias-disable; 602 }; 603}; 604 605&uart6 { 606 status = "okay"; 607 608 bluetooth { 609 compatible = "qcom,wcn3990-bt"; 610 611 vddio-supply = <&vreg_s4a_1p8>; 612 vddxo-supply = <&vreg_l7a_1p8>; 613 vddrf-supply = <&vreg_l17a_1p3>; 614 vddch0-supply = <&vreg_l25a_3p3>; 615 max-speed = <3200000>; 616 }; 617}; 618 619&ufs_mem_hc { 620 status = "okay"; 621 622 reset-gpios = <&tlmm 150 GPIO_ACTIVE_LOW>; 623 624 vcc-supply = <&vreg_l20a_2p95>; 625 vcc-max-microamp = <600000>; 626}; 627 628&ufs_mem_phy { 629 status = "okay"; 630 631 vdda-phy-supply = <&vdda_ufs1_core>; 632 vdda-pll-supply = <&vdda_ufs1_1p2>; 633}; 634 635&usb_1 { 636 status = "okay"; 637}; 638 639&usb_1_dwc3 { 640 dr_mode = "host"; 641}; 642 643&usb_1_hsphy { 644 status = "okay"; 645 646 vdd-supply = <&vdda_usb1_ss_core>; 647 vdda-pll-supply = <&vdda_qusb_hs0_1p8>; 648 vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; 649 650 qcom,imp-res-offset-value = <8>; 651 qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_21_6_MA>; 652 qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_5_PERCENT>; 653 qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>; 654}; 655 656&usb_1_qmpphy { 657 status = "okay"; 658 659 vdda-phy-supply = <&vdda_usb1_ss_1p2>; 660 vdda-pll-supply = <&vdda_usb1_ss_core>; 661}; 662 663&usb_2 { 664 status = "okay"; 665}; 666 667&usb_2_dwc3 { 668 dr_mode = "host"; 669}; 670 671&usb_2_hsphy { 672 status = "okay"; 673 674 vdd-supply = <&vdda_usb2_ss_core>; 675 vdda-pll-supply = <&vdda_qusb_hs0_1p8>; 676 vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>; 677 678 qcom,imp-res-offset-value = <8>; 679 qcom,hstx-trim-value = <QUSB2_V2_HSTX_TRIM_22_8_MA>; 680}; 681 682&usb_2_qmpphy { 683 status = "okay"; 684 685 vdda-phy-supply = <&vdda_usb2_ss_1p2>; 686 vdda-pll-supply = <&vdda_usb2_ss_core>; 687}; 688 689&wcd9340{ 690 pinctrl-0 = <&wcd_intr_default>; 691 pinctrl-names = "default"; 692 clock-names = "extclk"; 693 clocks = <&rpmhcc RPMH_LN_BB_CLK2>; 694 reset-gpios = <&tlmm 64 0>; 695 vdd-buck-supply = <&vreg_s4a_1p8>; 696 vdd-buck-sido-supply = <&vreg_s4a_1p8>; 697 vdd-tx-supply = <&vreg_s4a_1p8>; 698 vdd-rx-supply = <&vreg_s4a_1p8>; 699 vdd-io-supply = <&vreg_s4a_1p8>; 700 701 swm: swm@c85 { 702 left_spkr: wsa8810-left{ 703 compatible = "sdw10217211000"; 704 reg = <0 3>; 705 powerdown-gpios = <&wcdgpio 2 GPIO_ACTIVE_HIGH>; 706 #thermal-sensor-cells = <0>; 707 sound-name-prefix = "SpkrLeft"; 708 #sound-dai-cells = <0>; 709 }; 710 711 right_spkr: wsa8810-right{ 712 compatible = "sdw10217211000"; 713 powerdown-gpios = <&wcdgpio 3 GPIO_ACTIVE_HIGH>; 714 reg = <0 4>; 715 #thermal-sensor-cells = <0>; 716 sound-name-prefix = "SpkrRight"; 717 #sound-dai-cells = <0>; 718 }; 719 }; 720}; 721 722&wifi { 723 status = "okay"; 724 725 vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>; 726 vdd-1.8-xo-supply = <&vreg_l7a_1p8>; 727 vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; 728 vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; 729 730 qcom,snoc-host-cap-8bit-quirk; 731}; 732