1// SPDX-License-Identifier: GPL-2.0
2/* Copyright (c) 2019, Jeffrey Hugo. All rights reserved. */
3
4/*
5 * Common include for MSM8998 clamshell devices, ie the Lenovo Miix 630,
6 * Asus NovaGo TP370QL, and HP Envy x2.  All three devices are basically the
7 * same, with differences in peripherals.
8 */
9
10#include "msm8998.dtsi"
11#include "pm8998.dtsi"
12#include "pm8005.dtsi"
13
14/ {
15	chosen {
16	};
17
18	vph_pwr: vph-pwr-regulator {
19		compatible = "regulator-fixed";
20		regulator-name = "vph_pwr";
21		regulator-always-on;
22		regulator-boot-on;
23	};
24};
25
26&blsp1_uart3 {
27	status = "okay";
28
29	bluetooth {
30		compatible = "qcom,wcn3990-bt";
31
32		vddio-supply = <&vreg_s4a_1p8>;
33		vddxo-supply = <&vreg_l7a_1p8>;
34		vddrf-supply = <&vreg_l17a_1p3>;
35		vddch0-supply = <&vreg_l25a_3p3>;
36		max-speed = <3200000>;
37	};
38};
39
40/*
41 * The laptop FW does not appear to support the retention state as it is
42 * not advertised as enabled in ACPI, and enabling it in DT can cause boot
43 * hangs.
44 */
45&CPU0 {
46	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
47};
48
49&CPU1 {
50	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
51};
52
53&CPU2 {
54	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
55};
56
57&CPU3 {
58	cpu-idle-states = <&LITTLE_CPU_SLEEP_1>;
59};
60
61&CPU4 {
62	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
63};
64
65&CPU5 {
66	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
67};
68
69&CPU6 {
70	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
71};
72
73&CPU7 {
74	cpu-idle-states = <&BIG_CPU_SLEEP_1>;
75};
76
77&pcie0 {
78	status = "okay";
79};
80
81&pcie_phy {
82	status = "okay";
83};
84
85&pm8005_lsid1 {
86	pm8005-regulators {
87		compatible = "qcom,pm8005-regulators";
88
89		vdd_s1-supply = <&vph_pwr>;
90
91		pm8005_s1: s1 { /* VDD_GFX supply */
92			regulator-min-microvolt = <524000>;
93			regulator-max-microvolt = <1100000>;
94			regulator-enable-ramp-delay = <500>;
95
96			/* hack until we rig up the gpu consumer */
97			regulator-always-on;
98		};
99	};
100};
101
102&qusb2phy {
103	status = "okay";
104
105	vdda-pll-supply = <&vreg_l12a_1p8>;
106	vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
107};
108
109&rpm_requests {
110	pm8998-regulators {
111		compatible = "qcom,rpm-pm8998-regulators";
112
113		vdd_s1-supply = <&vph_pwr>;
114		vdd_s2-supply = <&vph_pwr>;
115		vdd_s3-supply = <&vph_pwr>;
116		vdd_s4-supply = <&vph_pwr>;
117		vdd_s5-supply = <&vph_pwr>;
118		vdd_s6-supply = <&vph_pwr>;
119		vdd_s7-supply = <&vph_pwr>;
120		vdd_s8-supply = <&vph_pwr>;
121		vdd_s9-supply = <&vph_pwr>;
122		vdd_s10-supply = <&vph_pwr>;
123		vdd_s11-supply = <&vph_pwr>;
124		vdd_s12-supply = <&vph_pwr>;
125		vdd_s13-supply = <&vph_pwr>;
126		vdd_l1_l27-supply = <&vreg_s7a_1p025>;
127		vdd_l2_l8_l17-supply = <&vreg_s3a_1p35>;
128		vdd_l3_l11-supply = <&vreg_s7a_1p025>;
129		vdd_l4_l5-supply = <&vreg_s7a_1p025>;
130		vdd_l6-supply = <&vreg_s5a_2p04>;
131		vdd_l7_l12_l14_l15-supply = <&vreg_s5a_2p04>;
132		vdd_l9-supply = <&vph_pwr>;
133		vdd_l10_l23_l25-supply = <&vph_pwr>;
134		vdd_l13_l19_l21-supply = <&vph_pwr>;
135		vdd_l16_l28-supply = <&vph_pwr>;
136		vdd_l18_l22-supply = <&vph_pwr>;
137		vdd_l20_l24-supply = <&vph_pwr>;
138		vdd_l26-supply = <&vreg_s3a_1p35>;
139		vdd_lvs1_lvs2-supply = <&vreg_s4a_1p8>;
140
141		vreg_s3a_1p35: s3 {
142			regulator-min-microvolt = <1352000>;
143			regulator-max-microvolt = <1352000>;
144		};
145		vreg_s4a_1p8: s4 {
146			regulator-min-microvolt = <1800000>;
147			regulator-max-microvolt = <1800000>;
148			regulator-allow-set-load;
149		};
150		vreg_s5a_2p04: s5 {
151			regulator-min-microvolt = <1904000>;
152			regulator-max-microvolt = <2040000>;
153		};
154		vreg_s7a_1p025: s7 {
155			regulator-min-microvolt = <900000>;
156			regulator-max-microvolt = <1028000>;
157		};
158		vreg_l1a_0p875: l1 {
159			regulator-min-microvolt = <880000>;
160			regulator-max-microvolt = <880000>;
161			regulator-allow-set-load;
162		};
163		vreg_l2a_1p2: l2 {
164			regulator-min-microvolt = <1200000>;
165			regulator-max-microvolt = <1200000>;
166			regulator-allow-set-load;
167		};
168		vreg_l3a_1p0: l3 {
169			regulator-min-microvolt = <1000000>;
170			regulator-max-microvolt = <1000000>;
171		};
172		vreg_l5a_0p8: l5 {
173			regulator-min-microvolt = <800000>;
174			regulator-max-microvolt = <800000>;
175		};
176		vreg_l6a_1p8: l6 {
177			regulator-min-microvolt = <1808000>;
178			regulator-max-microvolt = <1808000>;
179		};
180		vreg_l7a_1p8: l7 {
181			regulator-min-microvolt = <1800000>;
182			regulator-max-microvolt = <1800000>;
183			regulator-allow-set-load;
184		};
185		vreg_l8a_1p2: l8 {
186			regulator-min-microvolt = <1200000>;
187			regulator-max-microvolt = <1200000>;
188		};
189		vreg_l9a_1p8: l9 {
190			regulator-min-microvolt = <1808000>;
191			regulator-max-microvolt = <2960000>;
192		};
193		vreg_l10a_1p8: l10 {
194			regulator-min-microvolt = <1808000>;
195			regulator-max-microvolt = <2960000>;
196		};
197		vreg_l11a_1p0: l11 {
198			regulator-min-microvolt = <1000000>;
199			regulator-max-microvolt = <1000000>;
200		};
201		vreg_l12a_1p8: l12 {
202			regulator-min-microvolt = <1800000>;
203			regulator-max-microvolt = <1800000>;
204		};
205		vreg_l13a_2p95: l13 {
206			regulator-min-microvolt = <1808000>;
207			regulator-max-microvolt = <2960000>;
208		};
209		vreg_l14a_1p88: l14 {
210			regulator-min-microvolt = <1880000>;
211			regulator-max-microvolt = <1880000>;
212		};
213		vreg_l15a_1p8: l15 {
214			regulator-min-microvolt = <1800000>;
215			regulator-max-microvolt = <1800000>;
216		};
217		vreg_l16a_2p7: l16 {
218			regulator-min-microvolt = <2704000>;
219			regulator-max-microvolt = <2704000>;
220		};
221		vreg_l17a_1p3: l17 {
222			regulator-min-microvolt = <1304000>;
223			regulator-max-microvolt = <1304000>;
224			regulator-allow-set-load;
225		};
226		vreg_l18a_2p7: l18 {
227			regulator-min-microvolt = <2704000>;
228			regulator-max-microvolt = <2704000>;
229		};
230		vreg_l19a_3p0: l19 {
231			regulator-min-microvolt = <3008000>;
232			regulator-max-microvolt = <3008000>;
233		};
234		vreg_l20a_2p95: l20 {
235			regulator-min-microvolt = <2960000>;
236			regulator-max-microvolt = <2960000>;
237			regulator-allow-set-load;
238		};
239		vreg_l21a_2p95: l21 {
240			regulator-min-microvolt = <2960000>;
241			regulator-max-microvolt = <2960000>;
242			regulator-allow-set-load;
243			regulator-system-load = <800000>;
244		};
245		vreg_l22a_2p85: l22 {
246			regulator-min-microvolt = <2864000>;
247			regulator-max-microvolt = <2864000>;
248		};
249		vreg_l23a_3p3: l23 {
250			regulator-min-microvolt = <3312000>;
251			regulator-max-microvolt = <3312000>;
252		};
253		vreg_l24a_3p075: l24 {
254			regulator-min-microvolt = <3088000>;
255			regulator-max-microvolt = <3088000>;
256		};
257		vreg_l25a_3p3: l25 {
258			regulator-min-microvolt = <3104000>;
259			regulator-max-microvolt = <3312000>;
260			regulator-allow-set-load;
261		};
262		vreg_l26a_1p2: l26 {
263			regulator-min-microvolt = <1200000>;
264			regulator-max-microvolt = <1200000>;
265		};
266		vreg_l28_3p0: l28 {
267			regulator-min-microvolt = <3008000>;
268			regulator-max-microvolt = <3008000>;
269		};
270
271		vreg_lvs1a_1p8: lvs1 {
272			regulator-min-microvolt = <1800000>;
273			regulator-max-microvolt = <1800000>;
274		};
275
276		vreg_lvs2a_1p8: lvs2 {
277			regulator-min-microvolt = <1800000>;
278			regulator-max-microvolt = <1800000>;
279		};
280
281	};
282};
283
284&tlmm {
285	gpio-reserved-ranges = <0 4>, <81 4>;
286
287	touchpad: touchpad {
288		config {
289			pins = "gpio123";
290			bias-pull-up;           /* pull up */
291		};
292	};
293};
294
295&sdhc2 {
296	status = "okay";
297
298	vmmc-supply = <&vreg_l21a_2p95>;
299	vqmmc-supply = <&vreg_l13a_2p95>;
300
301	pinctrl-names = "default", "sleep";
302	pinctrl-0 = <&sdc2_clk_on  &sdc2_cmd_on  &sdc2_data_on  &sdc2_cd_on>;
303	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
304};
305
306&ufshc {
307	status = "okay";
308};
309
310&ufsphy {
311	status = "okay";
312};
313
314&usb3 {
315	status = "okay";
316};
317
318&usb3_dwc3 {
319	dr_mode = "host"; /* Force to host until we have Type-C hooked up */
320};
321
322&usb3phy {
323	status = "okay";
324
325	vdda-phy-supply = <&vreg_l1a_0p875>;
326	vdda-pll-supply = <&vreg_l2a_1p2>;
327};
328
329&wifi {
330	status = "okay";
331
332	vdd-0.8-cx-mx-supply = <&vreg_l5a_0p8>;
333	vdd-1.8-xo-supply = <&vreg_l7a_1p8>;
334	vdd-1.3-rfa-supply = <&vreg_l17a_1p3>;
335	vdd-3.3-ch0-supply = <&vreg_l25a_3p3>;
336};
337
338/* PINCTRL - board-specific pinctrl */
339&blsp1_uart3_on {
340	rx {
341		/delete-property/ bias-disable;
342		/*
343		 * Configure a pull-up on 45 (RX). This is needed to
344		 * avoid garbage data when the TX pin of the Bluetooth
345		 * module is in tri-state (module powered off or not
346		 * driving the signal yet).
347		 */
348		bias-pull-up;
349	};
350
351	cts {
352		/delete-property/ bias-disable;
353		/*
354		 * Configure a pull-down on 47 (CTS) to match the pull
355		 * of the Bluetooth module.
356		 */
357		bias-pull-down;
358	};
359};
360