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