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/* PMICs depend on spmi_bus label and so must come after SoC */
15#include "pm6150.dtsi"
16#include "pm6150l.dtsi"
17
18/ {
19	thermal-zones {
20		charger_thermal: charger-thermal {
21			polling-delay-passive = <0>;
22			polling-delay = <0>;
23
24			thermal-sensors = <&pm6150_adc_tm 0>;
25
26			trips {
27				charger-crit {
28					temperature = <125000>;
29					hysteresis = <1000>;
30					type = "critical";
31				};
32			};
33		};
34	};
35};
36
37/*
38 * Reserved memory changes
39 *
40 * Delete all unused memory nodes and define the peripheral memory regions
41 * required by the board dts.
42 */
43
44/delete-node/ &hyp_mem;
45/delete-node/ &xbl_mem;
46/delete-node/ &aop_mem;
47/delete-node/ &sec_apps_mem;
48/delete-node/ &tz_mem;
49
50/* Increase the size from 2MB to 8MB */
51&rmtfs_mem {
52	reg = <0x0 0x94600000 0x0 0x800000>;
53};
54
55/ {
56	reserved-memory {
57		atf_mem: memory@80b00000 {
58			reg = <0x0 0x80b00000 0x0 0x100000>;
59			no-map;
60		};
61
62		mpss_mem: memory@86000000 {
63			reg = <0x0 0x86000000 0x0 0x2000000>;
64			no-map;
65		};
66
67		venus_mem: memory@8f600000 {
68			reg = <0 0x8f600000 0 0x500000>;
69			no-map;
70		};
71
72		wlan_mem: memory@94100000 {
73			reg = <0x0 0x94100000 0x0 0x200000>;
74			no-map;
75		};
76
77		mba_mem: memory@94400000 {
78			reg = <0x0 0x94400000 0x0 0x200000>;
79			no-map;
80		};
81	};
82
83	aliases {
84		bluetooth0 = &bluetooth;
85		hsuart0 = &uart3;
86		serial0 = &uart8;
87		wifi0 = &wifi;
88	};
89
90	chosen {
91		stdout-path = "serial0:115200n8";
92	};
93
94	/* FIXED REGULATORS - parents above children */
95
96	/* This is the top level supply and variable voltage */
97	ppvar_sys: ppvar-sys-regulator {
98		compatible = "regulator-fixed";
99		regulator-name = "ppvar_sys";
100		regulator-always-on;
101		regulator-boot-on;
102	};
103
104	/* This divides ppvar_sys by 2, so voltage is variable */
105	src_vph_pwr: src-vph-pwr-regulator {
106		compatible = "regulator-fixed";
107		regulator-name = "src_vph_pwr";
108
109		/* EC turns on with switchcap_on; always on for AP */
110		regulator-always-on;
111		regulator-boot-on;
112
113		vin-supply = <&ppvar_sys>;
114	};
115
116	pp5000_a: pp5000-a-regulator {
117		compatible = "regulator-fixed";
118		regulator-name = "pp5000_a";
119
120		/* EC turns on with en_pp5000_a; always on for AP */
121		regulator-always-on;
122		regulator-boot-on;
123		regulator-min-microvolt = <5000000>;
124		regulator-max-microvolt = <5000000>;
125
126		vin-supply = <&ppvar_sys>;
127	};
128
129	pp3300_a: pp3300-a-regulator {
130		compatible = "regulator-fixed";
131		regulator-name = "pp3300_a";
132
133		/* EC turns on with en_pp3300_a; always on for AP */
134		regulator-always-on;
135		regulator-boot-on;
136		regulator-min-microvolt = <3300000>;
137		regulator-max-microvolt = <3300000>;
138
139		/*
140		 * Actually should be pp3300 but that's practically an alias for
141		 * pp3300_a so we use pp3300's vin-supply here to avoid one more
142		 * node.
143		 */
144		vin-supply = <&ppvar_sys>;
145	};
146
147	pp1800_ec:
148	pp1800_sensors:
149	pp1800_ldo: pp1800-ldo-regulator {
150		compatible = "regulator-fixed";
151		regulator-name = "pp1800_ldo";
152
153		/* EC turns on with hibernate_l; always on for AP */
154		regulator-always-on;
155		regulator-boot-on;
156		regulator-min-microvolt = <1800000>;
157		regulator-max-microvolt = <1800000>;
158
159		/*
160		 * Actually should be pp1800_h1 but we don't have any need to
161		 * model that so we use the parent of pp1800_h1.
162		 */
163		vin-supply = <&pp3300_a>;
164	};
165
166	pp1800_uf_cam: pp1800-uf-cam-regulator {
167		compatible = "regulator-fixed";
168		regulator-name = "pp1800_uf_cam";
169		status = "disabled";
170
171		regulator-min-microvolt = <1800000>;
172		regulator-max-microvolt = <1800000>;
173
174		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
175		enable-active-high;
176		pinctrl-names = "default";
177		pinctrl-0 = <&uf_cam_en>;
178
179		vin-supply = <&pp1800_ldo>;
180		regulator-enable-ramp-delay = <1000>;
181	};
182
183	pp1800_wf_cam: pp1800-wf-cam-regulator {
184		compatible = "regulator-fixed";
185		regulator-name = "pp1800_wf_cam";
186		status = "disabled";
187
188		regulator-min-microvolt = <1800000>;
189		regulator-max-microvolt = <1800000>;
190
191		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
192		enable-active-high;
193		pinctrl-names = "default";
194		pinctrl-0 = <&wf_cam_en>;
195
196		vin-supply = <&pp1800_ldo>;
197		regulator-enable-ramp-delay = <1000>;
198	};
199
200	pp2800_uf_cam: pp2800-uf-cam-regulator {
201		compatible = "regulator-fixed";
202		regulator-name = "pp2800_uf_cam";
203		status = "disabled";
204
205		regulator-min-microvolt = <2850000>;
206		regulator-max-microvolt = <2850000>;
207
208		gpio = <&tlmm 6 GPIO_ACTIVE_HIGH>;
209		enable-active-high;
210		/*
211		 * The pinconf can only be referenced once so we put it on the
212		 * first regulator and comment it out here.
213		 * pinctrl-names = "default";
214		 * pinctrl-0 = <&uf_cam_en>;
215		 */
216
217		vin-supply = <&pp3300_a>;
218	};
219
220	pp2800_vcm_wf_cam:
221	pp2800_wf_cam: pp2800-wf-cam-regulator {
222		compatible = "regulator-fixed";
223		regulator-name = "pp2800_wf_cam";
224		status = "disabled";
225
226		regulator-min-microvolt = <2850000>;
227		regulator-max-microvolt = <2850000>;
228
229		gpio = <&tlmm 7 GPIO_ACTIVE_HIGH>;
230		enable-active-high;
231		/*
232		 * The pinconf can only be referenced once so we put it on the
233		 * first regulator and comment it out here.
234		 * pinctrl-names = "default";
235		 * pinctrl-0 = <&wf_cam_en>;
236		 */
237
238		vin-supply = <&pp3300_a>;
239	};
240
241	pp3300_audio:
242	pp3300_codec: pp3300-codec-regulator {
243		compatible = "regulator-fixed";
244		regulator-name = "pp3300_codec";
245
246		regulator-min-microvolt = <3300000>;
247		regulator-max-microvolt = <3300000>;
248
249		gpio = <&tlmm 83 GPIO_ACTIVE_HIGH>;
250		enable-active-high;
251		pinctrl-names = "default";
252		pinctrl-0 = <&en_pp3300_codec>;
253
254		vin-supply = <&pp3300_a>;
255	};
256
257	pp3300_dx_edp:
258	pp3300_ts: pp3300-dx-edp-regulator {
259		compatible = "regulator-fixed";
260		regulator-name = "pp3300_dx_edp";
261
262		regulator-min-microvolt = <3300000>;
263		regulator-max-microvolt = <3300000>;
264
265		gpio = <&tlmm 30 GPIO_ACTIVE_HIGH>;
266		enable-active-high;
267		pinctrl-names = "default";
268		pinctrl-0 = <&en_pp3300_dx_edp>;
269
270		vin-supply = <&pp3300_a>;
271	};
272
273	pp3300_fp_tp: pp3300-fp-tp-regulator {
274		compatible = "regulator-fixed";
275		regulator-name = "pp3300_fp_tp";
276
277		regulator-min-microvolt = <3300000>;
278		regulator-max-microvolt = <3300000>;
279
280		/* AP turns on with PP1800_VIO_OUT; always on for AP */
281		regulator-always-on;
282		regulator-boot-on;
283
284		vin-supply = <&pp3300_a>;
285	};
286
287	pp3300_hub: pp3300-hub-regulator {
288		compatible = "regulator-fixed";
289		regulator-name = "pp3300_hub";
290
291		regulator-min-microvolt = <3300000>;
292		regulator-max-microvolt = <3300000>;
293
294		gpio = <&tlmm 84 GPIO_ACTIVE_HIGH>;
295		enable-active-high;
296		pinctrl-names = "default";
297		pinctrl-0 = <&en_pp3300_hub>;
298
299		regulator-always-on;
300		regulator-boot-on;
301
302		vin-supply = <&pp3300_a>;
303	};
304
305	/* BOARD-SPECIFIC TOP LEVEL NODES */
306
307	backlight: backlight {
308		compatible = "pwm-backlight";
309
310		/* The panels don't seem to like anything below ~ 5% */
311		brightness-levels = <
312			196 256 324 400 484 576 676 784 900 1024 1156 1296
313			1444 1600 1764 1936 2116 2304 2500 2704 2916 3136
314			3364 3600 3844 4096
315		>;
316		num-interpolated-steps = <64>;
317		default-brightness-level = <951>;
318
319		pwms = <&cros_ec_pwm 1>;
320		enable-gpios = <&tlmm 12 GPIO_ACTIVE_HIGH>;
321		power-supply = <&ppvar_sys>;
322		pinctrl-names = "default";
323		pinctrl-0 = <&ap_edp_bklten>;
324	};
325
326	gpio_keys: gpio-keys {
327		compatible = "gpio-keys";
328		status = "disabled";
329		pinctrl-names = "default";
330		pinctrl-0 = <&pen_pdct_l>;
331
332		pen_insert: pen-insert {
333			label = "Pen Insert";
334
335			/* Insert = low, eject = high */
336			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
337			linux,code = <SW_PEN_INSERTED>;
338			linux,input-type = <EV_SW>;
339			wakeup-event-action = <EV_ACT_DEASSERTED>;
340			wakeup-source;
341		};
342	};
343
344	max98360a: audio-codec-0 {
345		compatible = "maxim,max98360a";
346		pinctrl-names = "default";
347		pinctrl-0 = <&amp_en>;
348		sdmode-gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
349		#sound-dai-cells = <0>;
350	};
351
352	pwmleds {
353		compatible = "pwm-leds";
354		keyboard_backlight: keyboard-backlight {
355			status = "disabled";
356			label = "cros_ec::kbd_backlight";
357			pwms = <&cros_ec_pwm 0>;
358			max-brightness = <1023>;
359		};
360	};
361
362	sound: sound {
363		compatible = "google,sc7180-trogdor";
364		model = "sc7180-rt5682-max98357a-1mic";
365
366		audio-routing =
367			"Headphone Jack", "HPOL",
368			"Headphone Jack", "HPOR";
369
370		#address-cells = <1>;
371		#size-cells = <0>;
372
373		dai-link@0 {
374			link-name = "MultiMedia0";
375			reg = <MI2S_PRIMARY>;
376			cpu {
377				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
378			};
379
380			sound_multimedia0_codec: codec {
381				sound-dai = <&alc5682 0 /* aif1 */>;
382			};
383		};
384
385		dai-link@1 {
386			link-name = "MultiMedia1";
387			reg = <MI2S_SECONDARY>;
388			cpu {
389				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
390			};
391
392			sound_multimedia1_codec: codec {
393				sound-dai = <&max98360a>;
394			};
395		};
396
397		dai-link@5 {
398			link-name = "MultiMedia2";
399			reg = <LPASS_DP_RX>;
400			cpu {
401				sound-dai = <&lpass_cpu LPASS_DP_RX>;
402			};
403
404			codec {
405				sound-dai = <&mdss_dp>;
406			};
407		};
408	};
409};
410
411&qfprom {
412	vcc-supply = <&pp1800_l11a>;
413};
414
415&qspi {
416	status = "okay";
417	pinctrl-names = "default";
418	pinctrl-0 = <&qspi_clk>, <&qspi_cs0>, <&qspi_data01>;
419
420	flash@0 {
421		compatible = "jedec,spi-nor";
422		reg = <0>;
423
424		spi-max-frequency = <37500000>;
425		spi-tx-bus-width = <2>;
426		spi-rx-bus-width = <2>;
427	};
428};
429
430&apps_rsc {
431	pm6150-rpmh-regulators {
432		compatible = "qcom,pm6150-rpmh-regulators";
433		qcom,pmic-id = "a";
434
435		vddpx_1:
436		vdd2:
437		pp1125_s1a: smps1 {
438			regulator-min-microvolt = <1128000>;
439			regulator-max-microvolt = <1128000>;
440		};
441
442		vdd_qlink_lv:
443		vdd_qlink_lv_ck:
444		vdd_qusb_hs0_core:
445		vdd_ufs1_core:
446		vdda_mipi_csi0_0p9:
447		vdda_mipi_csi1_0p9:
448		vdda_mipi_csi2_0p9:
449		vdda_mipi_csi3_0p9:
450		vdda_mipi_dsi0_pll:
451		vdda_pll_cc_ebi01:
452		vdda_qrefs_0p9:
453		vdda_usb_ss_dp_core:
454		pp900_l4a: ldo4 {
455			regulator-min-microvolt = <824000>;
456			regulator-max-microvolt = <928000>;
457			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
458		};
459
460		vdd_cx_wlan:
461		pp800_l9a: ldo9 {
462			regulator-min-microvolt = <488000>;
463			regulator-max-microvolt = <800000>;
464			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
465		};
466
467		vdd1:
468		vddpx_3:
469		vddpx_7:
470		vio_in:
471		pp1800_l10a: ldo10 {
472			regulator-min-microvolt = <1800000>;
473			regulator-max-microvolt = <1800000>;
474			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
475		};
476
477		vdd_qfprom:
478		vdda_apc1_cs_1p8:
479		vdda_qrefs_1p8:
480		vdda_qusb_hs0_1p8:
481		vddpx_11:
482		vreg_bb_clk:
483		pp1800_l11a: ldo11 {
484			regulator-min-microvolt = <1800000>;
485			regulator-max-microvolt = <1800000>;
486			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
487		};
488
489		mcp_vccq:
490		pp1800_l12a_r: ldo12 {
491			regulator-min-microvolt = <1800000>;
492			regulator-max-microvolt = <1800000>;
493			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
494		};
495
496		/*
497		 * On trogdor this needs to match l10a since we use it to
498		 * give power to things like SPI flash which communicate back
499		 * on lines powered by l10a.  Thus we force to 1.8V.
500		 */
501		pp1800_l13a: ldo13 {
502			regulator-min-microvolt = <1800000>;
503			regulator-max-microvolt = <1800000>;
504			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
505		};
506
507		pp1800_prox:
508		pp1800_l14a: ldo14 {
509			regulator-min-microvolt = <1800000>;
510			regulator-max-microvolt = <1800000>;
511			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
512		};
513
514		pp1800_alc5682:
515		pp1800_l15a: ldo15 {
516			regulator-min-microvolt = <1800000>;
517			regulator-max-microvolt = <1800000>;
518			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
519		};
520
521		vdda_qusb_hs0_3p1:
522		vdd_pdphy:
523		pp3100_l17a: ldo17 {
524			regulator-min-microvolt = <2920000>;
525			regulator-max-microvolt = <3232000>;
526			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
527		};
528
529		pp1800_pen:
530		pp1800_l18a: ldo18 {
531			regulator-min-microvolt = <1800000>;
532			regulator-max-microvolt = <1800000>;
533			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
534		};
535
536		mcp_vcc:
537		pp2850_l19a: ldo19 {
538			regulator-min-microvolt = <2960000>;
539			regulator-max-microvolt = <2960000>;
540			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
541		};
542	};
543
544	pm6150l-rpmh-regulators {
545		compatible = "qcom,pm6150l-rpmh-regulators";
546		qcom,pmic-id = "c";
547
548		pp1300_s8c: smps8 {
549			regulator-min-microvolt = <1120000>;
550			regulator-max-microvolt = <1408000>;
551		};
552
553		pp1800_l1c: ldo1 {
554			regulator-min-microvolt = <1616000>;
555			regulator-max-microvolt = <1984000>;
556			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
557		};
558
559		vdd_wcss_adc_dac:
560		pp1300_l2c: ldo2 {
561			regulator-min-microvolt = <1168000>;
562			regulator-max-microvolt = <1304000>;
563			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
564		};
565
566		pp1200_brij:
567		vdd_ufs1_1p2:
568		vdda_csi0_1p25:
569		vdda_csi1_1p25:
570		vdda_csi2_1p25:
571		vdda_csi3_1p25:
572		vdda_hv_ebi0:
573		vdda_mipi_dsi0_1p2:
574		vdda_usb_ss_dp_1p2:
575		vddpx_10:
576		pp1200_l3c: ldo3 {
577			regulator-min-microvolt = <1200000>;
578			regulator-max-microvolt = <1200000>;
579			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
580		};
581
582		vddpx_2:
583		ppvar_l6c: ldo6 {
584			regulator-min-microvolt = <1800000>;
585			regulator-max-microvolt = <2952000>;
586			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
587		};
588
589		pp3300_l7c: ldo7 {
590			regulator-min-microvolt = <3304000>;
591			regulator-max-microvolt = <3304000>;
592			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
593		};
594
595		pp1800_brij_vccio:
596		pp1800_edp_vpll:
597		pp1800_l8c: ldo8 {
598			regulator-min-microvolt = <1800000>;
599			regulator-max-microvolt = <1800000>;
600			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
601		};
602
603		pp2950_l9c: ldo9 {
604			regulator-min-microvolt = <2952000>;
605			regulator-max-microvolt = <2952000>;
606			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
607		};
608
609		pp3300_l10c: ldo10 {
610			regulator-min-microvolt = <3000000>;
611			regulator-max-microvolt = <3400000>;
612			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
613		};
614
615		pp3300_l11c: ldo11 {
616			regulator-min-microvolt = <3000000>;
617			regulator-max-microvolt = <3400000>;
618			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
619		};
620
621		src_vreg_bob: bob {
622			regulator-min-microvolt = <3008000>;
623			regulator-max-microvolt = <3960000>;
624			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
625		};
626	};
627};
628
629&ap_ec_spi {
630	status = "okay";
631	cros_ec: ec@0 {
632		compatible = "google,cros-ec-spi";
633		reg = <0>;
634		interrupt-parent = <&tlmm>;
635		interrupts = <94 IRQ_TYPE_LEVEL_LOW>;
636		pinctrl-names = "default";
637		pinctrl-0 = <&ap_ec_int_l>;
638		spi-max-frequency = <3000000>;
639
640		cros_ec_pwm: pwm {
641			compatible = "google,cros-ec-pwm";
642			#pwm-cells = <1>;
643		};
644
645		i2c_tunnel: i2c-tunnel {
646			compatible = "google,cros-ec-i2c-tunnel";
647			google,remote-bus = <0>;
648			#address-cells = <1>;
649			#size-cells = <0>;
650		};
651
652		typec {
653			compatible = "google,cros-ec-typec";
654			#address-cells = <1>;
655			#size-cells = <0>;
656
657			usb_c0: connector@0 {
658				compatible = "usb-c-connector";
659				reg = <0>;
660				label = "left";
661				power-role = "dual";
662				data-role = "host";
663				try-power-role = "source";
664			};
665
666			usb_c1: connector@1 {
667				compatible = "usb-c-connector";
668				reg = <1>;
669				label = "right";
670				power-role = "dual";
671				data-role = "host";
672				try-power-role = "source";
673			};
674		};
675	};
676};
677
678&ap_h1_spi {
679	status = "okay";
680	cr50: tpm@0 {
681		compatible = "google,cr50";
682		reg = <0>;
683		pinctrl-names = "default";
684		pinctrl-0 = <&h1_ap_int_odl>;
685		spi-max-frequency = <800000>;
686		interrupt-parent = <&tlmm>;
687		interrupts = <42 IRQ_TYPE_EDGE_RISING>;
688	};
689};
690
691&camcc {
692	status = "disabled";
693};
694
695&dsi0 {
696	status = "okay";
697	vdda-supply = <&vdda_mipi_dsi0_1p2>;
698};
699
700&dsi0_out {
701	data-lanes = <0 1 2 3>;
702};
703
704&dsi_phy {
705	status = "okay";
706	vdds-supply = <&vdda_mipi_dsi0_pll>;
707};
708
709ap_sar_sensor_i2c: &i2c5 {
710	clock-frequency = <400000>;
711
712	ap_sar_sensor: proximity@28 {
713		compatible = "semtech,sx9310";
714		reg = <0x28>;
715		#io-channel-cells = <1>;
716		pinctrl-names = "default";
717		pinctrl-0 = <&p_sensor_int_l>;
718
719		interrupt-parent = <&tlmm>;
720		interrupts = <24 IRQ_TYPE_LEVEL_LOW>;
721
722		vdd-supply = <&pp3300_a>;
723		svdd-supply = <&pp1800_prox>;
724
725		status = "disabled";
726		label = "proximity-wifi";
727	};
728};
729
730ap_tp_i2c: &i2c7 {
731	status = "okay";
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