xref: /linux/scripts/dtc/include-prefixes/arm/qcom/qcom-msm8226-microsoft-common.dtsi (revision 3a39d672e7f48b8d6b91a09afa4b55352773b4b5)
1// SPDX-License-Identifier: BSD-3-Clause
2/*
3 * Common Board Device Tree for Microsoft MSM8x26-based Lumias
4 *
5 * Copyright (c) 2023, Jack Matthews <jm5112356@gmail.com>
6 * Copyright (c) 2023, Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>
7 * Copyright (c) 2023, Dominik Kobinski <dominikkobinski314@gmail.com>
8 * Copyright (c) 2023, Rayyan Ansari <rayyan@ansari.sh>
9 */
10
11#include "qcom-msm8226.dtsi"
12#include "pm8226.dtsi"
13#include <dt-bindings/input/input.h>
14
15/*
16 * Delete all generic (msm8226.dtsi) reserved
17 * memory mappings which are different on these devices.
18 */
19/delete-node/ &smem_region;
20
21/ {
22	aliases {
23		mmc0 = &sdhc_1; /* eMMC */
24		mmc1 = &sdhc_2; /* microSD */
25		display0 = &framebuffer;
26	};
27
28	chosen {
29		#address-cells = <1>;
30		#size-cells = <1>;
31		ranges;
32
33		stdout-path = "display0";
34
35		framebuffer: framebuffer@3200000 {
36			compatible = "simple-framebuffer";
37			reg = <0x3200000 0x800000>;
38			format = "a8r8g8b8";
39			width = <720>;
40			height = <1280>;
41			stride = <(720 * 4)>;
42
43			clocks = <&mmcc MDSS_AHB_CLK>,
44				 <&mmcc MDSS_AXI_CLK>,
45				 <&mmcc MDSS_BYTE0_CLK>,
46				 <&mmcc MDSS_MDP_CLK>,
47				 <&mmcc MDSS_PCLK0_CLK>,
48				 <&mmcc MDSS_VSYNC_CLK>;
49			power-domains = <&mmcc MDSS_GDSC>;
50		};
51	};
52
53	gpio_keys: gpio-keys {
54		compatible = "gpio-keys";
55
56		pinctrl-0 = <&gpio_keys_default>;
57		pinctrl-names = "default";
58
59		label = "GPIO Buttons";
60
61		key-volume-up {
62			label = "Volume Up";
63			gpios = <&tlmm 106 GPIO_ACTIVE_LOW>;
64			linux,code = <KEY_VOLUMEUP>;
65		};
66	};
67
68	/*
69	 * This device being a WP platform has a different
70	 * memory layout than other Android based devices.
71	 * This smem memory region is directly copied from
72	 * the original UEFI firmware.
73	 */
74	reserved-memory {
75		display_reserved: framebuffer@3200000 {
76			reg = <0x03200000 0x800000>;
77			no-map;
78		};
79
80		smem_region: smem@fa00000 {
81			reg = <0x0fa00000 0x100000>;
82			no-map;
83		};
84	};
85};
86
87&blsp1_i2c2 {
88	status = "okay";
89
90	magnetometer: magnetometer@c {
91		compatible = "asahi-kasei,ak09911";
92		reg = <0x0c>;
93
94		vdd-supply = <&pm8226_l15>;
95		vid-supply = <&pm8226_l6>;
96	};
97
98	accelerometer: accelerometer@1e {
99		compatible = "kionix,kx022-1020";
100		reg = <0x1e>;
101
102		interrupts-extended = <&tlmm 63 IRQ_TYPE_EDGE_RISING>;
103
104		vdd-supply = <&pm8226_l15>;
105		vddio-supply = <&pm8226_l6>;
106
107		mount-matrix = "1",  "0",  "0",
108			       "0", "-1",  "0",
109			       "0",  "0",  "1";
110	};
111};
112
113&blsp1_i2c5 {
114	status = "okay";
115
116	touchscreen: touchscreen@4b {
117		compatible = "syna,rmi4-i2c";
118		reg = <0x4b>;
119
120		interrupts-extended = <&tlmm 17 IRQ_TYPE_EDGE_FALLING>;
121		vdd-supply = <&pm8226_l15>;
122		vio-supply = <&pm8226_l6>;
123
124		pinctrl-0 = <&touchscreen_default>;
125		pinctrl-names = "default";
126
127		#address-cells = <1>;
128		#size-cells = <0>;
129
130		rmi4-f01@1 {
131			reg = <0x01>;
132			syna,nosleep-mode = <1>;
133		};
134
135		rmi4-f11@11 {
136			reg = <0x11>;
137			syna,sensor-type = <1>;
138		};
139	};
140};
141
142&blsp1_uart3 {
143	status = "okay";
144};
145
146&pm8226_resin {
147	linux,code = <KEY_VOLUMEDOWN>;
148	status = "okay";
149};
150
151&pm8226_vib {
152	status = "okay";
153};
154
155&rpm_requests {
156	regulators {
157		compatible = "qcom,rpm-pm8226-regulators";
158
159		/* These values were taken from the original firmware DSDT */
160		pm8226_s1: s1 {
161			regulator-min-microvolt = <1050000>;
162			regulator-max-microvolt = <1050000>;
163		};
164
165		pm8226_s3: s3 {
166			regulator-min-microvolt = <1300000>;
167			regulator-max-microvolt = <1300000>;
168		};
169
170		pm8226_s4: s4 {
171			regulator-min-microvolt = <1800000>;
172			regulator-max-microvolt = <2100000>;
173		};
174
175		pm8226_s5: s5 {
176			regulator-min-microvolt = <1150000>;
177			regulator-max-microvolt = <1150000>;
178		};
179
180		pm8226_l3: l3 {
181			regulator-min-microvolt = <750000>;
182			regulator-max-microvolt = <1150000>;
183		};
184
185		pm8226_l4: l4 {
186			regulator-min-microvolt = <1200000>;
187			regulator-max-microvolt = <1200000>;
188		};
189
190		pm8226_l5: l5 {
191			regulator-min-microvolt = <1200000>;
192			regulator-max-microvolt = <1200000>;
193		};
194
195		pm8226_l6: l6 {
196			regulator-min-microvolt = <1800000>;
197			regulator-max-microvolt = <1800000>;
198		};
199
200		pm8226_l7: l7 {
201			regulator-min-microvolt = <1850000>;
202			regulator-max-microvolt = <1850000>;
203		};
204
205		pm8226_l8: l8 {
206			regulator-min-microvolt = <1800000>;
207			regulator-max-microvolt = <1800000>;
208			regulator-always-on;
209		};
210
211		pm8226_l9: l9 {
212			regulator-min-microvolt = <2050000>;
213			regulator-max-microvolt = <2050000>;
214		};
215
216		pm8226_l10: l10 {
217			regulator-min-microvolt = <1800000>;
218			regulator-max-microvolt = <1800000>;
219		};
220
221		pm8226_l12: l12 {
222			regulator-min-microvolt = <1800000>;
223			regulator-max-microvolt = <1800000>;
224		};
225
226		pm8226_l14: l14 {
227			regulator-min-microvolt = <2750000>;
228			regulator-max-microvolt = <2750000>;
229		};
230
231		pm8226_l15: l15 {
232			regulator-min-microvolt = <2850000>;
233			regulator-max-microvolt = <2850000>;
234		};
235
236		pm8226_l16: l16 {
237			regulator-min-microvolt = <3000000>;
238			regulator-max-microvolt = <3000000>;
239		};
240
241		pm8226_l17: l17 {
242			regulator-min-microvolt = <2950000>;
243			regulator-max-microvolt = <2950000>;
244			regulator-system-load = <200000>;
245			regulator-allow-set-load;
246		};
247
248		pm8226_l18: l18 {
249			regulator-min-microvolt = <2950000>;
250			regulator-max-microvolt = <2950000>;
251			regulator-system-load = <200000>;
252			regulator-allow-set-load;
253		};
254
255		pm8226_l19: l19 {
256			regulator-min-microvolt = <2850000>;
257			regulator-max-microvolt = <2850000>;
258		};
259
260		pm8226_l20: l20 {
261			regulator-min-microvolt = <3075000>;
262			regulator-max-microvolt = <3075000>;
263		};
264
265		pm8226_l21: l21 {
266			regulator-min-microvolt = <1850000>;
267			regulator-max-microvolt = <2950000>;
268		};
269
270		pm8226_l22: l22 {
271			regulator-min-microvolt = <1800000>;
272			regulator-max-microvolt = <1800000>;
273		};
274
275		pm8226_l23: l23 {
276			regulator-min-microvolt = <1800000>;
277			regulator-max-microvolt = <1800000>;
278		};
279
280		pm8226_l24: l24 {
281			regulator-min-microvolt = <1300000>;
282			regulator-max-microvolt = <1300000>;
283		};
284
285		pm8226_l25: l25 {
286			regulator-min-microvolt = <1775000>;
287			regulator-max-microvolt = <2075000>;
288		};
289
290		pm8226_l27: l27 {
291			regulator-min-microvolt = <2050000>;
292			regulator-max-microvolt = <2050000>;
293		};
294
295		pm8226_l28: l28 {
296			regulator-min-microvolt = <2000000>;
297			regulator-max-microvolt = <3000000>;
298		};
299	};
300};
301
302&sdhc_1 {
303	vmmc-supply = <&pm8226_l17>;
304	vqmmc-supply = <&pm8226_l6>;
305
306	status = "okay";
307};
308
309&sdhc_2 {
310	vmmc-supply = <&pm8226_l18>;
311	vqmmc-supply = <&pm8226_l21>;
312
313	status = "okay";
314};
315
316&smbb {
317	status = "okay";
318};
319
320&usb {
321	extcon = <&smbb>;
322	dr_mode = "peripheral";
323
324	status = "okay";
325};
326
327&usb_hs_phy {
328	extcon = <&smbb>;
329	v1p8-supply = <&pm8226_l10>;
330	v3p3-supply = <&pm8226_l20>;
331};
332
333&tlmm {
334	gpio_keys_default: gpio-keys-default-state {
335		pins = "gpio106", "gpio107", "gpio108";
336		function = "gpio";
337		drive-strength = <2>;
338		bias-pull-up;
339	};
340
341	touchscreen_default: touchscreen-default-state {
342		irq-pins {
343			pins = "gpio17";
344			function = "gpio";
345			drive-strength = <8>;
346			bias-pull-up;
347		};
348
349		reset-pins {
350			pins = "gpio16";
351			function = "gpio";
352			drive-strength = <8>;
353			bias-disable;
354			output-high;
355		};
356	};
357};
358