sc7180-trogdor.dtsi 28.4 KB
Newer Older
1 2 3 4 5 6 7 8
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Google Trogdor device tree source (common between revisions)
 *
 * Copyright 2019 Google LLC.
 */

#include <dt-bindings/gpio/gpio.h>
9
#include <dt-bindings/input/gpio-keys.h>
10
#include <dt-bindings/input/input.h>
11
#include <dt-bindings/leds/common.h>
12
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
13
#include <dt-bindings/sound/sc7180-lpass.h>
14

15 16
#include "sc7180.dtsi"
/* PMICs depend on spmi_bus label and so must come after sc7180.dtsi */
17 18 19
#include "pm6150.dtsi"
#include "pm6150l.dtsi"

20 21
/ {
	thermal-zones {
22
		charger_thermal: charger-thermal {
23 24 25
			polling-delay-passive = <0>;
			polling-delay = <0>;

26
			thermal-sensors = <&pm6150_adc_tm 0>;
27 28

			trips {
29 30 31 32 33
				charger-crit {
					temperature = <125000>;
					hysteresis = <1000>;
					type = "critical";
				};
34 35 36 37 38
			};
		};
	};
};

39 40 41 42 43 44 45 46
/*
 * Reserved memory changes
 *
 * Delete all unused memory nodes and define the peripheral memory regions
 * required by the board dts.
 */

/delete-node/ &hyp_mem;
47
/delete-node/ &ipa_fw_mem;
48 49 50 51 52 53 54
/delete-node/ &xbl_mem;
/delete-node/ &aop_mem;
/delete-node/ &sec_apps_mem;
/delete-node/ &tz_mem;

/* Increase the size from 2MB to 8MB */
&rmtfs_mem {
55
	reg = <0x0 0x94600000 0x0 0x800000>;
56 57 58 59 60 61 62 63 64 65
};

/ {
	reserved-memory {
		atf_mem: memory@80b00000 {
			reg = <0x0 0x80b00000 0x0 0x100000>;
			no-map;
		};

		mpss_mem: memory@86000000 {
66
			reg = <0x0 0x86000000 0x0 0x2000000>;
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
			no-map;
		};

		venus_mem: memory@8f600000 {
			reg = <0 0x8f600000 0 0x500000>;
			no-map;
		};

		wlan_mem: memory@94100000 {
			reg = <0x0 0x94100000 0x0 0x200000>;
			no-map;
		};

		mba_mem: memory@94400000 {
			reg = <0x0 0x94400000 0x0 0x200000>;
			no-map;
		};
	};

	aliases {
		bluetooth0 = &bluetooth;
		hsuart0 = &uart3;
		serial0 = &uart8;
		wifi0 = &wifi;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	/* FIXED REGULATORS - parents above children */

	/* This is the top level supply and variable voltage */
	ppvar_sys: ppvar-sys-regulator {
		compatible = "regulator-fixed";
		regulator-name = "ppvar_sys";
		regulator-always-on;
		regulator-boot-on;
	};

	/* This divides ppvar_sys by 2, so voltage is variable */
	src_vph_pwr: src-vph-pwr-regulator {
		compatible = "regulator-fixed";
		regulator-name = "src_vph_pwr";

		/* EC turns on with switchcap_on; always on for AP */
		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&ppvar_sys>;
	};

	pp5000_a: pp5000-a-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp5000_a";

		/* EC turns on with en_pp5000_a; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;

		vin-supply = <&ppvar_sys>;
	};

	pp3300_a: pp3300-a-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp3300_a";

		/* EC turns on with en_pp3300_a; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		/*
		 * Actually should be pp3300 but that's practically an alias for
		 * pp3300_a so we use pp3300's vin-supply here to avoid one more
		 * node.
		 */
		vin-supply = <&ppvar_sys>;
	};

150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
	pp1800_ec:
	pp1800_sensors:
	pp1800_ldo: pp1800-ldo-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp1800_ldo";

		/* EC turns on with hibernate_l; always on for AP */
		regulator-always-on;
		regulator-boot-on;
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;

		/*
		 * Actually should be pp1800_h1 but we don't have any need to
		 * model that so we use the parent of pp1800_h1.
		 */
		vin-supply = <&pp3300_a>;
	};

	pp1800_uf_cam: pp1800-uf-cam-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp1800_uf_cam";
		status = "disabled";

		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;

		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&uf_cam_en>;

		vin-supply = <&pp1800_ldo>;
		regulator-enable-ramp-delay = <1000>;
	};

	pp1800_wf_cam: pp1800-wf-cam-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp1800_wf_cam";
		status = "disabled";

		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;

		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&wf_cam_en>;

		vin-supply = <&pp1800_ldo>;
		regulator-enable-ramp-delay = <1000>;
	};

	pp2800_uf_cam: pp2800-uf-cam-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp2800_uf_cam";
		status = "disabled";

		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2850000>;

		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		/*
		 * The pinconf can only be referenced once so we put it on the
		 * first regulator and comment it out here.
		 * pinctrl-names = "default";
		 * pinctrl-0 = <&uf_cam_en>;
		 */

		vin-supply = <&pp3300_a>;
	};

	pp2800_vcm_wf_cam:
	pp2800_wf_cam: pp2800-wf-cam-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp2800_wf_cam";
		status = "disabled";

		regulator-min-microvolt = <2850000>;
		regulator-max-microvolt = <2850000>;

		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		/*
		 * The pinconf can only be referenced once so we put it on the
		 * first regulator and comment it out here.
		 * pinctrl-names = "default";
		 * pinctrl-0 = <&wf_cam_en>;
		 */

		vin-supply = <&pp3300_a>;
	};

244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289
	pp3300_audio:
	pp3300_codec: pp3300-codec-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp3300_codec";

		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&tlmm 83 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&en_pp3300_codec>;

		vin-supply = <&pp3300_a>;
	};

	pp3300_dx_edp:
	pp3300_ts: pp3300-dx-edp-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp3300_dx_edp";

		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&tlmm 30 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&en_pp3300_dx_edp>;

		vin-supply = <&pp3300_a>;
	};

	pp3300_fp_tp: pp3300-fp-tp-regulator {
		compatible = "regulator-fixed";
		regulator-name = "pp3300_fp_tp";

		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		/* AP turns on with PP1800_VIO_OUT; always on for AP */
		regulator-always-on;
		regulator-boot-on;

		vin-supply = <&pp3300_a>;
	};

290
	pp3300_hub: pp3300-hub-regulator {
291 292 293 294 295 296 297 298 299 300 301
		compatible = "regulator-fixed";
		regulator-name = "pp3300_hub";

		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;

		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
		enable-active-high;
		pinctrl-names = "default";
		pinctrl-0 = <&en_pp3300_hub>;

302
		/* The BIOS leaves this regulator on */
303 304 305 306 307
		regulator-boot-on;

		vin-supply = <&pp3300_a>;
	};

308 309 310 311 312
	/* BOARD-SPECIFIC TOP LEVEL NODES */

	backlight: backlight {
		compatible = "pwm-backlight";

313 314 315 316 317 318 319 320 321
		/* The panels don't seem to like anything below ~ 5% */
		brightness-levels = <
			196 256 324 400 484 576 676 784 900 1024 1156 1296
			1444 1600 1764 1936 2116 2304 2500 2704 2916 3136
			3364 3600 3844 4096
		>;
		num-interpolated-steps = <64>;
		default-brightness-level = <951>;

322 323 324 325 326 327 328 329 330 331 332 333 334
		pwms = <&cros_ec_pwm 1>;
		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
		power-supply = <&ppvar_sys>;
		pinctrl-names = "default";
		pinctrl-0 = <&ap_edp_bklten>;
	};

	gpio_keys: gpio-keys {
		compatible = "gpio-keys";
		status = "disabled";
		pinctrl-names = "default";
		pinctrl-0 = <&pen_pdct_l>;

335
		pen_insert: switch-pen-insert {
336 337 338 339 340 341
			label = "Pen Insert";

			/* Insert = low, eject = high */
			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
			linux,code = <SW_PEN_INSERTED>;
			linux,input-type = <EV_SW>;
342
			wakeup-event-action = <EV_ACT_DEASSERTED>;
343 344 345 346
			wakeup-source;
		};
	};

347 348
	max98360a: audio-codec-0 {
		compatible = "maxim,max98360a";
349 350 351 352 353 354 355 356 357 358 359
		pinctrl-names = "default";
		pinctrl-0 = <&amp_en>;
		sdmode-gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
		#sound-dai-cells = <0>;
	};

	pwmleds {
		compatible = "pwm-leds";
		keyboard_backlight: keyboard-backlight {
			status = "disabled";
			label = "cros_ec::kbd_backlight";
360
			function = LED_FUNCTION_KBD_BACKLIGHT;
361 362 363 364
			pwms = <&cros_ec_pwm 0>;
			max-brightness = <1023>;
		};
	};
365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396

	sound: sound {
		compatible = "google,sc7180-trogdor";
		model = "sc7180-rt5682-max98357a-1mic";

		audio-routing =
			"Headphone Jack", "HPOL",
			"Headphone Jack", "HPOR";

		#address-cells = <1>;
		#size-cells = <0>;

		dai-link@0 {
			link-name = "MultiMedia0";
			reg = <MI2S_PRIMARY>;
			cpu {
				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
			};

			sound_multimedia0_codec: codec {
				sound-dai = <&alc5682 0 /* aif1 */>;
			};
		};

		dai-link@1 {
			link-name = "MultiMedia1";
			reg = <MI2S_SECONDARY>;
			cpu {
				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
			};

			sound_multimedia1_codec: codec {
397
				sound-dai = <&max98360a>;
398 399
			};
		};
400

401
		dai-link@5 {
402
			link-name = "MultiMedia2";
403
			reg = <LPASS_DP_RX>;
404
			cpu {
405
				sound-dai = <&lpass_cpu LPASS_DP_RX>;
406 407 408 409 410 411
			};

			codec {
				sound-dai = <&mdss_dp>;
			};
		};
412
	};
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427
};

&qfprom {
	vcc-supply = <&pp1800_l11a>;
};

&qspi {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;

428
		spi-max-frequency = <37500000>;
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
		spi-tx-bus-width = <2>;
		spi-rx-bus-width = <2>;
	};
};

&apps_rsc {
	pm6150-rpmh-regulators {
		compatible = "qcom,pm6150-rpmh-regulators";
		qcom,pmic-id = "a";

		vddpx_1:
		vdd2:
		pp1125_s1a: smps1 {
			regulator-min-microvolt = <1128000>;
			regulator-max-microvolt = <1128000>;
		};

		vdd_qlink_lv:
		vdd_qlink_lv_ck:
		vdd_qusb_hs0_core:
		vdd_ufs1_core:
		vdda_mipi_csi0_0p9:
		vdda_mipi_csi1_0p9:
		vdda_mipi_csi2_0p9:
		vdda_mipi_csi3_0p9:
		vdda_mipi_dsi0_pll:
		vdda_pll_cc_ebi01:
		vdda_qrefs_0p9:
		vdda_usb_ss_dp_core:
		pp900_l4a: ldo4 {
			regulator-min-microvolt = <824000>;
			regulator-max-microvolt = <928000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vdd_cx_wlan:
		pp800_l9a: ldo9 {
			regulator-min-microvolt = <488000>;
			regulator-max-microvolt = <800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vdd1:
		vddpx_3:
		vddpx_7:
		vio_in:
		pp1800_l10a: ldo10 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vdd_qfprom:
		vdda_apc1_cs_1p8:
		vdda_qrefs_1p8:
		vdda_qusb_hs0_1p8:
		vddpx_11:
		vreg_bb_clk:
		pp1800_l11a: ldo11 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		mcp_vccq:
		pp1800_l12a_r: ldo12 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

500 501 502 503 504
		/*
		 * On trogdor this needs to match l10a since we use it to
		 * give power to things like SPI flash which communicate back
		 * on lines powered by l10a.  Thus we force to 1.8V.
		 */
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557
		pp1800_l13a: ldo13 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp1800_prox:
		pp1800_l14a: ldo14 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp1800_alc5682:
		pp1800_l15a: ldo15 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vdda_qusb_hs0_3p1:
		vdd_pdphy:
		pp3100_l17a: ldo17 {
			regulator-min-microvolt = <2920000>;
			regulator-max-microvolt = <3232000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp1800_pen:
		pp1800_l18a: ldo18 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		mcp_vcc:
		pp2850_l19a: ldo19 {
			regulator-min-microvolt = <2960000>;
			regulator-max-microvolt = <2960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};
	};

	pm6150l-rpmh-regulators {
		compatible = "qcom,pm6150l-rpmh-regulators";
		qcom,pmic-id = "c";

		pp1300_s8c: smps8 {
			regulator-min-microvolt = <1120000>;
			regulator-max-microvolt = <1408000>;
		};

		pp1800_l1c: ldo1 {
558 559
			regulator-min-microvolt = <1616000>;
			regulator-max-microvolt = <1984000>;
560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vdd_wcss_adc_dac:
		pp1300_l2c: ldo2 {
			regulator-min-microvolt = <1168000>;
			regulator-max-microvolt = <1304000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp1200_brij:
		vdd_ufs1_1p2:
		vdda_csi0_1p25:
		vdda_csi1_1p25:
		vdda_csi2_1p25:
		vdda_csi3_1p25:
		vdda_hv_ebi0:
		vdda_mipi_dsi0_1p2:
		vdda_usb_ss_dp_1p2:
		vddpx_10:
		pp1200_l3c: ldo3 {
			regulator-min-microvolt = <1200000>;
			regulator-max-microvolt = <1200000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		vddpx_2:
		ppvar_l6c: ldo6 {
			regulator-min-microvolt = <1800000>;
589
			regulator-max-microvolt = <2952000>;
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp3300_l7c: ldo7 {
			regulator-min-microvolt = <3304000>;
			regulator-max-microvolt = <3304000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp1800_brij_vccio:
		pp1800_edp_vpll:
		pp1800_l8c: ldo8 {
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp2950_l9c: ldo9 {
			regulator-min-microvolt = <2952000>;
			regulator-max-microvolt = <2952000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp3300_l10c: ldo10 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3400000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		pp3300_l11c: ldo11 {
			regulator-min-microvolt = <3000000>;
			regulator-max-microvolt = <3400000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
		};

		src_vreg_bob: bob {
			regulator-min-microvolt = <3008000>;
			regulator-max-microvolt = <3960000>;
			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
		};
	};
};

633
ap_ec_spi: &spi6 {
634 635 636 637 638 639 640 641 642 643
	status = "okay";
	cros_ec: ec@0 {
		compatible = "google,cros-ec-spi";
		reg = <0>;
		interrupt-parent = <&tlmm>;
		interrupts = <94 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
		pinctrl-0 = <&ap_ec_int_l>;
		spi-max-frequency = <3000000>;

644
		cros_ec_pwm: pwm {
645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660
			compatible = "google,cros-ec-pwm";
			#pwm-cells = <1>;
		};

		i2c_tunnel: i2c-tunnel {
			compatible = "google,cros-ec-i2c-tunnel";
			google,remote-bus = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
		};

		typec {
			compatible = "google,cros-ec-typec";
			#address-cells = <1>;
			#size-cells = <0>;

661
			usb_c0: connector@0 {
662 663 664 665 666 667 668 669
				compatible = "usb-c-connector";
				reg = <0>;
				label = "left";
				power-role = "dual";
				data-role = "host";
				try-power-role = "source";
			};

670
			usb_c1: connector@1 {
671 672 673 674 675 676 677 678 679 680 681
				compatible = "usb-c-connector";
				reg = <1>;
				label = "right";
				power-role = "dual";
				data-role = "host";
				try-power-role = "source";
			};
		};
	};
};

682
ap_h1_spi: &spi0 {
683 684 685 686 687 688 689 690 691 692 693 694
	status = "okay";
	cr50: tpm@0 {
		compatible = "google,cr50";
		reg = <0>;
		pinctrl-names = "default";
		pinctrl-0 = <&h1_ap_int_odl>;
		spi-max-frequency = <800000>;
		interrupt-parent = <&tlmm>;
		interrupts = <42 IRQ_TYPE_EDGE_RISING>;
	};
};

695 696 697 698
&camcc {
	status = "disabled";
};

699 700 701 702 703
&dsi0 {
	status = "okay";
	vdda-supply = <&vdda_mipi_dsi0_1p2>;
};

704 705 706 707
&dsi0_out {
	data-lanes = <0 1 2 3>;
};

708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
&dsi_phy {
	status = "okay";
	vdds-supply = <&vdda_mipi_dsi0_pll>;
};

ap_sar_sensor_i2c: &i2c5 {
	clock-frequency = <400000>;

	ap_sar_sensor: proximity@28 {
		compatible = "semtech,sx9310";
		reg = <0x28>;
		#io-channel-cells = <1>;
		pinctrl-names = "default";
		pinctrl-0 = <&p_sensor_int_l>;

		interrupt-parent = <&tlmm>;
		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;

		vdd-supply = <&pp3300_a>;
		svdd-supply = <&pp1800_prox>;

		label = "proximity-wifi";
	};
};

ap_tp_i2c: &i2c7 {
	clock-frequency = <400000>;

736
	trackpad: trackpad@15 {
737 738 739
		compatible = "elan,ekth3000";
		reg = <0x15>;
		pinctrl-names = "default";
740
		pinctrl-0 = <&tp_int_odl>;
741 742

		interrupt-parent = <&tlmm>;
743
		interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779

		vcc-supply = <&pp3300_fp_tp>;

		wakeup-source;
	};
};

hp_i2c: &i2c9 {
	status = "okay";
	clock-frequency = <400000>;

	alc5682: codec@1a {
		compatible = "realtek,rt5682i";
		reg = <0x1a>;
		pinctrl-names = "default";
		pinctrl-0 = <&hp_irq>;

		#sound-dai-cells = <1>;

		interrupt-parent = <&tlmm>;
		/*
		 * This will get ignored because the interrupt type
		 * is set in rt5682.c.
		 */
		interrupts = <28 IRQ_TYPE_EDGE_BOTH>;

		AVDD-supply = <&pp1800_alc5682>;
		MICVDD-supply = <&pp3300_codec>;
		VBAT-supply = <&pp3300_audio>;

		realtek,dmic1-data-pin = <1>;
		realtek,dmic1-clk-pin = <1>;
		realtek,jd-src = <1>;
	};
};

780 781 782 783 784 785 786 787 788 789 790 791 792 793 794
&lpass_cpu {
	status = "okay";

	pinctrl-names = "default";
	pinctrl-0 = <&sec_mi2s_active>, <&pri_mi2s_active>, <&pri_mi2s_mclk_active>;

	#address-cells = <1>;
	#size-cells = <0>;

	mi2s@0 {
		reg = <MI2S_PRIMARY>;
		qcom,playback-sd-lines = <1>;
		qcom,capture-sd-lines = <0>;
	};

795
	secondary_mi2s: mi2s@1 {
796 797 798
		reg = <MI2S_SECONDARY>;
		qcom,playback-sd-lines = <0>;
	};
799

800
	hdmi@5 {
801 802
		reg = <LPASS_DP_RX>;
	};
803 804
};

805 806 807 808 809 810 811 812
&mdp {
	status = "okay";
};

&mdss {
	status = "okay";
};

813 814 815 816 817 818 819
&mdss_dp {
	status = "okay";
	pinctrl-names = "default";
	pinctrl-0 = <&dp_hot_plug_det>;
	data-lanes = <0 1>;
};

820 821 822 823 824 825 826 827 828 829 830
&pm6150_adc {
	charger-thermistor@4f {
		reg = <ADC5_AMUX_THM3_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time = <200>;
	};
};

&pm6150_adc_tm {
	status = "okay";

831 832
	charger-thermistor@0 {
		reg = <0>;
833 834 835 836 837 838
		io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
		qcom,ratiometric;
		qcom,hw-settle-time-us = <200>;
	};
};

839
&pm6150_pon {
840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881
	status = "disabled";
};

&qupv3_id_0 {
	status = "okay";
};

&qupv3_id_1 {
	status = "okay";
};

&remoteproc_mpss {
	status = "okay";
	compatible = "qcom,sc7180-mss-pil";
	iommus = <&apps_smmu 0x461 0x0>, <&apps_smmu 0x444 0x3>;
	memory-region = <&mba_mem &mpss_mem>;

	/* This gets overridden for SKUs with LTE support. */
	firmware-name = "qcom/sc7180-trogdor/modem-nolte/mba.mbn",
			"qcom/sc7180-trogdor/modem-nolte/qdsp6sw.mbn";
};

&sdhc_1 {
	status = "okay";

	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc1_on>;
	pinctrl-1 = <&sdc1_off>;
	vmmc-supply = <&mcp_vcc>;
	vqmmc-supply = <&mcp_vccq>;
};

&sdhc_2 {
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&sdc2_on>;
	pinctrl-1 = <&sdc2_off>;
	vmmc-supply = <&pp2950_l9c>;
	vqmmc-supply = <&ppvar_l6c>;

	cd-gpios = <&tlmm 69 GPIO_ACTIVE_LOW>;
};

882
&spi0 {
883
	pinctrl-0 = <&qup_spi0_spi>, <&qup_spi0_cs_gpio>;
884 885 886 887
	cs-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
};

&spi6 {
888
	pinctrl-0 = <&qup_spi6_spi>, <&qup_spi6_cs_gpio>;
889 890 891
	cs-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
};

892
ap_spi_fp: &spi10 {
893
	pinctrl-0 = <&qup_spi10_spi>, <&qup_spi10_cs_gpio>;
894 895
	cs-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;

896 897 898 899 900 901
	cros_ec_fp: ec@0 {
		compatible = "google,cros-ec-spi";
		reg = <0>;
		interrupt-parent = <&tlmm>;
		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
		pinctrl-names = "default";
902
		pinctrl-0 = <&fp_to_ap_irq_l>;
903 904 905 906 907 908 909 910 911
		spi-max-frequency = <3000000>;
	};
};

#include <arm/cros-ec-sbs.dtsi>

&uart3 {
	status = "okay";

912 913 914 915 916 917 918
	/delete-property/interrupts;
	interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
				<&tlmm 41 IRQ_TYPE_EDGE_FALLING>;

	pinctrl-names = "default", "sleep";
	pinctrl-1 = <&qup_uart3_sleep>;

919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938
	bluetooth: bluetooth {
		compatible = "qcom,wcn3991-bt";
		vddio-supply = <&pp1800_l10a>;
		vddxo-supply = <&pp1800_l1c>;
		vddrf-supply = <&pp1300_l2c>;
		vddch0-supply = <&pp3300_l10c>;
		max-speed = <3200000>;
	};
};

&uart8 {
	status = "okay";
};

&usb_1 {
	status = "okay";
};

&usb_1_dwc3 {
	dr_mode = "host";
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956
	#address-cells = <1>;
	#size-cells = <0>;

	/* 2.x hub on port 1 */
	usb_hub_2_x: hub@1 {
		compatible = "usbbda,5411";
		reg = <1>;
		vdd-supply = <&pp3300_hub>;
		peer-hub = <&usb_hub_3_x>;
	};

	/* 3.x hub on port 2 */
	usb_hub_3_x: hub@2 {
		compatible = "usbbda,411";
		reg = <2>;
		vdd-supply = <&pp3300_hub>;
		peer-hub = <&usb_hub_2_x>;
	};
957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998
};

&usb_1_hsphy {
	status = "okay";
	vdd-supply = <&vdd_qusb_hs0_core>;
	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
	qcom,imp-res-offset-value = <8>;
	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_15_PERCENT>;
	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
	qcom,bias-ctrl-value = <0x22>;
	qcom,charge-ctrl-value = <3>;
	qcom,hsdisc-trim-value = <0>;
};

&usb_1_qmpphy {
	status = "okay";
	vdda-phy-supply = <&vdda_usb_ss_dp_1p2>;
	vdda-pll-supply = <&vdda_usb_ss_dp_core>;
};

&venus {
	video-firmware {
		iommus = <&apps_smmu 0x0c42 0x0>;
	};
};

&wifi {
	status = "okay";
	vdd-0.8-cx-mx-supply = <&vdd_cx_wlan>;
	vdd-1.8-xo-supply = <&pp1800_l1c>;
	vdd-1.3-rfa-supply = <&pp1300_l2c>;
	vdd-3.3-ch0-supply = <&pp3300_l10c>;
	vdd-3.3-ch1-supply = <&pp3300_l11c>;

	wifi-firmware {
		iommus = <&apps_smmu 0xc2 0x1>;
	};
};

/* PINCTRL - additions to nodes defined in sc7180.dtsi */

999
&dp_hot_plug_det {
1000
	bias-disable;
1001 1002
};

1003
&pri_mi2s_active {
1004 1005
	drive-strength = <2>;
	bias-pull-down;
1006 1007 1008
};

&pri_mi2s_mclk_active {
1009 1010
	drive-strength = <2>;
	bias-pull-down;
1011 1012
};

1013
&qspi_cs0 {
1014
	bias-disable;
1015 1016 1017
};

&qspi_clk {
1018 1019
	drive-strength = <8>;
	bias-disable;
1020 1021 1022
};

&qspi_data01 {
1023 1024
	/* High-Z when no transfers; nice to park the lines */
	bias-pull-up;
1025 1026 1027
};

&qup_i2c2_default {
1028
	drive-strength = <2>;
1029

1030 1031
	/* Has external pullup */
	bias-disable;
1032 1033 1034
};

&qup_i2c4_default {
1035
	drive-strength = <2>;
1036

1037 1038
	/* Has external pullup */
	bias-disable;
1039 1040 1041
};

&qup_i2c5_default {
1042
	drive-strength = <2>;
1043

1044 1045
	/* Has external pullup */
	bias-disable;
1046 1047 1048
};

&qup_i2c7_default {
1049
	drive-strength = <2>;
1050

1051 1052
	/* Has external pullup */
	bias-disable;
1053 1054 1055
};

&qup_i2c9_default {
1056
	drive-strength = <2>;
1057

1058 1059 1060 1061 1062 1063 1064
	/* Has external pullup */
	bias-disable;
};

&qup_spi0_spi {
	drive-strength = <2>;
	bias-disable;
1065 1066
};

1067
&qup_spi0_cs_gpio {
1068 1069 1070 1071 1072 1073 1074
	drive-strength = <2>;
	bias-disable;
};

&qup_spi6_spi {
	drive-strength = <2>;
	bias-disable;
1075 1076
};

1077
&qup_spi6_cs_gpio {
1078 1079 1080 1081 1082 1083 1084
	drive-strength = <2>;
	bias-disable;
};

&qup_spi10_spi {
	drive-strength = <2>;
	bias-disable;
1085 1086
};

1087
&qup_spi10_cs_gpio {
1088 1089
	drive-strength = <2>;
	bias-disable;
1090 1091
};

1092 1093 1094 1095 1096 1097 1098
&qup_uart3_cts {
	/*
	 * Configure a pull-down on CTS to match the pull of
	 * the Bluetooth module.
	 */
	bias-pull-down;
};
1099

1100 1101 1102 1103 1104
&qup_uart3_rts {
	/* We'll drive RTS, so no pull */
	drive-strength = <2>;
	bias-disable;
};
1105

1106 1107 1108 1109
&qup_uart3_tx {
	/* We'll drive TX, so no pull */
	drive-strength = <2>;
	bias-disable;
1110 1111
};

1112 1113 1114 1115 1116 1117 1118 1119 1120
&qup_uart3_rx {
	/*
	 * Configure a pull-up on RX. This is needed to avoid
	 * garbage data when the TX pin of the Bluetooth module is
	 * in tri-state (module powered off or not driving the
	 * signal yet).
	 */
	bias-pull-up;
};
1121

1122 1123 1124 1125 1126 1127 1128 1129
&qup_uart8_tx {
	drive-strength = <2>;
	bias-disable;
};

&qup_uart8_rx {
	drive-strength = <2>;
	bias-pull-up;
1130 1131
};

1132
&sec_mi2s_active {
1133 1134
	drive-strength = <2>;
	bias-pull-down;
1135 1136
};

1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164
/* PINCTRL - board-specific pinctrl */

&pm6150_gpio {
	status = "disabled"; /* No GPIOs are connected */
};

&pm6150l_gpio {
	gpio-line-names = "AP_SUSPEND",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "",
			  "";
};

&tlmm {
	/*
	 * pinctrl settings for pins that have no real owners.
	 */
	pinctrl-names = "default";
	pinctrl-0 = <&bios_flash_wp_l>, <&ap_suspend_l_neuter>;

1165 1166 1167 1168
	amp_en: amp-en-state {
		pins = "gpio23";
		function = "gpio";
		bias-pull-down;
1169 1170
	};

1171 1172 1173 1174 1175
	ap_ec_int_l: ap-ec-int-l-state {
		pins = "gpio94";
		function = "gpio";
		input-enable;
		bias-pull-up;
1176 1177
	};

1178 1179 1180 1181 1182
	ap_edp_bklten: ap-edp-bklten-state {
		pins = "gpio12";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
1183

1184 1185
		/* Force backlight to be disabled to match state at boot. */
		output-low;
1186 1187
	};

1188 1189 1190 1191
	ap_suspend_l_neuter: ap-suspend-l-neuter-state {
		pins = "gpio27";
		function = "gpio";
		bias-disable;
1192 1193
	};

1194 1195 1196 1197 1198
	bios_flash_wp_l: bios-flash-wp-l-state {
		pins = "gpio66";
		function = "gpio";
		input-enable;
		bias-disable;
1199 1200
	};

1201 1202 1203 1204 1205
	edp_brij_en: edp-brij-en-state {
		pins = "gpio104";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
1206 1207
	};

1208 1209 1210 1211 1212
	en_pp3300_codec: en-pp3300-codec-state {
		pins = "gpio83";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
1213 1214
	};

1215 1216 1217 1218 1219
	en_pp3300_dx_edp: en-pp3300-dx-edp-state {
		pins = "gpio30";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
1220 1221
	};

1222 1223 1224 1225 1226
	en_pp3300_hub: en-pp3300-hub-state {
		pins = "gpio84";
		function = "gpio";
		drive-strength = <2>;
		bias-disable;
1227 1228
	};

1229 1230 1231 1232
	fp_to_ap_irq_l: fp-to-ap-irq-l-state {
		pins = "gpio4";
		function = "gpio";
		input-enable;
1233

1234 1235
		/* Has external pullup */
		bias-disable;
1236 1237
	};

1238 1239 1240 1241 1242
	h1_ap_int_odl: h1-ap-int-odl-state {
		pins = "gpio42";
		function = "gpio";
		input-enable;
		bias-pull-up;
1243 1244
	};

1245 1246 1247 1248
	hp_irq: hp-irq-state {
		pins = "gpio28";
		function = "gpio";
		bias-pull-up;
1249 1250
	};

1251 1252 1253
	pen_irq_l: pen-irq-l-state {
		pins = "gpio21";
		function = "gpio";
1254

1255 1256
		/* Has external pullup */
		bias-disable;
1257 1258
	};

1259 1260 1261
	pen_pdct_l: pen-pdct-l-state-state {
		pins = "gpio52";
		function = "gpio";
1262

1263 1264
		/* Has external pullup */
		bias-disable;
1265 1266
	};

1267 1268 1269 1270 1271
	pen_rst_odl: pen-rst-odl-state {
		pins = "gpio18";
		function = "gpio";
		bias-disable;
		drive-strength = <2>;
1272

1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
		/*
		 * The pen driver doesn't currently support
		 * driving this reset line.  By specifying
		 * output-high here we're relying on the fact
		 * that this pin has a default pulldown at boot
		 * (which makes sure the pen was in reset if it
		 * was powered) and then we set it high here to
		 * take it out of reset.  Better would be if the
		 * pen driver could control this and we could
		 * remove "output-high" here.
		 */
		output-high; /* TODO: Remove this? */
1285 1286
	};

1287 1288 1289 1290
	p_sensor_int_l: p-sensor-int-l-state {
		pins = "gpio24";
		function = "gpio";
		input-enable;
1291

1292 1293
		/* Has external pullup */
		bias-disable;
1294 1295
	};

1296 1297
	qup_uart3_sleep: qup-uart3-sleep-state {
		cts-pins {
1298 1299 1300 1301 1302
			/*
			 * Configure a pull-down on CTS to match the pull of
			 * the Bluetooth module.
			 */
			pins = "gpio38";
1303
			function = "gpio";
1304 1305 1306
			bias-pull-down;
		};

1307
		rts-pins {
1308 1309 1310 1311 1312 1313
			/*
			 * Configure pull-down on RTS. As RTS is active low
			 * signal, pull it low to indicate the BT SoC that it
			 * can wakeup the system anytime from suspend state by
			 * pulling RX low (by sending wakeup bytes).
			 */
1314 1315 1316
			pins = "gpio39";
			function = "gpio";
			bias-pull-down;
1317 1318
		};

1319
		tx-pins {
1320 1321 1322 1323 1324
			/*
			 * Configure pull-up on TX when it isn't actively driven
			 * to prevent BT SoC from receiving garbage during sleep.
			 */
			pins = "gpio40";
1325
			function = "gpio";
1326 1327 1328
			bias-pull-up;
		};

1329
		rx-pins {
1330 1331 1332 1333 1334 1335
			/*
			 * Configure a pull-up on RX. This is needed to avoid
			 * garbage data when the TX pin of the Bluetooth module
			 * is floating which may cause spurious wakeups.
			 */
			pins = "gpio41";
1336
			function = "gpio";
1337 1338 1339 1340
			bias-pull-up;
		};
	};

1341 1342
	/* Named trackpad_int_1v8_odl on earlier revision schematics */
	trackpad_int_1v8_odl:
1343 1344 1345
	tp_int_odl: tp-int-odl-state {
		pins = "gpio0";
		function = "gpio";
1346

1347 1348
		/* Has external pullup */
		bias-disable;
1349 1350
	};

1351 1352 1353 1354
	ts_int_l: ts-int-l-state {
		pins = "gpio9";
		function = "gpio";
		bias-pull-up;
1355 1356
	};

1357 1358 1359 1360 1361
	ts_reset_l: ts-reset-l-state {
		pins = "gpio8";
		function = "gpio";
		bias-disable;
		drive-strength = <2>;
1362
	};
1363

1364 1365
	sdc1_on: sdc1-on-state {
		clk-pins {
1366 1367 1368 1369 1370
			pins = "sdc1_clk";
			bias-disable;
			drive-strength = <16>;
		};

1371
		cmd-pins {
1372 1373
			pins = "sdc1_cmd";
			bias-pull-up;
1374
			drive-strength = <16>;
1375 1376
		};

1377
		data-pins {
1378 1379
			pins = "sdc1_data";
			bias-pull-up;
1380
			drive-strength = <16>;
1381 1382
		};

1383
		rclk-pins {
1384 1385 1386 1387 1388
			pins = "sdc1_rclk";
			bias-pull-down;
		};
	};

1389 1390
	sdc1_off: sdc1-off-state {
		clk-pins {
1391 1392 1393 1394 1395
			pins = "sdc1_clk";
			bias-disable;
			drive-strength = <2>;
		};

1396
		cmd-pins {
1397 1398 1399 1400 1401
			pins = "sdc1_cmd";
			bias-pull-up;
			drive-strength = <2>;
		};

1402
		data-pins {
1403 1404 1405 1406 1407
			pins = "sdc1_data";
			bias-pull-up;
			drive-strength = <2>;
		};

1408
		rclk-pins {
1409 1410 1411 1412 1413
			pins = "sdc1_rclk";
			bias-pull-down;
		};
	};

1414 1415
	sdc2_on: sdc2-on-state {
		clk-pins {
1416 1417 1418 1419 1420
			pins = "sdc2_clk";
			bias-disable;
			drive-strength = <16>;
		};

1421
		cmd-pins {
1422 1423 1424 1425 1426
			pins = "sdc2_cmd";
			bias-pull-up;
			drive-strength = <10>;
		};

1427
		data-pins {
1428 1429 1430 1431 1432
			pins = "sdc2_data";
			bias-pull-up;
			drive-strength = <10>;
		};

1433
		sd-cd-pins {
1434
			pins = "gpio69";
1435
			function = "gpio";
1436 1437 1438 1439 1440
			bias-pull-up;
			drive-strength = <2>;
		};
	};

1441 1442
	sdc2_off: sdc2-off-state {
		clk-pins {
1443 1444 1445 1446 1447
			pins = "sdc2_clk";
			bias-disable;
			drive-strength = <2>;
		};

1448
		cmd-pins {
1449 1450 1451 1452 1453
			pins = "sdc2_cmd";
			bias-pull-up;
			drive-strength = <2>;
		};

1454
		data-pins {
1455 1456 1457 1458 1459
			pins = "sdc2_data";
			bias-pull-up;
			drive-strength = <2>;
		};

1460
		sd-cd-pins {
1461
			pins = "gpio69";
1462
			function = "gpio";
1463
			bias-pull-up;
1464 1465 1466
			drive-strength = <2>;
		};
	};
1467

1468 1469 1470 1471
	uf_cam_en: uf-cam-en-state {
		pins = "gpio6";
		function = "gpio";
		drive-strength = <2>;
1472

1473 1474
		/* External pull down */
		bias-disable;
1475 1476
	};

1477 1478 1479 1480
	wf_cam_en: wf-cam-en-state {
		pins = "gpio7";
		function = "gpio";
		drive-strength = <2>;
1481

1482 1483
		/* External pull down */
		bias-disable;
1484
	};
1485
};