1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Google Trogdor device tree source (common between revisions)
4 *
5 * Copyright 2019 Google LLC.
6 */
7
8#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/regulator/qcom,rpmh-regulator.h>
12#include <dt-bindings/sound/sc7180-lpass.h>
13
14#include "sc7180.dtsi"
15/* PMICs depend on spmi_bus label and so must come after sc7180.dtsi */
16#include "pm6150.dtsi"
17#include "pm6150l.dtsi"
18
19/ {
20	thermal-zones {
21		charger_thermal: charger-thermal {
22			polling-delay-passive = <0>;
23			polling-delay = <0>;
24
25			thermal-sensors = <&pm6150_adc_tm 0>;
26
27			trips {
28				charger-crit {
29					temperature = <125000>;
30					hysteresis = <1000>;
31					type = "critical";
32				};
33			};
34		};
35	};
36};
37
38/*
39 * Reserved memory changes
40 *
41 * Delete all unused memory nodes and define the peripheral memory regions
42 * required by the board dts.
43 */
44
45/delete-node/ &hyp_mem;
46/delete-node/ &ipa_fw_mem;
47/delete-node/ &xbl_mem;
48/delete-node/ &aop_mem;
49/delete-node/ &sec_apps_mem;
50/delete-node/ &tz_mem;
51
52/* Increase the size from 2MB to 8MB */
53&rmtfs_mem {
54	reg = <0x0 0x94600000 0x0 0x800000>;
55};
56
57/ {
58	reserved-memory {
59		atf_mem: memory@80b00000 {
60			reg = <0x0 0x80b00000 0x0 0x100000>;
61			no-map;
62		};
63
64		mpss_mem: memory@86000000 {
65			reg = <0x0 0x86000000 0x0 0x2000000>;
66			no-map;
67		};
68
69		venus_mem: memory@8f600000 {
70			reg = <0 0x8f600000 0 0x500000>;
71			no-map;
72		};
73
74		wlan_mem: memory@94100000 {
75			reg = <0x0 0x94100000 0x0 0x200000>;
76			no-map;
77		};
78
79		mba_mem: memory@94400000 {
80			reg = <0x0 0x94400000 0x0 0x200000>;
81			no-map;
82		};
83	};
84
85	aliases {
86		bluetooth0 = &bluetooth;
87		hsuart0 = &uart3;
88		serial0 = &uart8;
89		wifi0 = &wifi;
90	};
91
92	chosen {
93		stdout-path = "serial0:115200n8";
94	};
95
96	/* FIXED REGULATORS - parents above children */
97
98	/* This is the top level supply and variable voltage */
99	ppvar_sys: ppvar-sys-regulator {
100		compatible = "regulator-fixed";
101		regulator-name = "ppvar_sys";
102		regulator-always-on;
103		regulator-boot-on;
104	};
105
106	/* This divides ppvar_sys by 2, so voltage is variable */
107	src_vph_pwr: src-vph-pwr-regulator {
108		compatible = "regulator-fixed";
109		regulator-name = "src_vph_pwr";
110
111		/* EC turns on with switchcap_on; always on for AP */
112		regulator-always-on;
113		regulator-boot-on;
114
115		vin-supply = <&ppvar_sys>;
116	};
117
118	pp5000_a: pp5000-a-regulator {
119		compatible = "regulator-fixed";
120		regulator-name = "pp5000_a";
121
122		/* EC turns on with en_pp5000_a; always on for AP */
123		regulator-always-on;
124		regulator-boot-on;
125		regulator-min-microvolt = <5000000>;
126		regulator-max-microvolt = <5000000>;
127
128		vin-supply = <&ppvar_sys>;
129	};
130
131	pp3300_a: pp3300-a-regulator {
132		compatible = "regulator-fixed";
133		regulator-name = "pp3300_a";
134
135		/* EC turns on with en_pp3300_a; always on for AP */
136		regulator-always-on;
137		regulator-boot-on;
138		regulator-min-microvolt = <3300000>;
139		regulator-max-microvolt = <3300000>;
140
141		/*
142		 * Actually should be pp3300 but that's practically an alias for
143		 * pp3300_a so we use pp3300's vin-supply here to avoid one more
144		 * node.
145		 */
146		vin-supply = <&ppvar_sys>;
147	};
148
149	pp1800_ec:
150	pp1800_sensors:
151	pp1800_ldo: pp1800-ldo-regulator {
152		compatible = "regulator-fixed";
153		regulator-name = "pp1800_ldo";
154
155		/* EC turns on with hibernate_l; always on for AP */
156		regulator-always-on;
157		regulator-boot-on;
158		regulator-min-microvolt = <1800000>;
159		regulator-max-microvolt = <1800000>;
160
161		/*
162		 * Actually should be pp1800_h1 but we don't have any need to
163		 * model that so we use the parent of pp1800_h1.
164		 */
165		vin-supply = <&pp3300_a>;
166	};
167
168	pp1800_uf_cam: pp1800-uf-cam-regulator {
169		compatible = "regulator-fixed";
170		regulator-name = "pp1800_uf_cam";
171		status = "disabled";
172
173		regulator-min-microvolt = <1800000>;
174		regulator-max-microvolt = <1800000>;
175
176		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
177		enable-active-high;
178		pinctrl-names = "default";
179		pinctrl-0 = <&uf_cam_en>;
180
181		vin-supply = <&pp1800_ldo>;
182		regulator-enable-ramp-delay = <1000>;
183	};
184
185	pp1800_wf_cam: pp1800-wf-cam-regulator {
186		compatible = "regulator-fixed";
187		regulator-name = "pp1800_wf_cam";
188		status = "disabled";
189
190		regulator-min-microvolt = <1800000>;
191		regulator-max-microvolt = <1800000>;
192
193		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
194		enable-active-high;
195		pinctrl-names = "default";
196		pinctrl-0 = <&wf_cam_en>;
197
198		vin-supply = <&pp1800_ldo>;
199		regulator-enable-ramp-delay = <1000>;
200	};
201
202	pp2800_uf_cam: pp2800-uf-cam-regulator {
203		compatible = "regulator-fixed";
204		regulator-name = "pp2800_uf_cam";
205		status = "disabled";
206
207		regulator-min-microvolt = <2850000>;
208		regulator-max-microvolt = <2850000>;
209
210		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
211		enable-active-high;
212		/*
213		 * The pinconf can only be referenced once so we put it on the
214		 * first regulator and comment it out here.
215		 * pinctrl-names = "default";
216		 * pinctrl-0 = <&uf_cam_en>;
217		 */
218
219		vin-supply = <&pp3300_a>;
220	};
221
222	pp2800_vcm_wf_cam:
223	pp2800_wf_cam: pp2800-wf-cam-regulator {
224		compatible = "regulator-fixed";
225		regulator-name = "pp2800_wf_cam";
226		status = "disabled";
227
228		regulator-min-microvolt = <2850000>;
229		regulator-max-microvolt = <2850000>;
230
231		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
232		enable-active-high;
233		/*
234		 * The pinconf can only be referenced once so we put it on the
235		 * first regulator and comment it out here.
236		 * pinctrl-names = "default";
237		 * pinctrl-0 = <&wf_cam_en>;
238		 */
239
240		vin-supply = <&pp3300_a>;
241	};
242
243	pp3300_audio:
244	pp3300_codec: pp3300-codec-regulator {
245		compatible = "regulator-fixed";
246		regulator-name = "pp3300_codec";
247
248		regulator-min-microvolt = <3300000>;
249		regulator-max-microvolt = <3300000>;
250
251		gpio = <&tlmm 83 GPIO_ACTIVE_HIGH>;
252		enable-active-high;
253		pinctrl-names = "default";
254		pinctrl-0 = <&en_pp3300_codec>;
255
256		vin-supply = <&pp3300_a>;
257	};
258
259	pp3300_dx_edp:
260	pp3300_ts: pp3300-dx-edp-regulator {
261		compatible = "regulator-fixed";
262		regulator-name = "pp3300_dx_edp";
263
264		regulator-min-microvolt = <3300000>;
265		regulator-max-microvolt = <3300000>;
266
267		gpio = <&tlmm 30 GPIO_ACTIVE_HIGH>;
268		enable-active-high;
269		pinctrl-names = "default";
270		pinctrl-0 = <&en_pp3300_dx_edp>;
271
272		vin-supply = <&pp3300_a>;
273	};
274
275	pp3300_fp_tp: pp3300-fp-tp-regulator {
276		compatible = "regulator-fixed";
277		regulator-name = "pp3300_fp_tp";
278
279		regulator-min-microvolt = <3300000>;
280		regulator-max-microvolt = <3300000>;
281
282		/* AP turns on with PP1800_VIO_OUT; always on for AP */
283		regulator-always-on;
284		regulator-boot-on;
285
286		vin-supply = <&pp3300_a>;
287	};
288
289	pp3300_hub: pp3300-hub-regulator {
290		compatible = "regulator-fixed";
291		regulator-name = "pp3300_hub";
292
293		regulator-min-microvolt = <3300000>;
294		regulator-max-microvolt = <3300000>;
295
296		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
297		enable-active-high;
298		pinctrl-names = "default";
299		pinctrl-0 = <&en_pp3300_hub>;
300
301		regulator-always-on;
302		regulator-boot-on;
303
304		vin-supply = <&pp3300_a>;
305	};
306
307	/* BOARD-SPECIFIC TOP LEVEL NODES */
308
309	backlight: backlight {
310		compatible = "pwm-backlight";
311
312		/* The panels don't seem to like anything below ~ 5% */
313		brightness-levels = <
314			196 256 324 400 484 576 676 784 900 1024 1156 1296
315			1444 1600 1764 1936 2116 2304 2500 2704 2916 3136
316			3364 3600 3844 4096
317		>;
318		num-interpolated-steps = <64>;
319		default-brightness-level = <951>;
320
321		pwms = <&cros_ec_pwm 1>;
322		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
323		power-supply = <&ppvar_sys>;
324		pinctrl-names = "default";
325		pinctrl-0 = <&ap_edp_bklten>;
326	};
327
328	gpio_keys: gpio-keys {
329		compatible = "gpio-keys";
330		status = "disabled";
331		pinctrl-names = "default";
332		pinctrl-0 = <&pen_pdct_l>;
333
334		pen_insert: pen-insert {
335			label = "Pen Insert";
336
337			/* Insert = low, eject = high */
338			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
339			linux,code = <SW_PEN_INSERTED>;
340			linux,input-type = <EV_SW>;
341			wakeup-event-action = <EV_ACT_DEASSERTED>;
342			wakeup-source;
343		};
344	};
345
346	max98360a: audio-codec-0 {
347		compatible = "maxim,max98360a";
348		pinctrl-names = "default";
349		pinctrl-0 = <&amp_en>;
350		sdmode-gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
351		#sound-dai-cells = <0>;
352	};
353
354	pwmleds {
355		compatible = "pwm-leds";
356		keyboard_backlight: keyboard-backlight {
357			status = "disabled";
358			label = "cros_ec::kbd_backlight";
359			pwms = <&cros_ec_pwm 0>;
360			max-brightness = <1023>;
361		};
362	};
363
364	sound: sound {
365		compatible = "google,sc7180-trogdor";
366		model = "sc7180-rt5682-max98357a-1mic";
367
368		audio-routing =
369			"Headphone Jack", "HPOL",
370			"Headphone Jack", "HPOR";
371
372		#address-cells = <1>;
373		#size-cells = <0>;
374
375		dai-link@0 {
376			link-name = "MultiMedia0";
377			reg = <MI2S_PRIMARY>;
378			cpu {
379				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
380			};
381
382			sound_multimedia0_codec: codec {
383				sound-dai = <&alc5682 0 /* aif1 */>;
384			};
385		};
386
387		dai-link@1 {
388			link-name = "MultiMedia1";
389			reg = <MI2S_SECONDARY>;
390			cpu {
391				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
392			};
393
394			sound_multimedia1_codec: codec {
395				sound-dai = <&max98360a>;
396			};
397		};
398
399		dai-link@5 {
400			link-name = "MultiMedia2";
401			reg = <LPASS_DP_RX>;
402			cpu {
403				sound-dai = <&lpass_cpu LPASS_DP_RX>;
404			};
405
406			codec {
407				sound-dai = <&mdss_dp>;
408			};
409		};
410	};
411};
412
413&qfprom {
414	vcc-supply = <&pp1800_l11a>;
415};
416
417&qspi {
418	status = "okay";
419	pinctrl-names = "default";
420	pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
421
422	flash@0 {
423		compatible = "jedec,spi-nor";
424		reg = <0>;
425
426		spi-max-frequency = <37500000>;
427		spi-tx-bus-width = <2>;
428		spi-rx-bus-width = <2>;
429	};
430};
431
432&apps_rsc {
433	pm6150-rpmh-regulators {
434		compatible = "qcom,pm6150-rpmh-regulators";
435		qcom,pmic-id = "a";
436
437		vddpx_1:
438		vdd2:
439		pp1125_s1a: smps1 {
440			regulator-min-microvolt = <1128000>;
441			regulator-max-microvolt = <1128000>;
442		};
443
444		vdd_qlink_lv:
445		vdd_qlink_lv_ck:
446		vdd_qusb_hs0_core:
447		vdd_ufs1_core:
448		vdda_mipi_csi0_0p9:
449		vdda_mipi_csi1_0p9:
450		vdda_mipi_csi2_0p9:
451		vdda_mipi_csi3_0p9:
452		vdda_mipi_dsi0_pll:
453		vdda_pll_cc_ebi01:
454		vdda_qrefs_0p9:
455		vdda_usb_ss_dp_core:
456		pp900_l4a: ldo4 {
457			regulator-min-microvolt = <824000>;
458			regulator-max-microvolt = <928000>;
459			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
460		};
461
462		vdd_cx_wlan:
463		pp800_l9a: ldo9 {
464			regulator-min-microvolt = <488000>;
465			regulator-max-microvolt = <800000>;
466			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
467		};
468
469		vdd1:
470		vddpx_3:
471		vddpx_7:
472		vio_in:
473		pp1800_l10a: ldo10 {
474			regulator-min-microvolt = <1800000>;
475			regulator-max-microvolt = <1800000>;
476			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
477		};
478
479		vdd_qfprom:
480		vdda_apc1_cs_1p8:
481		vdda_qrefs_1p8:
482		vdda_qusb_hs0_1p8:
483		vddpx_11:
484		vreg_bb_clk:
485		pp1800_l11a: ldo11 {
486			regulator-min-microvolt = <1800000>;
487			regulator-max-microvolt = <1800000>;
488			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
489		};
490
491		mcp_vccq:
492		pp1800_l12a_r: ldo12 {
493			regulator-min-microvolt = <1800000>;
494			regulator-max-microvolt = <1800000>;
495			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
496		};
497
498		/*
499		 * On trogdor this needs to match l10a since we use it to
500		 * give power to things like SPI flash which communicate back
501		 * on lines powered by l10a.  Thus we force to 1.8V.
502		 */
503		pp1800_l13a: ldo13 {
504			regulator-min-microvolt = <1800000>;
505			regulator-max-microvolt = <1800000>;
506			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
507		};
508
509		pp1800_prox:
510		pp1800_l14a: ldo14 {
511			regulator-min-microvolt = <1800000>;
512			regulator-max-microvolt = <1800000>;
513			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
514		};
515
516		pp1800_alc5682:
517		pp1800_l15a: ldo15 {
518			regulator-min-microvolt = <1800000>;
519			regulator-max-microvolt = <1800000>;
520			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
521		};
522
523		vdda_qusb_hs0_3p1:
524		vdd_pdphy:
525		pp3100_l17a: ldo17 {
526			regulator-min-microvolt = <2920000>;
527			regulator-max-microvolt = <3232000>;
528			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
529		};
530
531		pp1800_pen:
532		pp1800_l18a: ldo18 {
533			regulator-min-microvolt = <1800000>;
534			regulator-max-microvolt = <1800000>;
535			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
536		};
537
538		mcp_vcc:
539		pp2850_l19a: ldo19 {
540			regulator-min-microvolt = <2960000>;
541			regulator-max-microvolt = <2960000>;
542			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
543		};
544	};
545
546	pm6150l-rpmh-regulators {
547		compatible = "qcom,pm6150l-rpmh-regulators";
548		qcom,pmic-id = "c";
549
550		pp1300_s8c: smps8 {
551			regulator-min-microvolt = <1120000>;
552			regulator-max-microvolt = <1408000>;
553		};
554
555		pp1800_l1c: ldo1 {
556			regulator-min-microvolt = <1616000>;
557			regulator-max-microvolt = <1984000>;
558			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
559		};
560
561		vdd_wcss_adc_dac:
562		pp1300_l2c: ldo2 {
563			regulator-min-microvolt = <1168000>;
564			regulator-max-microvolt = <1304000>;
565			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
566		};
567
568		pp1200_brij:
569		vdd_ufs1_1p2:
570		vdda_csi0_1p25:
571		vdda_csi1_1p25:
572		vdda_csi2_1p25:
573		vdda_csi3_1p25:
574		vdda_hv_ebi0:
575		vdda_mipi_dsi0_1p2:
576		vdda_usb_ss_dp_1p2:
577		vddpx_10:
578		pp1200_l3c: ldo3 {
579			regulator-min-microvolt = <1200000>;
580			regulator-max-microvolt = <1200000>;
581			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
582		};
583
584		vddpx_2:
585		ppvar_l6c: ldo6 {
586			regulator-min-microvolt = <1800000>;
587			regulator-max-microvolt = <2952000>;
588			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
589		};
590
591		pp3300_l7c: ldo7 {
592			regulator-min-microvolt = <3304000>;
593			regulator-max-microvolt = <3304000>;
594			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
595		};
596
597		pp1800_brij_vccio:
598		pp1800_edp_vpll:
599		pp1800_l8c: ldo8 {
600			regulator-min-microvolt = <1800000>;
601			regulator-max-microvolt = <1800000>;
602			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
603		};
604
605		pp2950_l9c: ldo9 {
606			regulator-min-microvolt = <2952000>;
607			regulator-max-microvolt = <2952000>;
608			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
609		};
610
611		pp3300_l10c: ldo10 {
612			regulator-min-microvolt = <3000000>;
613			regulator-max-microvolt = <3400000>;
614			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
615		};
616
617		pp3300_l11c: ldo11 {
618			regulator-min-microvolt = <3000000>;
619			regulator-max-microvolt = <3400000>;
620			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
621		};
622
623		src_vreg_bob: bob {
624			regulator-min-microvolt = <3008000>;
625			regulator-max-microvolt = <3960000>;
626			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
627		};
628	};
629};
630
631ap_ec_spi: &spi6 {
632	status = "okay";
633	cros_ec: ec@0 {
634		compatible = "google,cros-ec-spi";
635		reg = <0>;
636		interrupt-parent = <&tlmm>;
637		interrupts = <94 IRQ_TYPE_LEVEL_LOW>;
638		pinctrl-names = "default";
639		pinctrl-0 = <&ap_ec_int_l>;
640		spi-max-frequency = <3000000>;
641
642		cros_ec_pwm: pwm {
643			compatible = "google,cros-ec-pwm";
644			#pwm-cells = <1>;
645		};
646
647		i2c_tunnel: i2c-tunnel {
648			compatible = "google,cros-ec-i2c-tunnel";
649			google,remote-bus = <0>;
650			#address-cells = <1>;
651			#size-cells = <0>;
652		};
653
654		typec {
655			compatible = "google,cros-ec-typec";
656			#address-cells = <1>;
657			#size-cells = <0>;
658
659			usb_c0: connector@0 {
660				compatible = "usb-c-connector";
661				reg = <0>;
662				label = "left";
663				power-role = "dual";
664				data-role = "host";
665				try-power-role = "source";
666			};
667
668			usb_c1: connector@1 {
669				compatible = "usb-c-connector";
670				reg = <1>;
671				label = "right";
672				power-role = "dual";
673				data-role = "host";
674				try-power-role = "source";
675			};
676		};
677	};
678};
679
680ap_h1_spi: &spi0 {
681	status = "okay";
682	cr50: tpm@0 {
683		compatible = "google,cr50";
684		reg = <0>;
685		pinctrl-names = "default";
686		pinctrl-0 = <&h1_ap_int_odl>;
687		spi-max-frequency = <800000>;
688		interrupt-parent = <&tlmm>;
689		interrupts = <42 IRQ_TYPE_EDGE_RISING>;
690	};
691};
692
693&camcc {
694	status = "disabled";
695};
696
697&dsi0 {
698	status = "okay";
699	vdda-supply = <&vdda_mipi_dsi0_1p2>;
700};
701
702&dsi0_out {
703	data-lanes = <0 1 2 3>;
704};
705
706&dsi_phy {
707	status = "okay";
708	vdds-supply = <&vdda_mipi_dsi0_pll>;
709};
710
711ap_sar_sensor_i2c: &i2c5 {
712	clock-frequency = <400000>;
713
714	ap_sar_sensor: proximity@28 {
715		compatible = "semtech,sx9310";
716		reg = <0x28>;
717		#io-channel-cells = <1>;
718		pinctrl-names = "default";
719		pinctrl-0 = <&p_sensor_int_l>;
720
721		interrupt-parent = <&tlmm>;
722		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
723
724		vdd-supply = <&pp3300_a>;
725		svdd-supply = <&pp1800_prox>;
726
727		label = "proximity-wifi";
728	};
729};
730
731ap_tp_i2c: &i2c7 {
732	clock-frequency = <400000>;
733
734	trackpad: trackpad@15 {
735		compatible = "elan,ekth3000";
736		reg = <0x15>;
737		pinctrl-names = "default";
738		pinctrl-0 = <&tp_int_odl>;
739
740		interrupt-parent = <&tlmm>;
741		interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
742
743		vcc-supply = <&pp3300_fp_tp>;
744
745		wakeup-source;
746	};
747};
748
749hp_i2c: &i2c9 {
750	status = "okay";
751	clock-frequency = <400000>;
752
753	alc5682: codec@1a {
754		compatible = "realtek,rt5682i";
755		reg = <0x1a>;
756		pinctrl-names = "default";
757		pinctrl-0 = <&hp_irq>;
758
759		#sound-dai-cells = <1>;
760
761		interrupt-parent = <&tlmm>;
762		/*
763		 * This will get ignored because the interrupt type
764		 * is set in rt5682.c.
765		 */
766		interrupts = <28 IRQ_TYPE_EDGE_BOTH>;
767
768		AVDD-supply = <&pp1800_alc5682>;
769		MICVDD-supply = <&pp3300_codec>;
770		VBAT-supply = <&pp3300_audio>;
771
772		realtek,dmic1-data-pin = <1>;
773		realtek,dmic1-clk-pin = <1>;
774		realtek,jd-src = <1>;
775	};
776};
777
778&lpass_cpu {
779	status = "okay";
780
781	pinctrl-names = "default";
782	pinctrl-0 = <&sec_mi2s_active>, <&pri_mi2s_active>, <&pri_mi2s_mclk_active>;
783
784	#address-cells = <1>;
785	#size-cells = <0>;
786
787	mi2s@0 {
788		reg = <MI2S_PRIMARY>;
789		qcom,playback-sd-lines = <1>;
790		qcom,capture-sd-lines = <0>;
791	};
792
793	secondary_mi2s: mi2s@1 {
794		reg = <MI2S_SECONDARY>;
795		qcom,playback-sd-lines = <0>;
796	};
797
798	hdmi@5 {
799		reg = <LPASS_DP_RX>;
800	};
801};
802
803&mdp {
804	status = "okay";
805};
806
807&mdss {
808	status = "okay";
809};
810
811&mdss_dp {
812	status = "okay";
813	pinctrl-names = "default";
814	pinctrl-0 = <&dp_hot_plug_det>;
815	data-lanes = <0 1>;
816	vdda-1p2-supply = <&vdda_usb_ss_dp_1p2>;
817	vdda-0p9-supply = <&vdda_usb_ss_dp_core>;
818};
819
820&pm6150_adc {
821	charger-thermistor@4f {
822		reg = <ADC5_AMUX_THM3_100K_PU>;
823		qcom,ratiometric;
824		qcom,hw-settle-time = <200>;
825	};
826};
827
828&pm6150_adc_tm {
829	status = "okay";
830
831	charger-thermistor@0 {
832		reg = <0>;
833		io-channels = <&pm6150_adc ADC5_AMUX_THM3_100K_PU>;
834		qcom,ratiometric;
835		qcom,hw-settle-time-us = <200>;
836	};
837};
838
839&pm6150_pon {
840	status = "disabled";
841};
842
843&qupv3_id_0 {
844	status = "okay";
845};
846
847&qupv3_id_1 {
848	status = "okay";
849};
850
851&remoteproc_mpss {
852	status = "okay";
853	compatible = "qcom,sc7180-mss-pil";
854	iommus = <&apps_smmu 0x461 0x0>, <&apps_smmu 0x444 0x3>;
855	memory-region = <&mba_mem &mpss_mem>;
856
857	/* This gets overridden for SKUs with LTE support. */
858	firmware-name = "qcom/sc7180-trogdor/modem-nolte/mba.mbn",
859			"qcom/sc7180-trogdor/modem-nolte/qdsp6sw.mbn";
860};
861
862&sdhc_1 {
863	status = "okay";
864
865	pinctrl-names = "default", "sleep";
866	pinctrl-0 = <&sdc1_on>;
867	pinctrl-1 = <&sdc1_off>;
868	vmmc-supply = <&mcp_vcc>;
869	vqmmc-supply = <&mcp_vccq>;
870};
871
872&sdhc_2 {
873	pinctrl-names = "default", "sleep";
874	pinctrl-0 = <&sdc2_on>;
875	pinctrl-1 = <&sdc2_off>;
876	vmmc-supply = <&pp2950_l9c>;
877	vqmmc-supply = <&ppvar_l6c>;
878
879	cd-gpios = <&tlmm 69 GPIO_ACTIVE_LOW>;
880};
881
882&spi0 {
883	pinctrl-0 = <&qup_spi0_cs_gpio_init_high>, <&qup_spi0_cs_gpio>;
884	cs-gpios = <&tlmm 37 GPIO_ACTIVE_LOW>;
885};
886
887&spi6 {
888	pinctrl-0 = <&qup_spi6_cs_gpio_init_high>, <&qup_spi6_cs_gpio>;
889	cs-gpios = <&tlmm 62 GPIO_ACTIVE_LOW>;
890};
891
892ap_spi_fp: &spi10 {
893	pinctrl-0 = <&qup_spi10_cs_gpio_init_high>, <&qup_spi10_cs_gpio>;
894	cs-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
895
896	cros_ec_fp: ec@0 {
897		compatible = "google,cros-ec-spi";
898		reg = <0>;
899		interrupt-parent = <&tlmm>;
900		interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
901		pinctrl-names = "default";
902		pinctrl-0 = <&fp_to_ap_irq_l>;
903		spi-max-frequency = <3000000>;
904	};
905};
906
907#include <arm/cros-ec-keyboard.dtsi>
908#include <arm/cros-ec-sbs.dtsi>
909
910&uart3 {
911	status = "okay";
912
913	/delete-property/interrupts;
914	interrupts-extended = <&intc GIC_SPI 604 IRQ_TYPE_LEVEL_HIGH>,
915				<&tlmm 41 IRQ_TYPE_EDGE_FALLING>;
916
917	pinctrl-names = "default", "sleep";
918	pinctrl-1 = <&qup_uart3_sleep>;
919
920	bluetooth: bluetooth {
921		compatible = "qcom,wcn3991-bt";
922		vddio-supply = <&pp1800_l10a>;
923		vddxo-supply = <&pp1800_l1c>;
924		vddrf-supply = <&pp1300_l2c>;
925		vddch0-supply = <&pp3300_l10c>;
926		max-speed = <3200000>;
927	};
928};
929
930&uart8 {
931	status = "okay";
932};
933
934&usb_1 {
935	status = "okay";
936};
937
938&usb_1_dwc3 {
939	dr_mode = "host";
940};
941
942&usb_1_hsphy {
943	status = "okay";
944	vdd-supply = <&vdd_qusb_hs0_core>;
945	vdda-pll-supply = <&vdda_qusb_hs0_1p8>;
946	vdda-phy-dpdm-supply = <&vdda_qusb_hs0_3p1>;
947	qcom,imp-res-offset-value = <8>;
948	qcom,preemphasis-level = <QUSB2_V2_PREEMPHASIS_15_PERCENT>;
949	qcom,preemphasis-width = <QUSB2_V2_PREEMPHASIS_WIDTH_HALF_BIT>;
950	qcom,bias-ctrl-value = <0x22>;
951	qcom,charge-ctrl-value = <3>;
952	qcom,hsdisc-trim-value = <0>;
953};
954
955&usb_1_qmpphy {
956	status = "okay";
957	vdda-phy-supply = <&vdda_usb_ss_dp_1p2>;
958	vdda-pll-supply = <&vdda_usb_ss_dp_core>;
959};
960
961&venus {
962	video-firmware {
963		iommus = <&apps_smmu 0x0c42 0x0>;
964	};
965};
966
967&wifi {
968	status = "okay";
969	vdd-0.8-cx-mx-supply = <&vdd_cx_wlan>;
970	vdd-1.8-xo-supply = <&pp1800_l1c>;
971	vdd-1.3-rfa-supply = <&pp1300_l2c>;
972	vdd-3.3-ch0-supply = <&pp3300_l10c>;
973	vdd-3.3-ch1-supply = <&pp3300_l11c>;
974
975	wifi-firmware {
976		iommus = <&apps_smmu 0xc2 0x1>;
977	};
978};
979
980/* PINCTRL - additions to nodes defined in sc7180.dtsi */
981
982&dp_hot_plug_det {
983	pinconf {
984		pins = "gpio117";
985		bias-disable;
986	};
987};
988
989&pri_mi2s_active {
990	pinconf {
991		pins = "gpio53", "gpio54", "gpio55", "gpio56";
992		drive-strength = <2>;
993		bias-pull-down;
994	};
995};
996
997&pri_mi2s_mclk_active {
998	pinconf {
999		pins = "gpio57";
1000		drive-strength = <2>;
1001		bias-pull-down;
1002	};
1003};
1004
1005&qspi_cs0 {
1006	pinconf {
1007		pins = "gpio68";
1008		bias-disable;
1009	};
1010};
1011
1012&qspi_clk {
1013	pinconf {
1014		pins = "gpio63";
1015		drive-strength = <8>;
1016		bias-disable;
1017	};
1018};
1019
1020&qspi_data01 {
1021	pinconf {
1022		pins = "gpio64", "gpio65";
1023
1024		/* High-Z when no transfers; nice to park the lines */
1025		bias-pull-up;
1026	};
1027};
1028
1029&qup_i2c2_default {
1030	pinconf {
1031		pins = "gpio15", "gpio16";
1032		drive-strength = <2>;
1033
1034		/* Has external pullup */
1035		bias-disable;
1036	};
1037};
1038
1039&qup_i2c4_default {
1040	pinconf {
1041		pins = "gpio115", "gpio116";
1042		drive-strength = <2>;
1043
1044		/* Has external pullup */
1045		bias-disable;
1046	};
1047};
1048
1049&qup_i2c5_default {
1050	pinconf {
1051		pins = "gpio25", "gpio26";
1052		drive-strength = <2>;
1053
1054		/* Has external pullup */
1055		bias-disable;
1056	};
1057};
1058
1059&qup_i2c7_default {
1060	pinconf {
1061		pins = "gpio6", "gpio7";
1062		drive-strength = <2>;
1063
1064		/* Has external pullup */
1065		bias-disable;
1066	};
1067};
1068
1069&qup_i2c9_default {
1070	pinconf {
1071		pins = "gpio46", "gpio47";
1072		drive-strength = <2>;
1073
1074		/* Has external pullup */
1075		bias-disable;
1076	};
1077};
1078
1079&qup_spi0_cs_gpio {
1080	pinconf {
1081		pins = "gpio34", "gpio35", "gpio36", "gpio37";
1082		drive-strength = <2>;
1083		bias-disable;
1084	};
1085};
1086
1087&qup_spi6_cs_gpio {
1088	pinconf {
1089		pins = "gpio59", "gpio60", "gpio61", "gpio62";
1090		drive-strength = <2>;
1091		bias-disable;
1092	};
1093};
1094
1095&qup_spi10_cs_gpio {
1096	pinconf {
1097		pins = "gpio86", "gpio87", "gpio88", "gpio89";
1098		drive-strength = <2>;
1099		bias-disable;
1100	};
1101};
1102
1103&qup_uart3_default {
1104	pinconf-cts {
1105		/*
1106		 * Configure a pull-down on CTS to match the pull of
1107		 * the Bluetooth module.
1108		 */
1109		pins = "gpio38";
1110		bias-pull-down;
1111	};
1112
1113	pinconf-rts-tx {
1114		/* We'll drive RTS and TX, so no pull */
1115		pins = "gpio39", "gpio40";
1116		drive-strength = <2>;
1117		bias-disable;
1118	};
1119
1120	pinconf-rx {
1121		/*
1122		 * Configure a pull-up on RX. This is needed to avoid
1123		 * garbage data when the TX pin of the Bluetooth module is
1124		 * in tri-state (module powered off or not driving the
1125		 * signal yet).
1126		 */
1127		pins = "gpio41";
1128		bias-pull-up;
1129	};
1130};
1131
1132&qup_uart8_default {
1133	pinconf-tx {
1134		pins = "gpio44";
1135		drive-strength = <2>;
1136		bias-disable;
1137	};
1138
1139	pinconf-rx {
1140		pins = "gpio45";
1141		drive-strength = <2>;
1142		bias-pull-up;
1143	};
1144};
1145
1146&sec_mi2s_active {
1147	pinconf {
1148		pins = "gpio49", "gpio50", "gpio51";
1149		drive-strength = <2>;
1150		bias-pull-down;
1151	};
1152};
1153
1154/* PINCTRL - board-specific pinctrl */
1155
1156&pm6150_gpio {
1157	status = "disabled"; /* No GPIOs are connected */
1158};
1159
1160&pm6150l_gpio {
1161	gpio-line-names = "AP_SUSPEND",
1162			  "",
1163			  "",
1164			  "",
1165			  "",
1166			  "",
1167			  "",
1168			  "",
1169			  "",
1170			  "",
1171			  "",
1172			  "";
1173};
1174
1175&tlmm {
1176	/*
1177	 * pinctrl settings for pins that have no real owners.
1178	 */
1179	pinctrl-names = "default";
1180	pinctrl-0 = <&bios_flash_wp_l>, <&ap_suspend_l_neuter>;
1181
1182	amp_en: amp-en {
1183		pinmux {
1184			pins = "gpio23";
1185			function = "gpio";
1186		};
1187
1188		pinconf {
1189			pins = "gpio23";
1190			bias-pull-down;
1191		};
1192	};
1193
1194	ap_ec_int_l: ap-ec-int-l {
1195		pinmux {
1196			pins = "gpio94";
1197			function = "gpio";
1198			input-enable;
1199		};
1200
1201		pinconf {
1202			pins = "gpio94";
1203			bias-pull-up;
1204		};
1205	};
1206
1207	ap_edp_bklten: ap-edp-bklten {
1208		pinmux {
1209			pins = "gpio12";
1210			function = "gpio";
1211		};
1212
1213		pinconf {
1214			pins = "gpio12";
1215			drive-strength = <2>;
1216			bias-disable;
1217
1218			/* Force backlight to be disabled to match state at boot. */
1219			output-low;
1220		};
1221	};
1222
1223	ap_suspend_l_neuter: ap-suspend-l-neuter {
1224		pinmux  {
1225			pins = "gpio27";
1226			function = "gpio";
1227		};
1228
1229		pinconf {
1230			pins = "gpio27";
1231			bias-disable;
1232		};
1233	};
1234
1235	bios_flash_wp_l: bios-flash-wp-l {
1236		pinmux {
1237			pins = "gpio66";
1238			function = "gpio";
1239			input-enable;
1240		};
1241
1242		pinconf {
1243			pins = "gpio66";
1244			bias-disable;
1245		};
1246	};
1247
1248	edp_brij_en: edp-brij-en {
1249		pinmux {
1250			pins = "gpio104";
1251			function = "gpio";
1252		};
1253
1254		pinconf {
1255			pins = "gpio104";
1256			drive-strength = <2>;
1257			bias-disable;
1258		};
1259	};
1260
1261	en_pp3300_codec: en-pp3300-codec {
1262		pinmux {
1263			pins = "gpio83";
1264			function = "gpio";
1265		};
1266
1267		pinconf {
1268			pins = "gpio83";
1269			drive-strength = <2>;
1270			bias-disable;
1271		};
1272	};
1273
1274	en_pp3300_dx_edp: en-pp3300-dx-edp {
1275		pinmux {
1276			pins = "gpio30";
1277			function = "gpio";
1278		};
1279
1280		pinconf {
1281			pins = "gpio30";
1282			drive-strength = <2>;
1283			bias-disable;
1284		};
1285	};
1286
1287	en_pp3300_hub: en-pp3300-hub {
1288		pinmux {
1289			pins = "gpio84";
1290			function = "gpio";
1291		};
1292
1293		pinconf {
1294			pins = "gpio84";
1295			drive-strength = <2>;
1296			bias-disable;
1297		};
1298	};
1299
1300	fp_to_ap_irq_l: fp-to-ap-irq-l {
1301		pinmux {
1302			pins = "gpio4";
1303			function = "gpio";
1304			input-enable;
1305		};
1306
1307		pinconf {
1308			pins = "gpio4";
1309
1310			/* Has external pullup */
1311			bias-disable;
1312		};
1313	};
1314
1315	h1_ap_int_odl: h1-ap-int-odl {
1316		pinmux {
1317			pins = "gpio42";
1318			function = "gpio";
1319			input-enable;
1320		};
1321
1322		pinconf {
1323			pins = "gpio42";
1324			bias-pull-up;
1325		};
1326	};
1327
1328	hp_irq: hp-irq {
1329		pinmux {
1330			pins = "gpio28";
1331			function = "gpio";
1332		};
1333
1334		pinconf {
1335			pins = "gpio28";
1336			bias-pull-up;
1337		};
1338	};
1339
1340	pen_irq_l: pen-irq-l {
1341		pinmux {
1342			pins = "gpio21";
1343			function = "gpio";
1344		};
1345
1346		pinconf {
1347			pins = "gpio21";
1348
1349			/* Has external pullup */
1350			bias-disable;
1351		};
1352	};
1353
1354	pen_pdct_l: pen-pdct-l {
1355		pinmux {
1356			pins = "gpio52";
1357			function = "gpio";
1358		};
1359
1360		pinconf {
1361			pins = "gpio52";
1362
1363			/* Has external pullup */
1364			bias-disable;
1365		};
1366	};
1367
1368	pen_rst_odl: pen-rst-odl {
1369		pinmux  {
1370			pins = "gpio18";
1371			function = "gpio";
1372		};
1373
1374		pinconf {
1375			pins = "gpio18";
1376			bias-disable;
1377			drive-strength = <2>;
1378
1379			/*
1380			 * The pen driver doesn't currently support
1381			 * driving this reset line.  By specifying
1382			 * output-high here we're relying on the fact
1383			 * that this pin has a default pulldown at boot
1384			 * (which makes sure the pen was in reset if it
1385			 * was powered) and then we set it high here to
1386			 * take it out of reset.  Better would be if the
1387			 * pen driver could control this and we could
1388			 * remove "output-high" here.
1389			 */
1390			output-high; /* TODO: Remove this? */
1391		};
1392	};
1393
1394	p_sensor_int_l: p-sensor-int-l {
1395		pinmux {
1396			pins = "gpio24";
1397			function = "gpio";
1398			input-enable;
1399		};
1400
1401		pinconf {
1402			pins = "gpio24";
1403			/* Has external pullup */
1404			bias-disable;
1405		};
1406	};
1407
1408	qup_spi0_cs_gpio_init_high: qup-spi0-cs-gpio-init-high {
1409		pinconf {
1410			pins = "gpio37";
1411			output-high;
1412		};
1413	};
1414
1415	qup_spi6_cs_gpio_init_high: qup-spi6-cs-gpio-init-high {
1416		pinconf {
1417			pins = "gpio62";
1418			output-high;
1419		};
1420	};
1421
1422	qup_spi10_cs_gpio_init_high: qup-spi10-cs-gpio-init-high {
1423		pinconf {
1424			pins = "gpio89";
1425			output-high;
1426		};
1427	};
1428
1429	qup_uart3_sleep: qup-uart3-sleep {
1430		pinmux {
1431			pins = "gpio38", "gpio39",
1432			       "gpio40", "gpio41";
1433			function = "gpio";
1434		};
1435
1436		pinconf-cts {
1437			/*
1438			 * Configure a pull-down on CTS to match the pull of
1439			 * the Bluetooth module.
1440			 */
1441			pins = "gpio38";
1442			bias-pull-down;
1443		};
1444
1445		pinconf-rts {
1446			/*
1447			 * Configure pull-down on RTS. As RTS is active low
1448			 * signal, pull it low to indicate the BT SoC that it
1449			 * can wakeup the system anytime from suspend state by
1450			 * pulling RX low (by sending wakeup bytes).
1451			 */
1452			 pins = "gpio39";
1453			 bias-pull-down;
1454		};
1455
1456		pinconf-tx {
1457			/*
1458			 * Configure pull-up on TX when it isn't actively driven
1459			 * to prevent BT SoC from receiving garbage during sleep.
1460			 */
1461			pins = "gpio40";
1462			bias-pull-up;
1463		};
1464
1465		pinconf-rx {
1466			/*
1467			 * Configure a pull-up on RX. This is needed to avoid
1468			 * garbage data when the TX pin of the Bluetooth module
1469			 * is floating which may cause spurious wakeups.
1470			 */
1471			pins = "gpio41";
1472			bias-pull-up;
1473		};
1474	};
1475
1476	/* Named trackpad_int_1v8_odl on earlier revision schematics */
1477	trackpad_int_1v8_odl:
1478	tp_int_odl: tp-int-odl {
1479		pinmux {
1480			pins = "gpio0";
1481			function = "gpio";
1482		};
1483
1484		pinconf {
1485			pins = "gpio0";
1486
1487			/* Has external pullup */
1488			bias-disable;
1489		};
1490	};
1491
1492	ts_int_l: ts-int-l {
1493		pinmux  {
1494			pins = "gpio9";
1495			function = "gpio";
1496		};
1497
1498		pinconf {
1499			pins = "gpio9";
1500			bias-pull-up;
1501		};
1502	};
1503
1504	ts_reset_l: ts-reset-l {
1505		pinmux  {
1506			pins = "gpio8";
1507			function = "gpio";
1508		};
1509
1510		pinconf {
1511			pins = "gpio8";
1512			bias-disable;
1513			drive-strength = <2>;
1514		};
1515	};
1516
1517	sdc1_on: sdc1-on {
1518		pinconf-clk {
1519			pins = "sdc1_clk";
1520			bias-disable;
1521			drive-strength = <16>;
1522		};
1523
1524		pinconf-cmd {
1525			pins = "sdc1_cmd";
1526			bias-pull-up;
1527			drive-strength = <16>;
1528		};
1529
1530		pinconf-data {
1531			pins = "sdc1_data";
1532			bias-pull-up;
1533			drive-strength = <16>;
1534		};
1535
1536		pinconf-rclk {
1537			pins = "sdc1_rclk";
1538			bias-pull-down;
1539		};
1540	};
1541
1542	sdc1_off: sdc1-off {
1543		pinconf-clk {
1544			pins = "sdc1_clk";
1545			bias-disable;
1546			drive-strength = <2>;
1547		};
1548
1549		pinconf-cmd {
1550			pins = "sdc1_cmd";
1551			bias-pull-up;
1552			drive-strength = <2>;
1553		};
1554
1555		pinconf-data {
1556			pins = "sdc1_data";
1557			bias-pull-up;
1558			drive-strength = <2>;
1559		};
1560
1561		pinconf-rclk {
1562			pins = "sdc1_rclk";
1563			bias-pull-down;
1564		};
1565	};
1566
1567	sdc2_on: sdc2-on {
1568		pinconf-clk {
1569			pins = "sdc2_clk";
1570			bias-disable;
1571			drive-strength = <16>;
1572		};
1573
1574		pinconf-cmd {
1575			pins = "sdc2_cmd";
1576			bias-pull-up;
1577			drive-strength = <10>;
1578		};
1579
1580		pinconf-data {
1581			pins = "sdc2_data";
1582			bias-pull-up;
1583			drive-strength = <10>;
1584		};
1585
1586		pinconf-sd-cd {
1587			pins = "gpio69";
1588			bias-pull-up;
1589			drive-strength = <2>;
1590		};
1591	};
1592
1593	sdc2_off: sdc2-off {
1594		pinconf-clk {
1595			pins = "sdc2_clk";
1596			bias-disable;
1597			drive-strength = <2>;
1598		};
1599
1600		pinconf-cmd {
1601			pins = "sdc2_cmd";
1602			bias-pull-up;
1603			drive-strength = <2>;
1604		};
1605
1606		pinconf-data {
1607			pins = "sdc2_data";
1608			bias-pull-up;
1609			drive-strength = <2>;
1610		};
1611
1612		pinconf-sd-cd {
1613			pins = "gpio69";
1614			bias-pull-up;
1615			drive-strength = <2>;
1616		};
1617	};
1618
1619	uf_cam_en: uf-cam-en {
1620		pinmux {
1621			pins = "gpio6";
1622			function = "gpio";
1623		};
1624
1625		pinconf {
1626			pins = "gpio6";
1627			drive-strength = <2>;
1628			/* External pull down */
1629			bias-disable;
1630		};
1631	};
1632
1633	wf_cam_en: wf-cam-en {
1634		pinmux {
1635			pins = "gpio7";
1636			function = "gpio";
1637		};
1638
1639		pinconf {
1640			pins = "gpio7";
1641			drive-strength = <2>;
1642			/* External pull down */
1643			bias-disable;
1644		};
1645	};
1646};
1647