1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Copyright (C) 2021, Microsoft Corporation
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/regulator/qcom,rpmh-regulator.h>
9#include <dt-bindings/gpio/gpio.h>
10#include "sm8150.dtsi"
11#include "pm8150.dtsi"
12#include "pm8150b.dtsi"
13#include "pm8150l.dtsi"
14
15/ {
16	model = "Microsoft Surface Duo";
17	compatible = "microsoft,surface-duo", "qcom,sm8150";
18	chassis-type = "handset";
19
20	aliases {
21		serial0 = &uart2;
22	};
23
24	chosen {
25		stdout-path = "serial0:115200n8";
26	};
27
28	vph_pwr: vph-pwr-regulator {
29		compatible = "regulator-fixed";
30		regulator-name = "vph_pwr";
31		regulator-min-microvolt = <3700000>;
32		regulator-max-microvolt = <3700000>;
33	};
34
35	/*
36	 * Apparently RPMh does not provide support for PM8150 S4 because it
37	 * is always-on; model it as a fixed regulator.
38	 */
39	vreg_s4a_1p8: pm8150-s4 {
40		compatible = "regulator-fixed";
41		regulator-name = "vreg_s4a_1p8";
42
43		regulator-min-microvolt = <1800000>;
44		regulator-max-microvolt = <1800000>;
45
46		regulator-always-on;
47		regulator-boot-on;
48
49		vin-supply = <&vph_pwr>;
50	};
51
52	gpio_keys {
53		compatible = "gpio-keys";
54
55		vol_up {
56			label = "Volume Up";
57			gpios = <&pm8150_gpios 6 GPIO_ACTIVE_LOW>;
58			linux,code = <KEY_VOLUMEUP>;
59		};
60	};
61};
62
63&apps_rsc {
64	pm8150-rpmh-regulators {
65		compatible = "qcom,pm8150-rpmh-regulators";
66		qcom,pmic-id = "a";
67
68		vdd-s1-supply = <&vph_pwr>;
69		vdd-s2-supply = <&vph_pwr>;
70		vdd-s3-supply = <&vph_pwr>;
71		vdd-s4-supply = <&vph_pwr>;
72		vdd-s5-supply = <&vph_pwr>;
73		vdd-s6-supply = <&vph_pwr>;
74		vdd-s7-supply = <&vph_pwr>;
75		vdd-s8-supply = <&vph_pwr>;
76		vdd-s9-supply = <&vph_pwr>;
77		vdd-s10-supply = <&vph_pwr>;
78
79		vdd-l1-l8-l11-supply = <&vreg_s6a_0p9>;
80		vdd-l2-l10-supply = <&vreg_bob>;
81		vdd-l3-l4-l5-l18-supply = <&vreg_s6a_0p9>;
82		vdd-l6-l9-supply = <&vreg_s8c_1p3>;
83		vdd-l7-l12-l14-l15-supply = <&vreg_s5a_2p0>;
84		vdd-l13-l16-l17-supply = <&vreg_bob>;
85
86		vreg_s5a_2p0: smps5 {
87			regulator-min-microvolt = <1904000>;
88			regulator-max-microvolt = <2000000>;
89		};
90
91		vreg_s6a_0p9: smps6 {
92			regulator-min-microvolt = <920000>;
93			regulator-max-microvolt = <1128000>;
94		};
95
96		vdda_wcss_pll:
97		vreg_l1a_0p75: ldo1 {
98			regulator-min-microvolt = <752000>;
99			regulator-max-microvolt = <752000>;
100			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
101		};
102
103		vdd_pdphy:
104		vdda_usb_hs_3p1:
105		vreg_l2a_3p1: ldo2 {
106			regulator-min-microvolt = <3072000>;
107			regulator-max-microvolt = <3072000>;
108			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
109		};
110
111		vreg_l3a_0p8: ldo3 {
112			regulator-min-microvolt = <480000>;
113			regulator-max-microvolt = <932000>;
114			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
115		};
116
117		vdd_usb_hs_core:
118		vdda_csi_0_0p9:
119		vdda_csi_1_0p9:
120		vdda_csi_2_0p9:
121		vdda_csi_3_0p9:
122		vdda_dsi_0_0p9:
123		vdda_dsi_1_0p9:
124		vdda_dsi_0_pll_0p9:
125		vdda_dsi_1_pll_0p9:
126		vdda_pcie_1ln_core:
127		vdda_pcie_2ln_core:
128		vdda_pll_hv_cc_ebi01:
129		vdda_pll_hv_cc_ebi23:
130		vdda_qrefs_0p875_5:
131		vdda_sp_sensor:
132		vdda_ufs_2ln_core_1:
133		vdda_ufs_2ln_core_2:
134		vdda_usb_ss_dp_core_1:
135		vdda_usb_ss_dp_core_2:
136		vdda_qlink_lv:
137		vdda_qlink_lv_ck:
138		vreg_l5a_0p875: ldo5 {
139			regulator-min-microvolt = <880000>;
140			regulator-max-microvolt = <880000>;
141			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
142		};
143
144		vreg_l6a_1p2: ldo6 {
145			regulator-min-microvolt = <1200000>;
146			regulator-max-microvolt = <1200000>;
147			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
148		};
149
150		vreg_l7a_1p8: ldo7 {
151			regulator-min-microvolt = <1800000>;
152			regulator-max-microvolt = <1800000>;
153			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
154		};
155
156		vddpx_10:
157		vreg_l9a_1p2: ldo9 {
158			regulator-min-microvolt = <1200000>;
159			regulator-max-microvolt = <1200000>;
160			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
161		};
162
163		vreg_l10a_2p5: ldo10 {
164			regulator-min-microvolt = <2504000>;
165			regulator-max-microvolt = <2960000>;
166			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
167		};
168
169		vreg_l11a_0p8: ldo11 {
170			regulator-min-microvolt = <800000>;
171			regulator-max-microvolt = <800000>;
172			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
173		};
174
175		vdd_qfprom:
176		vdd_qfprom_sp:
177		vdda_apc_cs_1p8:
178		vdda_gfx_cs_1p8:
179		vdda_usb_hs_1p8:
180		vdda_qrefs_vref_1p8:
181		vddpx_10_a:
182		vreg_l12a_1p8: ldo12 {
183			regulator-min-microvolt = <1800000>;
184			regulator-max-microvolt = <1800000>;
185			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
186		};
187
188		vreg_l13a_2p7: ldo13 {
189			regulator-min-microvolt = <2704000>;
190			regulator-max-microvolt = <2704000>;
191			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
192		};
193
194		vreg_l14a_1p8: ldo14 {
195			regulator-min-microvolt = <1800000>;
196			regulator-max-microvolt = <1880000>;
197			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
198		};
199
200		vreg_l15a_1p7: ldo15 {
201			regulator-min-microvolt = <1704000>;
202			regulator-max-microvolt = <1704000>;
203			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
204		};
205
206		vreg_l16a_2p7: ldo16 {
207			regulator-min-microvolt = <2704000>;
208			regulator-max-microvolt = <2960000>;
209			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
210		};
211
212		vreg_l17a_3p0: ldo17 {
213			regulator-min-microvolt = <2856000>;
214			regulator-max-microvolt = <3008000>;
215			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
216		};
217	};
218
219	pm8150l-rpmh-regulators {
220		compatible = "qcom,pm8150l-rpmh-regulators";
221		qcom,pmic-id = "c";
222
223		vdd-s1-supply = <&vph_pwr>;
224		vdd-s2-supply = <&vph_pwr>;
225		vdd-s3-supply = <&vph_pwr>;
226		vdd-s4-supply = <&vph_pwr>;
227		vdd-s5-supply = <&vph_pwr>;
228		vdd-s6-supply = <&vph_pwr>;
229		vdd-s7-supply = <&vph_pwr>;
230		vdd-s8-supply = <&vph_pwr>;
231
232		vdd-l1-l8-supply = <&vreg_s4a_1p8>;
233		vdd-l2-l3-supply = <&vreg_s8c_1p3>;
234		vdd-l4-l5-l6-supply = <&vreg_bob>;
235		vdd-l7-l11-supply = <&vreg_bob>;
236		vdd-l9-l10-supply = <&vreg_bob>;
237
238		vdd-bob-supply = <&vph_pwr>;
239		vdd-flash-supply = <&vreg_bob>;
240		vdd-rgb-supply = <&vreg_bob>;
241
242		vreg_bob: bob {
243			regulator-min-microvolt = <3008000>;
244			regulator-max-microvolt = <4000000>;
245			regulator-initial-mode = <RPMH_REGULATOR_MODE_AUTO>;
246			regulator-allow-bypass;
247		};
248
249		vreg_s8c_1p3: smps8 {
250			regulator-min-microvolt = <1352000>;
251			regulator-max-microvolt = <1352000>;
252		};
253
254		vreg_l1c_1p8: ldo1 {
255			regulator-min-microvolt = <1800000>;
256			regulator-max-microvolt = <1800000>;
257			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
258		};
259
260		vdda_wcss_adcdac_1:
261		vdda_wcss_adcdac_22:
262		vreg_l2c_1p3: ldo2 {
263			regulator-min-microvolt = <1304000>;
264			regulator-max-microvolt = <1304000>;
265			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
266		};
267
268		vdda_hv_ebi0:
269		vdda_hv_ebi1:
270		vdda_hv_ebi2:
271		vdda_hv_ebi3:
272		vdda_hv_refgen0:
273		vdda_qlink_hv_ck:
274		vreg_l3c_1p2: ldo3 {
275			regulator-min-microvolt = <1200000>;
276			regulator-max-microvolt = <1200000>;
277			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
278		};
279
280		vddpx_5:
281		vreg_l4c_1p8: ldo4 {
282			regulator-min-microvolt = <1704000>;
283			regulator-max-microvolt = <2928000>;
284			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
285		};
286
287		vddpx_6:
288		vreg_l5c_1p8: ldo5 {
289			regulator-min-microvolt = <1704000>;
290			regulator-max-microvolt = <2928000>;
291			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
292		};
293
294		vddpx_2:
295		vreg_l6c_2p9: ldo6 {
296			regulator-min-microvolt = <1800000>;
297			regulator-max-microvolt = <2960000>;
298			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
299		};
300
301		vreg_l7c_3p0: ldo7 {
302			regulator-min-microvolt = <2856000>;
303			regulator-max-microvolt = <3104000>;
304			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
305		};
306
307		vreg_l8c_1p8: ldo8 {
308			regulator-min-microvolt = <1800000>;
309			regulator-max-microvolt = <1800000>;
310			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
311		};
312
313		vreg_l9c_2p9: ldo9 {
314			regulator-min-microvolt = <2704000>;
315			regulator-max-microvolt = <2960000>;
316			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
317		};
318
319		vreg_l10c_3p3: ldo10 {
320			regulator-min-microvolt = <3000000>;
321			regulator-max-microvolt = <3312000>;
322			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
323		};
324
325		vreg_l11c_3p3: ldo11 {
326			regulator-min-microvolt = <3000000>;
327			regulator-max-microvolt = <3312000>;
328			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
329		};
330	};
331
332	pm8009-rpmh-regulators {
333		compatible = "qcom,pm8009-rpmh-regulators";
334		qcom,pmic-id = "f";
335
336		vdd-s1-supply = <&vph_pwr>;
337		vdd-s2-supply = <&vreg_bob>;
338
339		vdd-l2-supply = <&vreg_s8c_1p3>;
340		vdd-l5-l6-supply = <&vreg_bob>;
341
342		vreg_l2f_1p2: ldo2 {
343			regulator-min-microvolt = <1200000>;
344			regulator-max-microvolt = <1200000>;
345			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
346		};
347
348		vreg_l5f_2p85: ldo5 {
349			regulator-min-microvolt = <2800000>;
350			regulator-max-microvolt = <2800000>;
351			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
352		};
353
354		vreg_l6f_2p85: ldo6 {
355			regulator-initial-mode = <RPMH_REGULATOR_MODE_HPM>;
356			regulator-min-microvolt = <2856000>;
357			regulator-max-microvolt = <2856000>;
358		};
359	};
360};
361
362&i2c1 {
363	status = "okay";
364	clock-frequency = <400000>;
365
366	bq27742@55 {
367		compatible = "ti,bq27742";
368		reg = <0x55>;
369	};
370
371	da7280@4a {
372		compatible = "dlg,da7280";
373		reg = <0x4a>;
374		interrupts-extended = <&tlmm 42 IRQ_TYPE_LEVEL_LOW>;
375		pinctrl-names = "da7280_default";
376		pinctrl-0 = <&da7280_intr_default>;
377
378		dlg,actuator-type = "LRA";
379		dlg,dlg,const-op-mode = <1>;
380		dlg,dlg,periodic-op-mode = <1>;
381		dlg,nom-microvolt = <2000000>;
382		dlg,abs-max-microvolt = <2000000>;
383		dlg,imax-microamp = <129000>;
384		dlg,resonant-freq-hz = <180>;
385		dlg,impd-micro-ohms = <14300000>;
386		dlg,freq-track-enable;
387		dlg,bemf-sens-enable;
388		dlg,mem-array = <
389		  0x06 0x08 0x10 0x11 0x12 0x13 0x14 0x15 0x1c 0x2a
390		  0x33 0x3c 0x42 0x4b 0x4c 0x4e 0x17 0x19 0x27 0x29
391		  0x17 0x19 0x03 0x84 0x5e 0x04 0x08 0x84 0x5d 0x01
392		  0x84 0x5e 0x02 0x00 0xa4 0x5d 0x03 0x84 0x5e 0x06
393		  0x08 0x84 0x5d 0x05 0x84 0x5d 0x06 0x84 0x5e 0x08
394		  0x84 0x5e 0x05 0x8c 0x5e 0x24 0x84 0x5f 0x10 0x84
395		  0x5e 0x05 0x84 0x5e 0x08 0x84 0x5f 0x01 0x8c 0x5e
396		  0x04 0x84 0x5e 0x08 0x84 0x5f 0x11 0x19 0x88 0x00
397		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
398		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
399		>;
400	};
401
402	/* SMB1381 @ 0x44 */
403	/* MAX34417 @ 0x1c */
404};
405
406&i2c4 {
407	status = "okay";
408	clock-frequency = <400000>;
409
410	/* SMB1355 @ 0x0c */
411	/* SMB1390 @ 0x10 */
412};
413
414&i2c17 {
415	status = "okay";
416	clock-frequency = <400000>;
417
418	bq27742@55 {
419		compatible = "ti,bq27742";
420		reg = <0x55>;
421	};
422};
423
424&i2c19 {
425	status = "okay";
426	clock-frequency = <400000>;
427
428	/* MAX34417 @ 0x12 */
429	/* MAX34417 @ 0x1a */
430	/* MAX34417 @ 0x1e */
431};
432
433&pon {
434	pwrkey {
435		status = "okay";
436	};
437
438	resin {
439		compatible = "qcom,pm8941-resin";
440		interrupts = <0x0 0x8 0x1 IRQ_TYPE_EDGE_BOTH>;
441		debounce = <15625>;
442		bias-pull-up;
443		linux,code = <KEY_VOLUMEDOWN>;
444	};
445};
446
447&qupv3_id_0 {
448	status = "okay";
449};
450
451&qupv3_id_1 {
452	status = "okay";
453};
454
455&qupv3_id_2 {
456	status = "okay";
457};
458
459&remoteproc_adsp {
460	status = "okay";
461	firmware-name = "qcom/sm8150/microsoft/adsp.mdt";
462};
463
464&remoteproc_cdsp {
465	status = "okay";
466	firmware-name = "qcom/sm8150/microsoft/cdsp.mdt";
467};
468
469&remoteproc_mpss {
470	status = "okay";
471	firmware-name = "qcom/sm8150/microsoft/modem.mdt";
472};
473
474&remoteproc_slpi {
475	status = "okay";
476	firmware-name = "qcom/sm8150/microsoft/slpi.mdt";
477};
478
479&tlmm {
480	gpio-reserved-ranges = <126 4>;
481
482	da7280_intr_default: da7280-intr-default {
483		pins = "gpio42";
484		function = "gpio";
485		bias-pull-up;
486		input-enable;
487	};
488};
489
490&uart2 {
491	status = "okay";
492};
493
494&ufs_mem_hc {
495	status = "okay";
496
497	reset-gpios = <&tlmm 175 GPIO_ACTIVE_LOW>;
498
499	vcc-supply = <&vreg_l10a_2p5>;
500	vcc-max-microamp = <750000>;
501	vccq-supply = <&vreg_l9a_1p2>;
502	vccq-max-microamp = <700000>;
503	vccq2-supply = <&vreg_s4a_1p8>;
504	vccq2-max-microamp = <750000>;
505};
506
507&ufs_mem_phy {
508	status = "okay";
509
510	vdda-phy-supply = <&vdda_ufs_2ln_core_1>;
511	vdda-pll-supply = <&vreg_l3c_1p2>;
512};
513
514&usb_1_hsphy {
515	status = "okay";
516	vdda-pll-supply = <&vdd_usb_hs_core>;
517	vdda33-supply = <&vdda_usb_hs_3p1>;
518	vdda18-supply = <&vdda_usb_hs_1p8>;
519};
520
521&usb_1_qmpphy {
522	status = "okay";
523	vdda-phy-supply = <&vreg_l3c_1p2>;
524	vdda-pll-supply = <&vdda_usb_ss_dp_core_1>;
525};
526
527&usb_1 {
528	status = "okay";
529};
530
531&usb_1_dwc3 {
532	dr_mode = "peripheral";
533};
534
535&wifi {
536	status = "okay";
537
538	vdd-0.8-cx-mx-supply = <&vdda_wcss_pll>;
539	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
540	vdd-1.3-rfa-supply = <&vdda_wcss_adcdac_1>;
541	vdd-3.3-ch0-supply = <&vreg_l11c_3p3>;
542};
543