xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/sc8280xp-lenovo-thinkpad-x13s.dts (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
4 * Copyright (c) 2022, Linaro Limited
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/iio/qcom,spmi-adc7-pm8350.h>
11#include <dt-bindings/iio/qcom,spmi-adc7-pmk8350.h>
12#include <dt-bindings/iio/qcom,spmi-adc7-pmr735a.h>
13#include <dt-bindings/input/gpio-keys.h>
14#include <dt-bindings/input/input.h>
15#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
16
17#include "sc8280xp.dtsi"
18#include "sc8280xp-pmics.dtsi"
19
20/ {
21	model = "Lenovo ThinkPad X13s";
22	compatible = "lenovo,thinkpad-x13s", "qcom,sc8280xp";
23
24	aliases {
25		i2c4 = &i2c4;
26		i2c21 = &i2c21;
27		serial1 = &uart2;
28	};
29
30	wcd938x: audio-codec {
31		compatible = "qcom,wcd9380-codec";
32
33		pinctrl-names = "default";
34		pinctrl-0 = <&wcd_default>;
35
36		reset-gpios = <&tlmm 106 GPIO_ACTIVE_LOW>;
37
38		vdd-buck-supply = <&vreg_s10b>;
39		vdd-rxtx-supply = <&vreg_s10b>;
40		vdd-io-supply = <&vreg_s10b>;
41		vdd-mic-bias-supply = <&vreg_bob>;
42
43		qcom,micbias1-microvolt = <1800000>;
44		qcom,micbias2-microvolt = <1800000>;
45		qcom,micbias3-microvolt = <1800000>;
46		qcom,micbias4-microvolt = <1800000>;
47		qcom,mbhc-buttons-vthreshold-microvolt = <75000 150000 237000 500000 500000 500000 500000 500000>;
48		qcom,mbhc-headset-vthreshold-microvolt = <1700000>;
49		qcom,mbhc-headphone-vthreshold-microvolt = <50000>;
50		qcom,rx-device = <&wcd_rx>;
51		qcom,tx-device = <&wcd_tx>;
52
53		#sound-dai-cells = <1>;
54	};
55
56	backlight: backlight {
57		compatible = "pwm-backlight";
58		pwms = <&pmc8280c_lpg 3 1000000>;
59		enable-gpios = <&pmc8280_1_gpios 8 GPIO_ACTIVE_HIGH>;
60		power-supply = <&vreg_edp_bl>;
61
62		pinctrl-names = "default";
63		pinctrl-0 = <&edp_bl_en>, <&edp_bl_pwm>;
64	};
65
66	gpio-keys {
67		compatible = "gpio-keys";
68
69		pinctrl-names = "default";
70		pinctrl-0 = <&hall_int_n_default>;
71
72		switch-lid {
73			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
74			linux,input-type = <EV_SW>;
75			linux,code = <SW_LID>;
76			wakeup-source;
77			wakeup-event-action = <EV_ACT_DEASSERTED>;
78		};
79	};
80
81	pmic-glink {
82		compatible = "qcom,sc8280xp-pmic-glink", "qcom,pmic-glink";
83
84		#address-cells = <1>;
85		#size-cells = <0>;
86
87		connector@0 {
88			compatible = "usb-c-connector";
89			reg = <0>;
90			power-role = "dual";
91			data-role = "dual";
92
93			ports {
94				#address-cells = <1>;
95				#size-cells = <0>;
96
97				port@0 {
98					reg = <0>;
99
100					pmic_glink_con0_hs: endpoint {
101						remote-endpoint = <&usb_0_role_switch>;
102					};
103				};
104
105				port@1 {
106					reg = <1>;
107
108					pmic_glink_con0_ss: endpoint {
109						remote-endpoint = <&usb_0_qmpphy_out>;
110					};
111				};
112
113				port@2 {
114					reg = <2>;
115
116					pmic_glink_con0_sbu: endpoint {
117						remote-endpoint = <&usb0_sbu_mux>;
118					};
119				};
120			};
121		};
122
123		connector@1 {
124			compatible = "usb-c-connector";
125			reg = <1>;
126			power-role = "dual";
127			data-role = "dual";
128
129			ports {
130				#address-cells = <1>;
131				#size-cells = <0>;
132				port@0 {
133					reg = <0>;
134
135					pmic_glink_con1_hs: endpoint {
136						remote-endpoint = <&usb_1_role_switch>;
137					};
138				};
139
140				port@1 {
141					reg = <1>;
142
143					pmic_glink_con1_ss: endpoint {
144						remote-endpoint = <&usb_1_qmpphy_out>;
145					};
146				};
147
148				port@2 {
149					reg = <2>;
150
151					pmic_glink_con1_sbu: endpoint {
152						remote-endpoint = <&usb1_sbu_mux>;
153					};
154				};
155			};
156		};
157	};
158
159	vreg_edp_3p3: regulator-edp-3p3 {
160		compatible = "regulator-fixed";
161
162		regulator-name = "VCC3LCD";
163		regulator-min-microvolt = <3300000>;
164		regulator-max-microvolt = <3300000>;
165
166		gpio = <&tlmm 25 GPIO_ACTIVE_HIGH>;
167		enable-active-high;
168
169		pinctrl-names = "default";
170		pinctrl-0 = <&edp_reg_en>;
171
172		regulator-boot-on;
173	};
174
175	vreg_edp_bl: regulator-edp-bl {
176		compatible = "regulator-fixed";
177
178		regulator-name = "VBL9";
179		regulator-min-microvolt = <3600000>;
180		regulator-max-microvolt = <3600000>;
181
182		gpio = <&pmc8280_1_gpios 9 GPIO_ACTIVE_HIGH>;
183		enable-active-high;
184
185		pinctrl-names = "default";
186		pinctrl-0 = <&edp_bl_reg_en>;
187
188		regulator-boot-on;
189	};
190
191	vreg_misc_3p3: regulator-misc-3p3 {
192		compatible = "regulator-fixed";
193
194		regulator-name = "VCC3B";
195		regulator-min-microvolt = <3300000>;
196		regulator-max-microvolt = <3300000>;
197
198		gpio = <&pmc8280_1_gpios 1 GPIO_ACTIVE_HIGH>;
199		enable-active-high;
200
201		pinctrl-names = "default";
202		pinctrl-0 = <&misc_3p3_reg_en>;
203
204		regulator-boot-on;
205		regulator-always-on;
206	};
207
208	vreg_nvme: regulator-nvme {
209		compatible = "regulator-fixed";
210
211		regulator-name = "VCC3_SSD";
212		regulator-min-microvolt = <3300000>;
213		regulator-max-microvolt = <3300000>;
214
215		gpio = <&tlmm 135 GPIO_ACTIVE_HIGH>;
216		enable-active-high;
217
218		pinctrl-names = "default";
219		pinctrl-0 = <&nvme_reg_en>;
220
221		regulator-boot-on;
222	};
223
224	vreg_vph_pwr: regulator-vph-pwr {
225		compatible = "regulator-fixed";
226
227		regulator-name = "VPH_VCC3R9";
228		regulator-min-microvolt = <3900000>;
229		regulator-max-microvolt = <3900000>;
230
231		regulator-always-on;
232	};
233
234	vreg_wlan: regulator-wlan {
235		compatible = "regulator-fixed";
236
237		regulator-name = "VCC_WLAN_3R9";
238		regulator-min-microvolt = <3900000>;
239		regulator-max-microvolt = <3900000>;
240
241		gpio = <&pmr735a_gpios 1 GPIO_ACTIVE_HIGH>;
242		enable-active-high;
243
244		pinctrl-names = "default";
245		pinctrl-0 = <&hastings_reg_en>;
246
247		regulator-boot-on;
248	};
249
250	vreg_wwan: regulator-wwan {
251		compatible = "regulator-fixed";
252
253		regulator-name = "VCC3B_WAN";
254		regulator-min-microvolt = <3300000>;
255		regulator-max-microvolt = <3300000>;
256
257		gpio = <&pmc8280_2_gpios 1 GPIO_ACTIVE_HIGH>;
258		enable-active-high;
259
260		pinctrl-names = "default";
261		pinctrl-0 = <&wwan_sw_en>;
262
263		regulator-boot-on;
264	};
265
266	reserved-memory {
267		gpu_mem: gpu-mem@8bf00000 {
268			reg = <0 0x8bf00000 0 0x2000>;
269			no-map;
270		};
271
272		linux,cma {
273			compatible = "shared-dma-pool";
274			size = <0x0 0x8000000>;
275			reusable;
276			linux,cma-default;
277		};
278	};
279
280	thermal-zones {
281		skin-temp-thermal {
282			polling-delay-passive = <250>;
283			polling-delay = <0>;
284			thermal-sensors = <&pmk8280_adc_tm 5>;
285
286			trips {
287				skin_temp_alert0: trip-point0 {
288					temperature = <55000>;
289					hysteresis = <1000>;
290					type = "passive";
291				};
292
293				skin_temp_alert1: trip-point1 {
294					temperature = <58000>;
295					hysteresis = <1000>;
296					type = "passive";
297				};
298
299				skin-temp-crit {
300					temperature = <73000>;
301					hysteresis = <1000>;
302					type = "critical";
303				};
304			};
305
306			cooling-maps {
307				map0 {
308					trip = <&skin_temp_alert0>;
309					cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
310							 <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
311							 <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
312							 <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
313				};
314
315				map1 {
316					trip = <&skin_temp_alert1>;
317					cooling-device = <&CPU4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
318							 <&CPU5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
319							 <&CPU6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
320							 <&CPU7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
321				};
322			};
323		};
324	};
325
326	usb0-sbu-mux {
327		compatible = "pericom,pi3usb102", "gpio-sbu-mux";
328
329		enable-gpios = <&tlmm 101 GPIO_ACTIVE_LOW>;
330		select-gpios = <&tlmm 164 GPIO_ACTIVE_HIGH>;
331
332		pinctrl-names = "default";
333		pinctrl-0 = <&usb0_sbu_default>;
334
335		mode-switch;
336		orientation-switch;
337		svid = /bits/ 16 <0xff01>;
338
339		port {
340			usb0_sbu_mux: endpoint {
341				remote-endpoint = <&pmic_glink_con0_sbu>;
342			};
343		};
344	};
345
346	usb1-sbu-mux {
347		compatible = "pericom,pi3usb102", "gpio-sbu-mux";
348
349		enable-gpios = <&tlmm 48 GPIO_ACTIVE_LOW>;
350		select-gpios = <&tlmm 47 GPIO_ACTIVE_HIGH>;
351
352		pinctrl-names = "default";
353		pinctrl-0 = <&usb1_sbu_default>;
354
355		mode-switch;
356		orientation-switch;
357		svid = /bits/ 16 <0xff01>;
358
359		port {
360			usb1_sbu_mux: endpoint {
361				remote-endpoint = <&pmic_glink_con1_sbu>;
362			};
363		};
364	};
365};
366
367&apps_rsc {
368	regulators-0 {
369		compatible = "qcom,pm8350-rpmh-regulators";
370		qcom,pmic-id = "b";
371
372		vdd-l1-l4-supply = <&vreg_s12b>;
373		vdd-l2-l7-supply = <&vreg_bob>;
374		vdd-l3-l5-supply = <&vreg_s11b>;
375		vdd-l6-l9-l10-supply = <&vreg_s12b>;
376		vdd-l8-supply = <&vreg_s12b>;
377
378		vreg_s10b: smps10 {
379			regulator-name = "vreg_s10b";
380			regulator-min-microvolt = <1800000>;
381			regulator-max-microvolt = <1800000>;
382			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
383			regulator-always-on;
384		};
385
386		vreg_s11b: smps11 {
387			regulator-name = "vreg_s11b";
388			regulator-min-microvolt = <1272000>;
389			regulator-max-microvolt = <1272000>;
390			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
391			regulator-always-on;
392		};
393
394		vreg_s12b: smps12 {
395			regulator-name = "vreg_s12b";
396			regulator-min-microvolt = <984000>;
397			regulator-max-microvolt = <984000>;
398			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
399			regulator-always-on;
400		};
401
402		vreg_l3b: ldo3 {
403			regulator-name = "vreg_l3b";
404			regulator-min-microvolt = <1200000>;
405			regulator-max-microvolt = <1200000>;
406			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
407			regulator-boot-on;
408		};
409
410		vreg_l4b: ldo4 {
411			regulator-name = "vreg_l4b";
412			regulator-min-microvolt = <912000>;
413			regulator-max-microvolt = <912000>;
414			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
415		};
416
417		vreg_l6b: ldo6 {
418			regulator-name = "vreg_l6b";
419			regulator-min-microvolt = <880000>;
420			regulator-max-microvolt = <880000>;
421			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
422			regulator-boot-on;
423		};
424	};
425
426	regulators-1 {
427		compatible = "qcom,pm8350c-rpmh-regulators";
428		qcom,pmic-id = "c";
429
430		vdd-bob-supply = <&vreg_vph_pwr>;
431		vdd-l1-l12-supply = <&vreg_s1c>;
432		vdd-l2-l8-supply = <&vreg_s1c>;
433		vdd-l3-l4-l5-l7-l13-supply = <&vreg_bob>;
434		vdd-l6-l9-l11-supply = <&vreg_bob>;
435		vdd-l10-supply = <&vreg_s11b>;
436
437		vreg_s1c: smps1 {
438			regulator-name = "vreg_s1c";
439			regulator-min-microvolt = <1880000>;
440			regulator-max-microvolt = <1900000>;
441			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
442			regulator-always-on;
443		};
444
445		vreg_l1c: ldo1 {
446			regulator-name = "vreg_l1c";
447			regulator-min-microvolt = <1800000>;
448			regulator-max-microvolt = <1800000>;
449			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
450		};
451
452		vreg_l12c: ldo12 {
453			regulator-name = "vreg_l12c";
454			regulator-min-microvolt = <1800000>;
455			regulator-max-microvolt = <1800000>;
456			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
457		};
458
459		vreg_l13c: ldo13 {
460			regulator-name = "vreg_l13c";
461			regulator-min-microvolt = <3072000>;
462			regulator-max-microvolt = <3072000>;
463			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
464		};
465
466		vreg_bob: bob {
467			regulator-name = "vreg_bob";
468			regulator-min-microvolt = <3008000>;
469			regulator-max-microvolt = <3960000>;
470			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
471			regulator-always-on;
472		};
473	};
474
475	regulators-2 {
476		compatible = "qcom,pm8350-rpmh-regulators";
477		qcom,pmic-id = "d";
478
479		vdd-l1-l4-supply = <&vreg_s11b>;
480		vdd-l2-l7-supply = <&vreg_bob>;
481		vdd-l3-l5-supply = <&vreg_s11b>;
482		vdd-l6-l9-l10-supply = <&vreg_s12b>;
483		vdd-l8-supply = <&vreg_s12b>;
484
485		vreg_l3d: ldo3 {
486			regulator-name = "vreg_l3d";
487			regulator-min-microvolt = <1200000>;
488			regulator-max-microvolt = <1200000>;
489			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
490		};
491
492		vreg_l4d: ldo4 {
493			regulator-name = "vreg_l4d";
494			regulator-min-microvolt = <1200000>;
495			regulator-max-microvolt = <1200000>;
496			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
497		};
498
499		vreg_l6d: ldo6 {
500			regulator-name = "vreg_l6d";
501			regulator-min-microvolt = <880000>;
502			regulator-max-microvolt = <880000>;
503			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
504		};
505
506		vreg_l7d: ldo7 {
507			regulator-name = "vreg_l7d";
508			regulator-min-microvolt = <3072000>;
509			regulator-max-microvolt = <3072000>;
510			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
511		};
512
513		vreg_l9d: ldo9 {
514			regulator-name = "vreg_l9d";
515			regulator-min-microvolt = <912000>;
516			regulator-max-microvolt = <912000>;
517			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
518		};
519	};
520};
521
522&dispcc0 {
523	status = "okay";
524};
525
526&gpu {
527	status = "okay";
528
529	zap-shader {
530		memory-region = <&gpu_mem>;
531		firmware-name = "qcom/sc8280xp/LENOVO/21BX/qcdxkmsuc8280.mbn";
532	};
533};
534
535&mdss0 {
536	status = "okay";
537};
538
539&mdss0_dp0 {
540	status = "okay";
541};
542
543&mdss0_dp0_out {
544	data-lanes = <0 1>;
545	remote-endpoint = <&usb_0_qmpphy_dp_in>;
546};
547
548&mdss0_dp1 {
549	status = "okay";
550};
551
552&mdss0_dp1_out {
553	data-lanes = <0 1>;
554	remote-endpoint = <&usb_1_qmpphy_dp_in>;
555};
556
557&mdss0_dp3 {
558	compatible = "qcom,sc8280xp-edp";
559
560	data-lanes = <0 1 2 3>;
561
562	status = "okay";
563
564	aux-bus {
565		panel {
566			compatible = "edp-panel";
567
568			backlight = <&backlight>;
569			power-supply = <&vreg_edp_3p3>;
570
571			port {
572				edp_panel_in: endpoint {
573					remote-endpoint = <&mdss0_dp3_out>;
574				};
575			};
576		};
577	};
578
579	ports {
580		port@1 {
581			reg = <1>;
582			mdss0_dp3_out: endpoint {
583				remote-endpoint = <&edp_panel_in>;
584			};
585		};
586	};
587};
588
589&mdss0_dp3_phy {
590	vdda-phy-supply = <&vreg_l6b>;
591	vdda-pll-supply = <&vreg_l3b>;
592
593	status = "okay";
594};
595
596&i2c4 {
597	clock-frequency = <400000>;
598
599	pinctrl-names = "default";
600	pinctrl-0 = <&i2c4_default>;
601
602	status = "okay";
603
604	/* FIXME: verify */
605	touchscreen@10 {
606		compatible = "hid-over-i2c";
607		reg = <0x10>;
608
609		hid-descr-addr = <0x1>;
610		interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>;
611		vdd-supply = <&vreg_misc_3p3>;
612		vddl-supply = <&vreg_s10b>;
613
614		pinctrl-names = "default";
615		pinctrl-0 = <&ts0_default>;
616	};
617};
618
619&i2c21 {
620	clock-frequency = <400000>;
621
622	pinctrl-names = "default";
623	pinctrl-0 = <&i2c21_default>, <&tpad_default>;
624
625	status = "okay";
626
627	touchpad@15 {
628		compatible = "hid-over-i2c";
629		reg = <0x15>;
630
631		hid-descr-addr = <0x1>;
632		interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
633		vdd-supply = <&vreg_misc_3p3>;
634		vddl-supply = <&vreg_s10b>;
635
636		wakeup-source;
637	};
638
639	touchpad@2c {
640		compatible = "hid-over-i2c";
641		reg = <0x2c>;
642
643		hid-descr-addr = <0x20>;
644		interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
645		vdd-supply = <&vreg_misc_3p3>;
646		vddl-supply = <&vreg_s10b>;
647
648		wakeup-source;
649	};
650
651	keyboard@68 {
652		compatible = "hid-over-i2c";
653		reg = <0x68>;
654
655		hid-descr-addr = <0x1>;
656		interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
657		vdd-supply = <&vreg_misc_3p3>;
658		vddl-supply = <&vreg_s10b>;
659
660		pinctrl-names = "default";
661		pinctrl-0 = <&kybd_default>;
662
663		wakeup-source;
664	};
665};
666
667&pcie2a {
668	perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
669	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
670
671	vddpe-3v3-supply = <&vreg_nvme>;
672
673	pinctrl-names = "default";
674	pinctrl-0 = <&pcie2a_default>;
675
676	status = "okay";
677};
678
679&pcie2a_phy {
680	vdda-phy-supply = <&vreg_l6d>;
681	vdda-pll-supply = <&vreg_l4d>;
682
683	status = "okay";
684};
685
686&pcie3a {
687	perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
688	wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
689
690	vddpe-3v3-supply = <&vreg_wwan>;
691
692	pinctrl-names = "default";
693	pinctrl-0 = <&pcie3a_default>;
694
695	status = "okay";
696};
697
698&pcie3a_phy {
699	vdda-phy-supply = <&vreg_l6d>;
700	vdda-pll-supply = <&vreg_l4d>;
701
702	status = "okay";
703};
704
705&pcie4 {
706	perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>;
707	wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>;
708
709	vddpe-3v3-supply = <&vreg_wlan>;
710
711	pinctrl-names = "default";
712	pinctrl-0 = <&pcie4_default>;
713
714	status = "okay";
715
716	pcie@0 {
717		device_type = "pci";
718		reg = <0x0 0x0 0x0 0x0 0x0>;
719		#address-cells = <3>;
720		#size-cells = <2>;
721		ranges;
722
723		bus-range = <0x01 0xff>;
724
725		wifi@0 {
726			compatible = "pci17cb,1103";
727			reg = <0x10000 0x0 0x0 0x0 0x0>;
728
729			qcom,ath11k-calibration-variant = "LE_X13S";
730		};
731	};
732};
733
734&pcie4_phy {
735	vdda-phy-supply = <&vreg_l6d>;
736	vdda-pll-supply = <&vreg_l4d>;
737
738	status = "okay";
739};
740
741&pmc8280c_lpg {
742	status = "okay";
743};
744
745&pmk8280_adc_tm {
746	status = "okay";
747
748	sys-therm@0 {
749		reg = <0>;
750		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
751		qcom,hw-settle-time-us = <200>;
752		qcom,avg-samples = <2>;
753		qcom,ratiometric;
754	};
755
756	sys-therm@1 {
757		reg = <1>;
758		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
759		qcom,hw-settle-time-us = <200>;
760		qcom,avg-samples = <2>;
761		qcom,ratiometric;
762	};
763
764	sys-therm@2 {
765		reg = <2>;
766		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
767		qcom,hw-settle-time-us = <200>;
768		qcom,avg-samples = <2>;
769		qcom,ratiometric;
770	};
771
772	sys-therm@3 {
773		reg = <3>;
774		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
775		qcom,hw-settle-time-us = <200>;
776		qcom,avg-samples = <2>;
777		qcom,ratiometric;
778	};
779
780	sys-therm@4 {
781		reg = <4>;
782		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
783		qcom,hw-settle-time-us = <200>;
784		qcom,avg-samples = <2>;
785		qcom,ratiometric;
786	};
787
788	sys-therm@5 {
789		reg = <5>;
790		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
791		qcom,hw-settle-time-us = <200>;
792		qcom,avg-samples = <2>;
793		qcom,ratiometric;
794	};
795
796	sys-therm@6 {
797		reg = <6>;
798		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
799		qcom,hw-settle-time-us = <200>;
800		qcom,avg-samples = <2>;
801		qcom,ratiometric;
802	};
803
804	sys-therm@7 {
805		reg = <7>;
806		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
807		qcom,hw-settle-time-us = <200>;
808		qcom,avg-samples = <2>;
809		qcom,ratiometric;
810	};
811};
812
813&pmk8280_pon_pwrkey {
814	status = "okay";
815};
816
817&pmk8280_pon_resin {
818	status = "okay";
819};
820
821&pmk8280_rtc {
822	nvmem-cells = <&rtc_offset>;
823	nvmem-cell-names = "offset";
824
825	status = "okay";
826};
827
828&pmk8280_sdam_6 {
829	status = "okay";
830
831	rtc_offset: rtc-offset@bc {
832		reg = <0xbc 0x4>;
833	};
834};
835
836&pmk8280_vadc {
837	status = "okay";
838
839	pmic-die-temp@3 {
840		reg = <PMK8350_ADC7_DIE_TEMP>;
841		qcom,pre-scaling = <1 1>;
842		label = "pmk8350_die_temp";
843	};
844
845	xo-therm@44 {
846		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
847		qcom,hw-settle-time = <200>;
848		qcom,ratiometric;
849		label = "pmk8350_xo_therm";
850	};
851
852	pmic-die-temp@103 {
853		reg = <PM8350_ADC7_DIE_TEMP(1)>;
854		qcom,pre-scaling = <1 1>;
855		label = "pmc8280_1_die_temp";
856	};
857
858	sys-therm@144 {
859		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
860		qcom,hw-settle-time = <200>;
861		qcom,ratiometric;
862		label = "sys_therm1";
863	};
864
865	sys-therm@145 {
866		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
867		qcom,hw-settle-time = <200>;
868		qcom,ratiometric;
869		label = "sys_therm2";
870	};
871
872	sys-therm@146 {
873		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
874		qcom,hw-settle-time = <200>;
875		qcom,ratiometric;
876		label = "sys_therm3";
877	};
878
879	sys-therm@147 {
880		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
881		qcom,hw-settle-time = <200>;
882		qcom,ratiometric;
883		label = "sys_therm4";
884	};
885
886	pmic-die-temp@303 {
887		reg = <PM8350_ADC7_DIE_TEMP(3)>;
888		qcom,pre-scaling = <1 1>;
889		label = "pmc8280_2_die_temp";
890	};
891
892	sys-therm@344 {
893		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
894		qcom,hw-settle-time = <200>;
895		qcom,ratiometric;
896		label = "sys_therm5";
897	};
898
899	sys-therm@345 {
900		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
901		qcom,hw-settle-time = <200>;
902		qcom,ratiometric;
903		label = "sys_therm6";
904	};
905
906	sys-therm@346 {
907		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
908		qcom,hw-settle-time = <200>;
909		qcom,ratiometric;
910		label = "sys_therm7";
911	};
912
913	sys-therm@347 {
914		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
915		qcom,hw-settle-time = <200>;
916		qcom,ratiometric;
917		label = "sys_therm8";
918	};
919
920	pmic-die-temp@403 {
921		reg = <PMR735A_ADC7_DIE_TEMP>;
922		qcom,pre-scaling = <1 1>;
923		label = "pmr735a_die_temp";
924	};
925};
926
927&qup0 {
928	status = "okay";
929};
930
931&qup1 {
932	status = "okay";
933};
934
935&qup2 {
936	status = "okay";
937};
938
939&remoteproc_adsp {
940	firmware-name = "qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn";
941
942	status = "okay";
943};
944
945&remoteproc_nsp0 {
946	firmware-name = "qcom/sc8280xp/LENOVO/21BX/qccdsp8280.mbn";
947
948	status = "okay";
949};
950
951&rxmacro {
952	status = "okay";
953};
954
955&sound {
956	compatible = "qcom,sc8280xp-sndcard";
957	model = "SC8280XP-LENOVO-X13S";
958	audio-routing =
959		"SpkrLeft IN", "WSA_SPK1 OUT",
960		"SpkrRight IN", "WSA_SPK2 OUT",
961		"IN1_HPHL", "HPHL_OUT",
962		"IN2_HPHR", "HPHR_OUT",
963		"AMIC2", "MIC BIAS2",
964		"VA DMIC0", "MIC BIAS1",
965		"VA DMIC1", "MIC BIAS1",
966		"VA DMIC2", "MIC BIAS3",
967		"VA DMIC0", "VA MIC BIAS1",
968		"VA DMIC1", "VA MIC BIAS1",
969		"VA DMIC2", "VA MIC BIAS3",
970		"TX SWR_ADC1", "ADC2_OUTPUT";
971
972	wcd-playback-dai-link {
973		link-name = "WCD Playback";
974		cpu {
975			sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>;
976		};
977
978		codec {
979			sound-dai = <&wcd938x 0>, <&swr1 0>, <&rxmacro 0>;
980		};
981
982		platform {
983			sound-dai = <&q6apm>;
984		};
985	};
986
987	wcd-capture-dai-link {
988		link-name = "WCD Capture";
989		cpu {
990			sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
991		};
992
993		codec {
994			sound-dai = <&wcd938x 1>, <&swr2 0>, <&txmacro 0>;
995		};
996
997		platform {
998			sound-dai = <&q6apm>;
999		};
1000	};
1001
1002	wsa-dai-link {
1003		link-name = "WSA Playback";
1004		cpu {
1005			sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
1006		};
1007
1008		codec {
1009			sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro 0>;
1010		};
1011
1012		platform {
1013			sound-dai = <&q6apm>;
1014		};
1015	};
1016
1017	va-dai-link {
1018		link-name = "VA Capture";
1019		cpu {
1020			sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
1021		};
1022
1023		platform {
1024			sound-dai = <&q6apm>;
1025		};
1026
1027		codec {
1028			sound-dai = <&vamacro 0>;
1029		};
1030	};
1031};
1032
1033&swr0 {
1034	status = "okay";
1035
1036	left_spkr: wsa8830-left@0,1 {
1037		compatible = "sdw10217020200";
1038		reg = <0 1>;
1039		pinctrl-names = "default";
1040		pinctrl-0 = <&spkr_1_sd_n_default>;
1041		powerdown-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>;
1042		#thermal-sensor-cells = <0>;
1043		sound-name-prefix = "SpkrLeft";
1044		#sound-dai-cells = <0>;
1045		vdd-supply = <&vreg_s10b>;
1046	};
1047
1048	right_spkr: wsa8830-right@0,2 {
1049		compatible = "sdw10217020200";
1050		reg = <0 2>;
1051		pinctrl-names = "default";
1052		pinctrl-0 = <&spkr_2_sd_n_default>;
1053		powerdown-gpios = <&tlmm 179 GPIO_ACTIVE_LOW>;
1054		#thermal-sensor-cells = <0>;
1055		sound-name-prefix = "SpkrRight";
1056		#sound-dai-cells = <0>;
1057		vdd-supply = <&vreg_s10b>;
1058	};
1059};
1060
1061&swr1 {
1062	status = "okay";
1063
1064	wcd_rx: wcd9380-rx@0,4 {
1065		compatible = "sdw20217010d00";
1066		reg = <0 4>;
1067		qcom,rx-port-mapping = <1 2 3 4 5>;
1068	};
1069};
1070
1071&swr2 {
1072	status = "okay";
1073
1074	wcd_tx: wcd9380-tx@0,3 {
1075		compatible = "sdw20217010d00";
1076		reg = <0 3>;
1077		qcom,tx-port-mapping = <1 1 2 3>;
1078	};
1079};
1080
1081&txmacro {
1082	status = "okay";
1083};
1084
1085&uart2 {
1086	pinctrl-0 = <&uart2_default>;
1087	pinctrl-names = "default";
1088
1089	status = "okay";
1090
1091	bluetooth {
1092		compatible = "qcom,wcn6855-bt";
1093
1094		vddio-supply = <&vreg_s10b>;
1095		vddbtcxmx-supply = <&vreg_s12b>;
1096		vddrfacmn-supply = <&vreg_s12b>;
1097		vddrfa0p8-supply = <&vreg_s12b>;
1098		vddrfa1p2-supply = <&vreg_s11b>;
1099		vddrfa1p7-supply = <&vreg_s1c>;
1100
1101		max-speed = <3200000>;
1102
1103		enable-gpios = <&tlmm 133 GPIO_ACTIVE_HIGH>;
1104		swctrl-gpios = <&tlmm 132 GPIO_ACTIVE_HIGH>;
1105
1106		pinctrl-0 = <&bt_default>;
1107		pinctrl-names = "default";
1108	};
1109};
1110
1111&usb_0 {
1112	status = "okay";
1113};
1114
1115&usb_0_dwc3 {
1116	dr_mode = "host";
1117};
1118
1119&usb_0_hsphy {
1120	vdda-pll-supply = <&vreg_l9d>;
1121	vdda18-supply = <&vreg_l1c>;
1122	vdda33-supply = <&vreg_l7d>;
1123
1124	status = "okay";
1125};
1126
1127&usb_0_qmpphy {
1128	vdda-phy-supply = <&vreg_l9d>;
1129	vdda-pll-supply = <&vreg_l4d>;
1130
1131	orientation-switch;
1132
1133	status = "okay";
1134};
1135
1136&usb_0_qmpphy_dp_in {
1137	remote-endpoint = <&mdss0_dp0_out>;
1138};
1139
1140&usb_0_qmpphy_out {
1141	remote-endpoint = <&pmic_glink_con0_ss>;
1142};
1143
1144&usb_0_role_switch {
1145	remote-endpoint = <&pmic_glink_con0_hs>;
1146};
1147
1148&usb_1 {
1149	status = "okay";
1150};
1151
1152&usb_1_dwc3 {
1153	dr_mode = "host";
1154};
1155
1156&usb_1_hsphy {
1157	vdda-pll-supply = <&vreg_l4b>;
1158	vdda18-supply = <&vreg_l1c>;
1159	vdda33-supply = <&vreg_l13c>;
1160
1161	status = "okay";
1162};
1163
1164&usb_1_qmpphy {
1165	vdda-phy-supply = <&vreg_l4b>;
1166	vdda-pll-supply = <&vreg_l3b>;
1167
1168	orientation-switch;
1169
1170	status = "okay";
1171};
1172
1173&usb_1_qmpphy_dp_in {
1174	remote-endpoint = <&mdss0_dp1_out>;
1175};
1176
1177&usb_1_qmpphy_out {
1178	remote-endpoint = <&pmic_glink_con1_ss>;
1179};
1180
1181&usb_1_role_switch {
1182	remote-endpoint = <&pmic_glink_con1_hs>;
1183};
1184
1185&vamacro {
1186	pinctrl-0 = <&dmic01_default>, <&dmic02_default>;
1187	pinctrl-names = "default";
1188
1189	vdd-micb-supply = <&vreg_s10b>;
1190
1191	qcom,dmic-sample-rate = <4800000>;
1192
1193	status = "okay";
1194};
1195
1196&wsamacro {
1197	status = "okay";
1198};
1199
1200&xo_board_clk {
1201	clock-frequency = <38400000>;
1202};
1203
1204/* PINCTRL */
1205
1206&lpass_tlmm {
1207	status = "okay";
1208};
1209
1210&pmc8280_1_gpios {
1211	edp_bl_en: edp-bl-en-state {
1212		pins = "gpio8";
1213		function = "normal";
1214	};
1215
1216	edp_bl_reg_en: edp-bl-reg-en-state {
1217		pins = "gpio9";
1218		function = "normal";
1219	};
1220
1221	misc_3p3_reg_en: misc-3p3-reg-en-state {
1222		pins = "gpio1";
1223		function = "normal";
1224	};
1225};
1226
1227&pmc8280_2_gpios {
1228	wwan_sw_en: wwan-sw-en-state {
1229		pins = "gpio1";
1230		function = "normal";
1231	};
1232};
1233
1234&pmc8280c_gpios {
1235	edp_bl_pwm: edp-bl-pwm-state {
1236		pins = "gpio8";
1237		function = "func1";
1238	};
1239};
1240
1241&pmr735a_gpios {
1242	hastings_reg_en: hastings-reg-en-state {
1243		pins = "gpio1";
1244		function = "normal";
1245	};
1246};
1247
1248&tlmm {
1249	gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
1250
1251	bt_default: bt-default-state {
1252		hstp-bt-en-pins {
1253			pins = "gpio133";
1254			function = "gpio";
1255			drive-strength = <16>;
1256			bias-disable;
1257		};
1258
1259		hstp-sw-ctrl-pins {
1260			pins = "gpio132";
1261			function = "gpio";
1262			bias-pull-down;
1263		};
1264	};
1265
1266	edp_reg_en: edp-reg-en-state {
1267		pins = "gpio25";
1268		function = "gpio";
1269		drive-strength = <16>;
1270		bias-disable;
1271	};
1272
1273	hall_int_n_default: hall-int-n-state {
1274		pins = "gpio107";
1275		function = "gpio";
1276		bias-disable;
1277	};
1278
1279	i2c4_default: i2c4-default-state {
1280		pins = "gpio171", "gpio172";
1281		function = "qup4";
1282		drive-strength = <16>;
1283		bias-disable;
1284	};
1285
1286	i2c21_default: i2c21-default-state {
1287		pins = "gpio81", "gpio82";
1288		function = "qup21";
1289		drive-strength = <16>;
1290		bias-disable;
1291	};
1292
1293	kybd_default: kybd-default-state {
1294		disable-pins {
1295			pins = "gpio102";
1296			function = "gpio";
1297			output-low;
1298		};
1299
1300		int-n-pins {
1301			pins = "gpio104";
1302			function = "gpio";
1303			bias-disable;
1304		};
1305
1306		reset-pins {
1307			pins = "gpio105";
1308			function = "gpio";
1309			bias-disable;
1310		};
1311	};
1312
1313	nvme_reg_en: nvme-reg-en-state {
1314		pins = "gpio135";
1315		function = "gpio";
1316		drive-strength = <2>;
1317		bias-disable;
1318	};
1319
1320	pcie2a_default: pcie2a-default-state {
1321		clkreq-n-pins {
1322			pins = "gpio142";
1323			function = "pcie2a_clkreq";
1324			drive-strength = <2>;
1325			bias-pull-up;
1326		};
1327
1328		perst-n-pins {
1329			pins = "gpio143";
1330			function = "gpio";
1331			drive-strength = <2>;
1332			bias-pull-down;
1333		};
1334
1335		wake-n-pins {
1336		       pins = "gpio145";
1337		       function = "gpio";
1338		       drive-strength = <2>;
1339		       bias-pull-up;
1340	       };
1341	};
1342
1343	pcie3a_default: pcie3a-default-state {
1344		clkreq-n-pins {
1345			pins = "gpio150";
1346			function = "pcie3a_clkreq";
1347			drive-strength = <2>;
1348			bias-pull-up;
1349		};
1350
1351		perst-n-pins {
1352			pins = "gpio151";
1353			function = "gpio";
1354			drive-strength = <2>;
1355			bias-pull-down;
1356		};
1357
1358		wake-n-pins {
1359			pins = "gpio148";
1360			function = "gpio";
1361			drive-strength = <2>;
1362			bias-pull-up;
1363		};
1364	};
1365
1366	pcie4_default: pcie4-default-state {
1367		clkreq-n-pins {
1368			pins = "gpio140";
1369			function = "pcie4_clkreq";
1370			drive-strength = <2>;
1371			bias-pull-up;
1372		};
1373
1374		perst-n-pins {
1375			pins = "gpio141";
1376			function = "gpio";
1377			drive-strength = <2>;
1378			bias-pull-down;
1379		};
1380
1381		wake-n-pins {
1382			pins = "gpio139";
1383			function = "gpio";
1384			drive-strength = <2>;
1385			bias-pull-up;
1386		};
1387	};
1388
1389	spkr_1_sd_n_default: spkr-1-sd-n-default-state {
1390		perst-n-pins {
1391			pins = "gpio178";
1392			function = "gpio";
1393			drive-strength = <16>;
1394			bias-disable;
1395			output-high;
1396		};
1397	};
1398
1399	spkr_2_sd_n_default: spkr-2-sd-n-default-state {
1400		perst-n-pins {
1401			pins = "gpio179";
1402			function = "gpio";
1403			drive-strength = <16>;
1404			bias-disable;
1405			output-high;
1406		};
1407	};
1408
1409	tpad_default: tpad-default-state {
1410		int-n-pins {
1411			pins = "gpio182";
1412			function = "gpio";
1413			bias-disable;
1414		};
1415	};
1416
1417	ts0_default: ts0-default-state {
1418		int-n-pins {
1419			pins = "gpio175";
1420			function = "gpio";
1421			bias-disable;
1422		};
1423
1424		reset-n-pins {
1425			pins = "gpio99";
1426			function = "gpio";
1427			output-high;
1428			drive-strength = <16>;
1429		};
1430	};
1431
1432	uart2_default: uart2-default-state {
1433		cts-pins {
1434			pins = "gpio121";
1435			function = "qup2";
1436			bias-bus-hold;
1437		};
1438
1439		rts-pins {
1440			pins = "gpio122";
1441			function = "qup2";
1442			drive-strength = <2>;
1443			bias-disable;
1444		};
1445
1446		rx-pins {
1447			pins = "gpio124";
1448			function = "qup2";
1449			bias-pull-up;
1450		};
1451
1452		tx-pins {
1453			pins = "gpio123";
1454			function = "qup2";
1455			drive-strength = <2>;
1456			bias-disable;
1457		};
1458	};
1459
1460	usb0_sbu_default: usb0-sbu-state {
1461		oe-n-pins {
1462			pins = "gpio101";
1463			function = "gpio";
1464			bias-disable;
1465			drive-strength = <16>;
1466			output-high;
1467		};
1468
1469		sel-pins {
1470			pins = "gpio164";
1471			function = "gpio";
1472			bias-disable;
1473			drive-strength = <16>;
1474		};
1475	};
1476
1477	usb1_sbu_default: usb1-sbu-state {
1478		oe-n-pins {
1479			pins = "gpio48";
1480			function = "gpio";
1481			bias-disable;
1482			drive-strength = <16>;
1483			output-high;
1484		};
1485
1486		sel-pins {
1487			pins = "gpio47";
1488			function = "gpio";
1489			bias-disable;
1490			drive-strength = <16>;
1491		};
1492	};
1493
1494	wcd_default: wcd-default-state {
1495		reset-pins {
1496			pins = "gpio106";
1497			function = "gpio";
1498			bias-disable;
1499		};
1500	};
1501};
1502