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