1// SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause)
2/*
3 * Copyright (c) 2022 Linaro Limited
4 */
5
6/dts-v1/;
7
8#include "sm6115.dtsi"
9#include "pm6125.dtsi"
10
11/ {
12	model = "Lenovo Tab P11";
13	compatible = "lenovo,j606f", "qcom,sm6115p", "qcom,sm6115";
14	chassis-type = "tablet";
15
16	/* required for bootloader to select correct board */
17	qcom,msm-id = <445 0x10000>, <420 0x10000>;
18	qcom,board-id = <34 3>;
19
20	aliases {
21		mmc0 = &sdhc_2;
22	};
23
24	chosen {
25		#address-cells = <2>;
26		#size-cells = <2>;
27		ranges;
28
29		framebuffer0: framebuffer@5c000000 {
30			compatible = "simple-framebuffer";
31			reg = <0 0x5c000000 0 (2000 * 1200 * 4)>;
32			width = <1200>;
33			height = <2000>;
34			stride = <(1200 * 4)>;
35			format = "a8r8g8b8";
36			clocks = <&gcc GCC_DISP_HF_AXI_CLK>;
37		};
38	};
39
40	gpio-keys {
41		compatible = "gpio-keys";
42
43		pinctrl-names = "default";
44		pinctrl-0 = <&vol_up_n>;
45
46		key-volume-up {
47			label = "Volume Up";
48			linux,code = <KEY_VOLUMEUP>;
49			gpios = <&pm6125_gpios 5 GPIO_ACTIVE_LOW>;
50			debounce-interval = <15>;
51			linux,can-disable;
52			gpio-key,wakeup;
53		};
54	};
55};
56
57&dispcc {
58	/* HACK: disable until a panel driver is ready to retain simplefb */
59	status = "disabled";
60};
61
62&pm6125_gpios {
63	vol_up_n: vol-up-n-state {
64		pins = "gpio5";
65		function = "normal";
66		power-source = <0>;
67		bias-pull-up;
68		input-enable;
69	};
70};
71
72&pon_pwrkey {
73	status = "okay";
74};
75
76&pon_resin {
77	linux,code = <KEY_VOLUMEDOWN>;
78	status = "okay";
79};
80
81&rpm_requests {
82	regulators-0 {
83		compatible = "qcom,rpm-pm6125-regulators";
84
85		pm6125_s6: s6 {
86			regulator-min-microvolt = <304000>;
87			regulator-max-microvolt = <1456000>;
88		};
89
90		pm6125_s7: s7 {
91			regulator-min-microvolt = <1280000>;
92			regulator-max-microvolt = <2080000>;
93		};
94
95		pm6125_s8: s8 {
96			regulator-min-microvolt = <1064000>;
97			regulator-max-microvolt = <1304000>;
98		};
99
100		pm6125_l1: l1 {
101			regulator-min-microvolt = <952000>;
102			regulator-max-microvolt = <1152000>;
103		};
104
105		pm6125_l4: l4 {
106			regulator-min-microvolt = <488000>;
107			regulator-max-microvolt = <1000000>;
108		};
109
110		pm6125_l5: l5 {
111			regulator-min-microvolt = <1648000>;
112			/* 3.056V capped to 2.96V for SDHCI */
113			regulator-max-microvolt = <2960000>;
114			regulator-allow-set-load;
115			/* Broken hw, this one can't be turned off or SDHCI will break! */
116			regulator-always-on;
117		};
118
119		pm6125_l6: l6 {
120			regulator-min-microvolt = <576000>;
121			regulator-max-microvolt = <656000>;
122		};
123
124		pm6125_l7: l7 {
125			/* 1.2V-1.304V fixed at 1.256V for SDHCI bias */
126			regulator-min-microvolt = <1256000>;
127			regulator-max-microvolt = <1256000>;
128			/*
129			 * TODO: SDHCI seems to also work with this one turned off, however
130			 * there exists a possibility that it may not work with some very
131			 * specific SDCard types, perhaps validating this against a wide
132			 * range of models could rule that out, saving some power would
133			 * certainly be nice..
134			 */
135			regulator-always-on;
136		};
137
138		pm6125_l8: l8 {
139			regulator-min-microvolt = <400000>;
140			regulator-max-microvolt = <728000>;
141		};
142
143		pm6125_l9: l9 {
144			regulator-min-microvolt = <1800000>;
145			regulator-max-microvolt = <2000000>;
146		};
147
148		pm6125_l10: l10 {
149			regulator-min-microvolt = <1704000>;
150			regulator-max-microvolt = <1904000>;
151		};
152
153		pm6125_l11: l11 {
154			regulator-min-microvolt = <1704000>;
155			regulator-max-microvolt = <1952000>;
156		};
157
158		pm6125_l12: l12 {
159			regulator-min-microvolt = <1624000>;
160			regulator-max-microvolt = <1984000>;
161		};
162
163		pm6125_l13: l13 {
164			regulator-min-microvolt = <1504000>;
165			regulator-max-microvolt = <1952000>;
166		};
167
168		pm6125_l14: l14 {
169			regulator-min-microvolt = <1704000>;
170			regulator-max-microvolt = <1904000>;
171		};
172
173		pm6125_l15: l15 {
174			regulator-min-microvolt = <2920000>;
175			regulator-max-microvolt = <3232000>;
176		};
177
178		pm6125_l16: l16 {
179			regulator-min-microvolt = <1704000>;
180			regulator-max-microvolt = <1904000>;
181		};
182
183		pm6125_l17: l17 {
184			regulator-min-microvolt = <1152000>;
185			regulator-max-microvolt = <1384000>;
186		};
187
188		pm6125_l18: l18 {
189			regulator-min-microvolt = <1104000>;
190			regulator-max-microvolt = <1312000>;
191		};
192
193		pm6125_l19: l19 {
194			regulator-min-microvolt = <1624000>;
195			regulator-max-microvolt = <3304000>;
196		};
197
198		pm6125_l20: l20 {
199			regulator-min-microvolt = <1624000>;
200			regulator-max-microvolt = <3304000>;
201		};
202
203		pm6125_l21: l21 {
204			regulator-min-microvolt = <2400000>;
205			regulator-max-microvolt = <3600000>;
206		};
207
208		pm6125_l22: l22 {
209			regulator-min-microvolt = <2952000>;
210			/* 3.304V capped to 2.96V for SDHCI */
211			regulator-max-microvolt = <2960000>;
212			regulator-allow-set-load;
213			/* Broken hw, this one can't be turned off or SDHCI will break! */
214			regulator-always-on;
215		};
216
217		pm6125_l23: l23 {
218			regulator-min-microvolt = <3200000>;
219			regulator-max-microvolt = <3400000>;
220		};
221
222		pm6125_l24: l24 {
223			regulator-min-microvolt = <2704000>;
224			regulator-max-microvolt = <3600000>;
225		};
226	};
227};
228
229&sdhc_2 {
230	cd-gpios = <&tlmm 88 GPIO_ACTIVE_HIGH>;
231	pinctrl-names = "default", "sleep";
232	pinctrl-0 = <&sdc2_state_on &sdc2_gate_pin>;
233	pinctrl-1 = <&sdc2_state_off>;
234	vmmc-supply = <&pm6125_l22>;
235	vqmmc-supply = <&pm6125_l5>;
236	no-sdio;
237	no-mmc;
238	status = "okay";
239};
240
241&sleep_clk {
242	clock-frequency = <32764>;
243};
244
245&tlmm {
246	gpio-reserved-ranges = <14 4>;
247
248	/*
249	 * This is a wholly undocumented pin (other than a single vague "pwr-gpios" reference)
250	 * that needs to be toggled for the SD Card slot to work properly..
251	 */
252	sdc2_gate_pin: sdc2-gate-state {
253		pins = "gpio45";
254		function = "gpio";
255		drive-strength = <2>;
256		bias-pull-up;
257		output-high;
258	};
259};
260
261&ufs_mem_hc {
262	vcc-supply = <&pm6125_l24>;
263	vcc-max-microamp = <600000>;
264	vccq2-supply = <&pm6125_l11>;
265	vccq2-max-microamp = <600000>;
266	status = "okay";
267};
268
269&ufs_mem_phy {
270	vdda-phy-supply = <&pm6125_l4>;
271	vdda-pll-supply = <&pm6125_l12>;
272	vddp-ref-clk-supply = <&pm6125_l18>;
273	status = "okay";
274};
275
276&usb_1 {
277	status = "okay";
278};
279
280&usb_1_hsphy {
281	vdd-supply = <&pm6125_l4>;
282	vdda-pll-supply = <&pm6125_l12>;
283	vdda-phy-dpdm-supply = <&pm6125_l15>;
284	status = "okay";
285};
286
287&xo_board {
288	clock-frequency = <19200000>;
289};
290