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