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			regulator-always-on;
374		};
375
376		vreg_s11b: smps11 {
377			regulator-name = "vreg_s11b";
378			regulator-min-microvolt = <1272000>;
379			regulator-max-microvolt = <1272000>;
380			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
381			regulator-always-on;
382		};
383
384		vreg_s12b: smps12 {
385			regulator-name = "vreg_s12b";
386			regulator-min-microvolt = <984000>;
387			regulator-max-microvolt = <984000>;
388			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
389			regulator-always-on;
390		};
391
392		vreg_l3b: ldo3 {
393			regulator-name = "vreg_l3b";
394			regulator-min-microvolt = <1200000>;
395			regulator-max-microvolt = <1200000>;
396			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
397			regulator-boot-on;
398		};
399
400		vreg_l4b: ldo4 {
401			regulator-name = "vreg_l4b";
402			regulator-min-microvolt = <912000>;
403			regulator-max-microvolt = <912000>;
404			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
405		};
406
407		vreg_l6b: ldo6 {
408			regulator-name = "vreg_l6b";
409			regulator-min-microvolt = <880000>;
410			regulator-max-microvolt = <880000>;
411			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
412			regulator-boot-on;
413		};
414	};
415
416	regulators-1 {
417		compatible = "qcom,pm8350c-rpmh-regulators";
418		qcom,pmic-id = "c";
419		vdd-bob-supply = <&vreg_vph_pwr>;
420
421		vreg_l1c: ldo1 {
422			regulator-name = "vreg_l1c";
423			regulator-min-microvolt = <1800000>;
424			regulator-max-microvolt = <1800000>;
425			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
426		};
427
428		vreg_l12c: ldo12 {
429			regulator-name = "vreg_l12c";
430			regulator-min-microvolt = <1800000>;
431			regulator-max-microvolt = <1800000>;
432			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
433		};
434
435		vreg_l13c: ldo13 {
436			regulator-name = "vreg_l13c";
437			regulator-min-microvolt = <3072000>;
438			regulator-max-microvolt = <3072000>;
439			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
440		};
441
442		vreg_bob: bob {
443			regulator-name = "vreg_bob";
444			regulator-min-microvolt = <3008000>;
445			regulator-max-microvolt = <3960000>;
446			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
447			regulator-always-on;
448		};
449	};
450
451	regulators-2 {
452		compatible = "qcom,pm8350-rpmh-regulators";
453		qcom,pmic-id = "d";
454
455		vdd-l1-l4-supply = <&vreg_s11b>;
456
457		vreg_l3d: ldo3 {
458			regulator-name = "vreg_l3d";
459			regulator-min-microvolt = <1200000>;
460			regulator-max-microvolt = <1200000>;
461			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
462		};
463
464		vreg_l4d: ldo4 {
465			regulator-name = "vreg_l4d";
466			regulator-min-microvolt = <1200000>;
467			regulator-max-microvolt = <1200000>;
468			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
469		};
470
471		vreg_l6d: ldo6 {
472			regulator-name = "vreg_l6d";
473			regulator-min-microvolt = <880000>;
474			regulator-max-microvolt = <880000>;
475			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
476		};
477
478		vreg_l7d: ldo7 {
479			regulator-name = "vreg_l7d";
480			regulator-min-microvolt = <3072000>;
481			regulator-max-microvolt = <3072000>;
482			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
483		};
484
485		vreg_l9d: ldo9 {
486			regulator-name = "vreg_l9d";
487			regulator-min-microvolt = <912000>;
488			regulator-max-microvolt = <912000>;
489			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
490		};
491	};
492};
493
494&dispcc0 {
495	status = "okay";
496};
497
498&mdss0 {
499	status = "okay";
500};
501
502&mdss0_dp0 {
503	status = "okay";
504};
505
506&mdss0_dp0_out {
507	data-lanes = <0 1>;
508	remote-endpoint = <&pmic_glink_con0_ss>;
509};
510
511&mdss0_dp1 {
512	status = "okay";
513};
514
515&mdss0_dp1_out {
516	data-lanes = <0 1>;
517	remote-endpoint = <&pmic_glink_con1_ss>;
518};
519
520&mdss0_dp3 {
521	compatible = "qcom,sc8280xp-edp";
522
523	data-lanes = <0 1 2 3>;
524
525	status = "okay";
526
527	aux-bus {
528		panel {
529			compatible = "edp-panel";
530
531			backlight = <&backlight>;
532			power-supply = <&vreg_edp_3p3>;
533
534			ports {
535				port {
536					edp_panel_in: endpoint {
537						remote-endpoint = <&mdss0_dp3_out>;
538					};
539				};
540			};
541		};
542	};
543
544	ports {
545		port@1 {
546			reg = <1>;
547			mdss0_dp3_out: endpoint {
548				remote-endpoint = <&edp_panel_in>;
549			};
550		};
551	};
552};
553
554&mdss0_dp3_phy {
555	vdda-phy-supply = <&vreg_l6b>;
556	vdda-pll-supply = <&vreg_l3b>;
557
558	status = "okay";
559};
560
561&i2c4 {
562	clock-frequency = <400000>;
563
564	pinctrl-names = "default";
565	pinctrl-0 = <&i2c4_default>;
566
567	status = "okay";
568
569	/* FIXME: verify */
570	touchscreen@10 {
571		compatible = "hid-over-i2c";
572		reg = <0x10>;
573
574		hid-descr-addr = <0x1>;
575		interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>;
576		vdd-supply = <&vreg_misc_3p3>;
577
578		pinctrl-names = "default";
579		pinctrl-0 = <&ts0_default>;
580	};
581};
582
583&i2c21 {
584	clock-frequency = <400000>;
585
586	pinctrl-names = "default";
587	pinctrl-0 = <&i2c21_default>;
588
589	status = "okay";
590
591	touchpad@15 {
592		compatible = "hid-over-i2c";
593		reg = <0x15>;
594
595		hid-descr-addr = <0x1>;
596		interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
597		vdd-supply = <&vreg_misc_3p3>;
598
599		pinctrl-names = "default";
600		pinctrl-0 = <&tpad_default>;
601
602		wakeup-source;
603
604		status = "disabled";
605	};
606
607	touchpad@2c {
608		compatible = "hid-over-i2c";
609		reg = <0x2c>;
610
611		hid-descr-addr = <0x20>;
612		interrupts-extended = <&tlmm 182 IRQ_TYPE_LEVEL_LOW>;
613		vdd-supply = <&vreg_misc_3p3>;
614
615		pinctrl-names = "default";
616		pinctrl-0 = <&tpad_default>;
617
618		wakeup-source;
619	};
620
621	keyboard@68 {
622		compatible = "hid-over-i2c";
623		reg = <0x68>;
624
625		hid-descr-addr = <0x1>;
626		interrupts-extended = <&tlmm 104 IRQ_TYPE_LEVEL_LOW>;
627		vdd-supply = <&vreg_misc_3p3>;
628
629		pinctrl-names = "default";
630		pinctrl-0 = <&kybd_default>;
631
632		wakeup-source;
633	};
634};
635
636&pcie2a {
637	perst-gpios = <&tlmm 143 GPIO_ACTIVE_LOW>;
638	wake-gpios = <&tlmm 145 GPIO_ACTIVE_LOW>;
639
640	vddpe-3v3-supply = <&vreg_nvme>;
641
642	pinctrl-names = "default";
643	pinctrl-0 = <&pcie2a_default>;
644
645	status = "okay";
646};
647
648&pcie2a_phy {
649	vdda-phy-supply = <&vreg_l6d>;
650	vdda-pll-supply = <&vreg_l4d>;
651
652	status = "okay";
653};
654
655&pcie3a {
656	perst-gpios = <&tlmm 151 GPIO_ACTIVE_LOW>;
657	wake-gpios = <&tlmm 148 GPIO_ACTIVE_LOW>;
658
659	vddpe-3v3-supply = <&vreg_wwan>;
660
661	pinctrl-names = "default";
662	pinctrl-0 = <&pcie3a_default>;
663
664	status = "okay";
665};
666
667&pcie3a_phy {
668	vdda-phy-supply = <&vreg_l6d>;
669	vdda-pll-supply = <&vreg_l4d>;
670
671	status = "okay";
672};
673
674&pcie4 {
675	perst-gpios = <&tlmm 141 GPIO_ACTIVE_LOW>;
676	wake-gpios = <&tlmm 139 GPIO_ACTIVE_LOW>;
677
678	vddpe-3v3-supply = <&vreg_wlan>;
679
680	pinctrl-names = "default";
681	pinctrl-0 = <&pcie4_default>;
682
683	status = "okay";
684};
685
686&pcie4_phy {
687	vdda-phy-supply = <&vreg_l6d>;
688	vdda-pll-supply = <&vreg_l4d>;
689
690	status = "okay";
691};
692
693&pmc8280c_lpg {
694	status = "okay";
695};
696
697&pmk8280_adc_tm {
698	status = "okay";
699
700	sys-therm@0 {
701		reg = <0>;
702		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
703		qcom,hw-settle-time-us = <200>;
704		qcom,avg-samples = <2>;
705		qcom,ratiometric;
706	};
707
708	sys-therm@1 {
709		reg = <1>;
710		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
711		qcom,hw-settle-time-us = <200>;
712		qcom,avg-samples = <2>;
713		qcom,ratiometric;
714	};
715
716	sys-therm@2 {
717		reg = <2>;
718		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
719		qcom,hw-settle-time-us = <200>;
720		qcom,avg-samples = <2>;
721		qcom,ratiometric;
722	};
723
724	sys-therm@3 {
725		reg = <3>;
726		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
727		qcom,hw-settle-time-us = <200>;
728		qcom,avg-samples = <2>;
729		qcom,ratiometric;
730	};
731
732	sys-therm@4 {
733		reg = <4>;
734		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
735		qcom,hw-settle-time-us = <200>;
736		qcom,avg-samples = <2>;
737		qcom,ratiometric;
738	};
739
740	sys-therm@5 {
741		reg = <5>;
742		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
743		qcom,hw-settle-time-us = <200>;
744		qcom,avg-samples = <2>;
745		qcom,ratiometric;
746	};
747
748	sys-therm@6 {
749		reg = <6>;
750		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
751		qcom,hw-settle-time-us = <200>;
752		qcom,avg-samples = <2>;
753		qcom,ratiometric;
754	};
755
756	sys-therm@7 {
757		reg = <7>;
758		io-channels = <&pmk8280_vadc PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
759		qcom,hw-settle-time-us = <200>;
760		qcom,avg-samples = <2>;
761		qcom,ratiometric;
762	};
763};
764
765&pmk8280_pon_pwrkey {
766	status = "okay";
767};
768
769&pmk8280_pon_resin {
770	status = "okay";
771};
772
773&pmk8280_vadc {
774	status = "okay";
775
776	pmic-die-temp@3 {
777		reg = <PMK8350_ADC7_DIE_TEMP>;
778		qcom,pre-scaling = <1 1>;
779		label = "pmk8350_die_temp";
780	};
781
782	xo-therm@44 {
783		reg = <PMK8350_ADC7_AMUX_THM1_100K_PU>;
784		qcom,hw-settle-time = <200>;
785		qcom,ratiometric;
786		label = "pmk8350_xo_therm";
787	};
788
789	pmic-die-temp@103 {
790		reg = <PM8350_ADC7_DIE_TEMP(1)>;
791		qcom,pre-scaling = <1 1>;
792		label = "pmc8280_1_die_temp";
793	};
794
795	sys-therm@144 {
796		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(1)>;
797		qcom,hw-settle-time = <200>;
798		qcom,ratiometric;
799		label = "sys_therm1";
800	};
801
802	sys-therm@145 {
803		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(1)>;
804		qcom,hw-settle-time = <200>;
805		qcom,ratiometric;
806		label = "sys_therm2";
807	};
808
809	sys-therm@146 {
810		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(1)>;
811		qcom,hw-settle-time = <200>;
812		qcom,ratiometric;
813		label = "sys_therm3";
814	};
815
816	sys-therm@147 {
817		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(1)>;
818		qcom,hw-settle-time = <200>;
819		qcom,ratiometric;
820		label = "sys_therm4";
821	};
822
823	pmic-die-temp@303 {
824		reg = <PM8350_ADC7_DIE_TEMP(3)>;
825		qcom,pre-scaling = <1 1>;
826		label = "pmc8280_2_die_temp";
827	};
828
829	sys-therm@344 {
830		reg = <PM8350_ADC7_AMUX_THM1_100K_PU(3)>;
831		qcom,hw-settle-time = <200>;
832		qcom,ratiometric;
833		label = "sys_therm5";
834	};
835
836	sys-therm@345 {
837		reg = <PM8350_ADC7_AMUX_THM2_100K_PU(3)>;
838		qcom,hw-settle-time = <200>;
839		qcom,ratiometric;
840		label = "sys_therm6";
841	};
842
843	sys-therm@346 {
844		reg = <PM8350_ADC7_AMUX_THM3_100K_PU(3)>;
845		qcom,hw-settle-time = <200>;
846		qcom,ratiometric;
847		label = "sys_therm7";
848	};
849
850	sys-therm@347 {
851		reg = <PM8350_ADC7_AMUX_THM4_100K_PU(3)>;
852		qcom,hw-settle-time = <200>;
853		qcom,ratiometric;
854		label = "sys_therm8";
855	};
856
857	pmic-die-temp@403 {
858		reg = <PMR735A_ADC7_DIE_TEMP>;
859		qcom,pre-scaling = <1 1>;
860		label = "pmr735a_die_temp";
861	};
862};
863
864&qup0 {
865	status = "okay";
866};
867
868&qup1 {
869	status = "okay";
870};
871
872&qup2 {
873	status = "okay";
874};
875
876&remoteproc_adsp {
877	firmware-name = "qcom/sc8280xp/LENOVO/21BX/qcadsp8280.mbn";
878
879	status = "okay";
880};
881
882&remoteproc_nsp0 {
883	firmware-name = "qcom/sc8280xp/LENOVO/21BX/qccdsp8280.mbn";
884
885	status = "okay";
886};
887
888&rxmacro {
889	status = "okay";
890};
891
892&sound {
893	compatible = "qcom,sc8280xp-sndcard";
894	model = "SC8280XP-LENOVO-X13S";
895	audio-routing =
896		"SpkrLeft IN", "WSA_SPK1 OUT",
897		"SpkrRight IN", "WSA_SPK2 OUT",
898		"IN1_HPHL", "HPHL_OUT",
899		"IN2_HPHR", "HPHR_OUT",
900		"AMIC2", "MIC BIAS2",
901		"VA DMIC0", "MIC BIAS1",
902		"VA DMIC1", "MIC BIAS1",
903		"VA DMIC2", "MIC BIAS3",
904		"VA DMIC0", "VA MIC BIAS1",
905		"VA DMIC1", "VA MIC BIAS1",
906		"VA DMIC2", "VA MIC BIAS3",
907		"TX SWR_ADC1", "ADC2_OUTPUT";
908
909	wcd-playback-dai-link {
910		link-name = "WCD Playback";
911		cpu {
912			sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>;
913		};
914
915		codec {
916			sound-dai = <&wcd938x 0>, <&swr1 0>, <&rxmacro 0>;
917		};
918
919		platform {
920			sound-dai = <&q6apm>;
921		};
922	};
923
924	wcd-capture-dai-link {
925		link-name = "WCD Capture";
926		cpu {
927			sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
928		};
929
930		codec {
931			sound-dai = <&wcd938x 1>, <&swr2 0>, <&txmacro 0>;
932		};
933
934		platform {
935			sound-dai = <&q6apm>;
936		};
937	};
938
939	wsa-dai-link {
940		link-name = "WSA Playback";
941		cpu {
942			sound-dai = <&q6apmbedai WSA_CODEC_DMA_RX_0>;
943		};
944
945		codec {
946			sound-dai = <&left_spkr>, <&right_spkr>, <&swr0 0>, <&wsamacro 0>;
947		};
948
949		platform {
950			sound-dai = <&q6apm>;
951		};
952	};
953
954	va-dai-link {
955		link-name = "VA Capture";
956		cpu {
957			sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
958		};
959
960		platform {
961			sound-dai = <&q6apm>;
962		};
963
964		codec {
965			sound-dai = <&vamacro 0>;
966		};
967	};
968};
969
970&swr0 {
971	status = "okay";
972
973	left_spkr: wsa8830-left@0,1 {
974		compatible = "sdw10217020200";
975		reg = <0 1>;
976		pinctrl-names = "default";
977		pinctrl-0 = <&spkr_1_sd_n_default>;
978		powerdown-gpios = <&tlmm 178 GPIO_ACTIVE_LOW>;
979		#thermal-sensor-cells = <0>;
980		sound-name-prefix = "SpkrLeft";
981		#sound-dai-cells = <0>;
982		vdd-supply = <&vreg_s10b>;
983	};
984
985	right_spkr: wsa8830-right@0,2 {
986		compatible = "sdw10217020200";
987		reg = <0 2>;
988		pinctrl-names = "default";
989		pinctrl-0 = <&spkr_2_sd_n_default>;
990		powerdown-gpios = <&tlmm 179 GPIO_ACTIVE_LOW>;
991		#thermal-sensor-cells = <0>;
992		sound-name-prefix = "SpkrRight";
993		#sound-dai-cells = <0>;
994		vdd-supply = <&vreg_s10b>;
995	};
996};
997
998&swr1 {
999	status = "okay";
1000
1001	wcd_rx: wcd9380-rx@0,4 {
1002		compatible = "sdw20217010d00";
1003		reg = <0 4>;
1004		qcom,rx-port-mapping = <1 2 3 4 5>;
1005	};
1006};
1007
1008&swr2 {
1009	status = "okay";
1010
1011	wcd_tx: wcd9380-tx@0,3 {
1012		compatible = "sdw20217010d00";
1013		reg = <0 3>;
1014		qcom,tx-port-mapping = <1 1 2 3>;
1015	};
1016};
1017
1018&txmacro {
1019	status = "okay";
1020};
1021
1022&usb_0 {
1023	status = "okay";
1024};
1025
1026&usb_0_dwc3 {
1027	dr_mode = "host";
1028};
1029
1030&usb_0_hsphy {
1031	vdda-pll-supply = <&vreg_l9d>;
1032	vdda18-supply = <&vreg_l1c>;
1033	vdda33-supply = <&vreg_l7d>;
1034
1035	status = "okay";
1036};
1037
1038&usb_0_qmpphy {
1039	vdda-phy-supply = <&vreg_l9d>;
1040	vdda-pll-supply = <&vreg_l4d>;
1041
1042	status = "okay";
1043};
1044
1045&usb_0_role_switch {
1046	remote-endpoint = <&pmic_glink_con0_hs>;
1047};
1048
1049&usb_1 {
1050	status = "okay";
1051};
1052
1053&usb_1_dwc3 {
1054	dr_mode = "host";
1055};
1056
1057&usb_1_hsphy {
1058	vdda-pll-supply = <&vreg_l4b>;
1059	vdda18-supply = <&vreg_l1c>;
1060	vdda33-supply = <&vreg_l13c>;
1061
1062	status = "okay";
1063};
1064
1065&usb_1_qmpphy {
1066	vdda-phy-supply = <&vreg_l4b>;
1067	vdda-pll-supply = <&vreg_l3b>;
1068
1069	status = "okay";
1070};
1071
1072&usb_1_role_switch {
1073	remote-endpoint = <&pmic_glink_con1_hs>;
1074};
1075
1076&vamacro {
1077	pinctrl-0 = <&dmic01_default>, <&dmic02_default>;
1078	pinctrl-names = "default";
1079
1080	vdd-micb-supply = <&vreg_s10b>;
1081
1082	qcom,dmic-sample-rate = <4800000>;
1083
1084	status = "okay";
1085};
1086
1087&wsamacro {
1088	status = "okay";
1089};
1090
1091&xo_board_clk {
1092	clock-frequency = <38400000>;
1093};
1094
1095/* PINCTRL */
1096
1097&lpass_tlmm {
1098	status = "okay";
1099};
1100
1101&pmc8280_1_gpios {
1102	edp_bl_en: edp-bl-en-state {
1103		pins = "gpio8";
1104		function = "normal";
1105	};
1106
1107	edp_bl_reg_en: edp-bl-reg-en-state {
1108		pins = "gpio9";
1109		function = "normal";
1110	};
1111
1112	misc_3p3_reg_en: misc-3p3-reg-en-state {
1113		pins = "gpio1";
1114		function = "normal";
1115	};
1116};
1117
1118&pmc8280_2_gpios {
1119	wwan_sw_en: wwan-sw-en-state {
1120		pins = "gpio1";
1121		function = "normal";
1122	};
1123};
1124
1125&pmc8280c_gpios {
1126	edp_bl_pwm: edp-bl-pwm-state {
1127		pins = "gpio8";
1128		function = "func1";
1129	};
1130};
1131
1132&pmr735a_gpios {
1133	hastings_reg_en: hastings-reg-en-state {
1134		pins = "gpio1";
1135		function = "normal";
1136	};
1137};
1138
1139&tlmm {
1140	gpio-reserved-ranges = <70 2>, <74 6>, <83 4>, <125 2>, <128 2>, <154 7>;
1141
1142	edp_reg_en: edp-reg-en-state {
1143		pins = "gpio25";
1144		function = "gpio";
1145		drive-strength = <16>;
1146		bias-disable;
1147	};
1148
1149	hall_int_n_default: hall-int-n-state {
1150		pins = "gpio107";
1151		function = "gpio";
1152		input-enable;
1153		bias-disable;
1154	};
1155
1156	i2c4_default: i2c4-default-state {
1157		pins = "gpio171", "gpio172";
1158		function = "qup4";
1159		drive-strength = <16>;
1160		bias-disable;
1161	};
1162
1163	i2c21_default: i2c21-default-state {
1164		pins = "gpio81", "gpio82";
1165		function = "qup21";
1166		drive-strength = <16>;
1167		bias-disable;
1168	};
1169
1170	kybd_default: kybd-default-state {
1171		disable-pins {
1172			pins = "gpio102";
1173			function = "gpio";
1174			output-low;
1175		};
1176
1177		int-n-pins {
1178			pins = "gpio104";
1179			function = "gpio";
1180			bias-disable;
1181		};
1182
1183		reset-pins {
1184			pins = "gpio105";
1185			function = "gpio";
1186			bias-disable;
1187		};
1188	};
1189
1190	nvme_reg_en: nvme-reg-en-state {
1191		pins = "gpio135";
1192		function = "gpio";
1193		drive-strength = <2>;
1194		bias-disable;
1195	};
1196
1197	pcie2a_default: pcie2a-default-state {
1198		clkreq-n-pins {
1199			pins = "gpio142";
1200			function = "pcie2a_clkreq";
1201			drive-strength = <2>;
1202			bias-pull-up;
1203		};
1204
1205		perst-n-pins {
1206			pins = "gpio143";
1207			function = "gpio";
1208			drive-strength = <2>;
1209			bias-pull-down;
1210		};
1211
1212		wake-n-pins {
1213		       pins = "gpio145";
1214		       function = "gpio";
1215		       drive-strength = <2>;
1216		       bias-pull-up;
1217	       };
1218	};
1219
1220	pcie3a_default: pcie3a-default-state {
1221		clkreq-n-pins {
1222			pins = "gpio150";
1223			function = "pcie3a_clkreq";
1224			drive-strength = <2>;
1225			bias-pull-up;
1226		};
1227
1228		perst-n-pins {
1229			pins = "gpio151";
1230			function = "gpio";
1231			drive-strength = <2>;
1232			bias-pull-down;
1233		};
1234
1235		wake-n-pins {
1236			pins = "gpio148";
1237			function = "gpio";
1238			drive-strength = <2>;
1239			bias-pull-up;
1240		};
1241	};
1242
1243	pcie4_default: pcie4-default-state {
1244		clkreq-n-pins {
1245			pins = "gpio140";
1246			function = "pcie4_clkreq";
1247			drive-strength = <2>;
1248			bias-pull-up;
1249		};
1250
1251		perst-n-pins {
1252			pins = "gpio141";
1253			function = "gpio";
1254			drive-strength = <2>;
1255			bias-pull-down;
1256		};
1257
1258		wake-n-pins {
1259			pins = "gpio139";
1260			function = "gpio";
1261			drive-strength = <2>;
1262			bias-pull-up;
1263		};
1264	};
1265
1266	spkr_1_sd_n_default: spkr-1-sd-n-default-state {
1267		perst-n-pins {
1268			pins = "gpio178";
1269			function = "gpio";
1270			drive-strength = <16>;
1271			bias-disable;
1272			output-high;
1273		};
1274	};
1275
1276	spkr_2_sd_n_default: spkr-2-sd-n-default-state {
1277		perst-n-pins {
1278			pins = "gpio179";
1279			function = "gpio";
1280			drive-strength = <16>;
1281			bias-disable;
1282			output-high;
1283		};
1284	};
1285
1286	tpad_default: tpad-default-state {
1287		int-n-pins {
1288			pins = "gpio182";
1289			function = "gpio";
1290			bias-disable;
1291		};
1292	};
1293
1294	ts0_default: ts0-default-state {
1295		int-n-pins {
1296			pins = "gpio175";
1297			function = "gpio";
1298			bias-disable;
1299		};
1300
1301		reset-n-pins {
1302			pins = "gpio99";
1303			function = "gpio";
1304			output-high;
1305			drive-strength = <16>;
1306		};
1307	};
1308
1309	usb0_sbu_default: usb0-sbu-state {
1310		oe-n-pins {
1311			pins = "gpio101";
1312			function = "gpio";
1313			bias-disable;
1314			drive-strengh = <16>;
1315			output-high;
1316		};
1317
1318		sel-pins {
1319			pins = "gpio164";
1320			function = "gpio";
1321			bias-disable;
1322			drive-strength = <16>;
1323		};
1324	};
1325
1326	usb1_sbu_default: usb1-sbu-state {
1327		oe-n-pins {
1328			pins = "gpio48";
1329			function = "gpio";
1330			bias-disable;
1331			drive-strengh = <16>;
1332			output-high;
1333		};
1334
1335		sel-pins {
1336			pins = "gpio47";
1337			function = "gpio";
1338			bias-disable;
1339			drive-strength = <16>;
1340		};
1341	};
1342
1343	wcd_default: wcd-default-state {
1344		reset-pins {
1345			pins = "gpio106";
1346			function = "gpio";
1347			bias-disable;
1348		};
1349	};
1350};
1351