1// SPDX-License-Identifier: GPL-2.0-only
2
3#include "msm8916.dtsi"
4#include "pm8916.dtsi"
5#include <dt-bindings/gpio/gpio.h>
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/interrupt-controller/irq.h>
8
9/ {
10	aliases {
11		serial0 = &blsp1_uart2;
12	};
13
14	chosen {
15		stdout-path = "serial0";
16	};
17
18	reserved-memory {
19		/* Additional memory used by Samsung firmware modifications */
20		tz-apps@85500000 {
21			reg = <0x0 0x85500000 0x0 0xb00000>;
22			no-map;
23		};
24	};
25
26	soc {
27		sdhci@7824000 {
28			status = "okay";
29
30			vmmc-supply = <&pm8916_l8>;
31			vqmmc-supply = <&pm8916_l5>;
32
33			pinctrl-names = "default", "sleep";
34			pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
35			pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
36		};
37
38		sdhci@7864000 {
39			status = "okay";
40
41			vmmc-supply = <&pm8916_l11>;
42			vqmmc-supply = <&pm8916_l12>;
43
44			pinctrl-names = "default", "sleep";
45			pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on &sdc2_cd_on>;
46			pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
47
48			cd-gpios = <&msmgpio 38 GPIO_ACTIVE_LOW>;
49		};
50
51		serial@78b0000 {
52			status = "okay";
53			pinctrl-names = "default", "sleep";
54			pinctrl-0 = <&blsp1_uart2_default>;
55			pinctrl-1 = <&blsp1_uart2_sleep>;
56		};
57
58		usb@78d9000 {
59			status = "okay";
60			extcon = <&muic>, <&muic>;
61
62			hnp-disable;
63			srp-disable;
64			adp-disable;
65
66			ulpi {
67				phy {
68					extcon = <&muic>;
69					v1p8-supply = <&pm8916_l7>;
70					v3p3-supply = <&pm8916_l13>;
71				};
72			};
73		};
74
75		mdss@1a00000 {
76			dsi@1a98000 {
77				#address-cells = <1>;
78				#size-cells = <0>;
79
80				vdda-supply = <&pm8916_l2>;
81				vddio-supply = <&pm8916_l6>;
82
83				pinctrl-names = "default", "sleep";
84				pinctrl-0 = <&mdss_default>;
85				pinctrl-1 = <&mdss_sleep>;
86			};
87
88			dsi-phy@1a98300 {
89				vddio-supply = <&pm8916_l6>;
90			};
91		};
92
93		wcnss@a21b000 {
94			status = "okay";
95		};
96	};
97
98	gpio-keys {
99		compatible = "gpio-keys";
100
101		pinctrl-names = "default";
102		pinctrl-0 = <&gpio_keys_default>;
103
104		label = "GPIO Buttons";
105
106		volume-up {
107			label = "Volume Up";
108			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
109			linux,code = <KEY_VOLUMEUP>;
110		};
111
112		home {
113			label = "Home";
114			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
115			linux,code = <KEY_HOMEPAGE>;
116		};
117	};
118
119	gpio-hall-sensor {
120		compatible = "gpio-keys";
121
122		pinctrl-names = "default";
123		pinctrl-0 = <&gpio_hall_sensor_default>;
124
125		label = "GPIO Hall Effect Sensor";
126
127		hall-sensor {
128			label = "Hall Effect Sensor";
129			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
130			linux,input-type = <EV_SW>;
131			linux,code = <SW_LID>;
132			linux,can-disable;
133		};
134	};
135
136	reg_vdd_tsp: regulator-vdd-tsp {
137		compatible = "regulator-fixed";
138		regulator-name = "vdd_tsp";
139		regulator-min-microvolt = <3300000>;
140		regulator-max-microvolt = <3300000>;
141
142		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
143		enable-active-high;
144
145		pinctrl-names = "default";
146		pinctrl-0 = <&tsp_en_default>;
147	};
148
149	i2c-muic {
150		compatible = "i2c-gpio";
151		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
152		scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
153
154		#address-cells = <1>;
155		#size-cells = <0>;
156
157		muic: sm5502@25 {
158			compatible = "siliconmitus,sm5502-muic";
159
160			reg = <0x25>;
161			interrupt-parent = <&msmgpio>;
162			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
163
164			pinctrl-names = "default";
165			pinctrl-0 = <&muic_int_default>;
166		};
167	};
168};
169
170&blsp_i2c2 {
171	status = "okay";
172
173	accelerometer: accelerometer@10 {
174		compatible = "bosch,bmc150_accel";
175		reg = <0x10>;
176		interrupt-parent = <&msmgpio>;
177		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
178
179		pinctrl-names = "default";
180		pinctrl-0 = <&accel_int_default>;
181	};
182
183	magnetometer@12 {
184		compatible = "bosch,bmc150_magn";
185		reg = <0x12>;
186	};
187};
188
189&spmi_bus {
190	pm8916@0 {
191		pon@800 {
192			volume-down {
193				compatible = "qcom,pm8941-resin";
194				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
195				bias-pull-up;
196				linux,code = <KEY_VOLUMEDOWN>;
197			};
198		};
199	};
200};
201
202&smd_rpm_regulators {
203	vdd_l1_l2_l3-supply = <&pm8916_s3>;
204	vdd_l4_l5_l6-supply = <&pm8916_s4>;
205	vdd_l7-supply = <&pm8916_s4>;
206
207	s1 {
208		regulator-min-microvolt = <500000>;
209		regulator-max-microvolt = <1300000>;
210	};
211
212	s3 {
213		regulator-min-microvolt = <1200000>;
214		regulator-max-microvolt = <1300000>;
215	};
216
217	s4 {
218		regulator-min-microvolt = <1800000>;
219		regulator-max-microvolt = <2100000>;
220	};
221
222	l1 {
223		regulator-min-microvolt = <1225000>;
224		regulator-max-microvolt = <1225000>;
225	};
226
227	l2 {
228		regulator-min-microvolt = <1200000>;
229		regulator-max-microvolt = <1200000>;
230	};
231
232	l3 {
233		regulator-min-microvolt = <500000>;
234		regulator-max-microvolt = <1287500>;
235	};
236
237	l4 {
238		regulator-min-microvolt = <2050000>;
239		regulator-max-microvolt = <2050000>;
240	};
241
242	l5 {
243		regulator-min-microvolt = <1800000>;
244		regulator-max-microvolt = <1800000>;
245	};
246
247	l6 {
248		regulator-min-microvolt = <1800000>;
249		regulator-max-microvolt = <1800000>;
250	};
251
252	l7 {
253		regulator-min-microvolt = <1800000>;
254		regulator-max-microvolt = <1800000>;
255	};
256
257	l8 {
258		regulator-min-microvolt = <2850000>;
259		regulator-max-microvolt = <2900000>;
260	};
261
262	l9 {
263		regulator-min-microvolt = <3300000>;
264		regulator-max-microvolt = <3300000>;
265	};
266
267	l10 {
268		regulator-min-microvolt = <2700000>;
269		regulator-max-microvolt = <2800000>;
270	};
271
272	l11 {
273		regulator-min-microvolt = <1800000>;
274		regulator-max-microvolt = <2950000>;
275		regulator-allow-set-load;
276		regulator-system-load = <200000>;
277	};
278
279	l12 {
280		regulator-min-microvolt = <1800000>;
281		regulator-max-microvolt = <2950000>;
282	};
283
284	l13 {
285		regulator-min-microvolt = <3075000>;
286		regulator-max-microvolt = <3075000>;
287	};
288
289	l14 {
290		regulator-min-microvolt = <1800000>;
291		regulator-max-microvolt = <3300000>;
292	};
293
294	l15 {
295		regulator-min-microvolt = <1800000>;
296		regulator-max-microvolt = <3300000>;
297	};
298
299	l16 {
300		regulator-min-microvolt = <1800000>;
301		regulator-max-microvolt = <3300000>;
302	};
303
304	l17 {
305		regulator-min-microvolt = <2850000>;
306		regulator-max-microvolt = <2850000>;
307	};
308
309	l18 {
310		regulator-min-microvolt = <2700000>;
311		regulator-max-microvolt = <2700000>;
312	};
313};
314
315&msmgpio {
316	accel_int_default: accel-int-default {
317		pins = "gpio115";
318		function = "gpio";
319
320		drive-strength = <2>;
321		bias-disable;
322	};
323
324	gpio_keys_default: gpio-keys-default {
325		pins = "gpio107", "gpio109";
326		function = "gpio";
327
328		drive-strength = <2>;
329		bias-pull-up;
330	};
331
332	gpio_hall_sensor_default: gpio-hall-sensor-default {
333		pins = "gpio52";
334		function = "gpio";
335
336		drive-strength = <2>;
337		bias-disable;
338	};
339
340	mdss {
341		mdss_default: mdss-default {
342			pins = "gpio25";
343			function = "gpio";
344
345			drive-strength = <8>;
346			bias-disable;
347		};
348		mdss_sleep: mdss-sleep {
349			pins = "gpio25";
350			function = "gpio";
351
352			drive-strength = <2>;
353			bias-pull-down;
354		};
355	};
356
357	muic_int_default: muic-int-default {
358		pins = "gpio12";
359		function = "gpio";
360
361		drive-strength = <2>;
362		bias-disable;
363	};
364
365	tsp_en_default: tsp-en-default {
366		pins = "gpio73";
367		function = "gpio";
368
369		drive-strength = <2>;
370		bias-disable;
371	};
372};
373