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