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