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