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&msmgpio {
171	gpio_keys_default: gpio-keys-default {
172		pinmux {
173			function = "gpio";
174			pins = "gpio107", "gpio109";
175		};
176		pinconf {
177			pins = "gpio107", "gpio109";
178			drive-strength = <2>;
179			bias-pull-up;
180		};
181	};
182
183	gpio_hall_sensor_default: gpio-hall-sensor-default {
184		pinmux {
185			function = "gpio";
186			pins = "gpio52";
187		};
188		pinconf {
189			pins = "gpio52";
190			drive-strength = <2>;
191			bias-disable;
192		};
193	};
194
195	muic_int_default: muic-int-default {
196		pinmux {
197			function = "gpio";
198			pins = "gpio12";
199		};
200		pinconf {
201			pins = "gpio12";
202			drive-strength = <2>;
203			bias-disable;
204		};
205	};
206
207	tsp_en_default: tsp-en-default {
208		pinmux {
209			function = "gpio";
210			pins = "gpio73";
211		};
212		pinconf {
213			pins = "gpio73";
214			drive-strength = <2>;
215			bias-disable;
216		};
217	};
218
219	pmx-mdss {
220		mdss_default: mdss-default {
221			pinmux {
222				function = "gpio";
223				pins = "gpio25";
224			};
225			pinconf {
226				pins = "gpio25";
227				drive-strength = <8>;
228				bias-disable;
229			};
230		};
231
232		mdss_sleep: mdss-sleep {
233			pinmux {
234				function = "gpio";
235				pins = "gpio25";
236			};
237			pinconf {
238				pins = "gpio25";
239				drive-strength = <2>;
240				bias-pull-down;
241			};
242		};
243	};
244};
245
246&smd_rpm_regulators {
247	vdd_l1_l2_l3-supply = <&pm8916_s3>;
248	vdd_l4_l5_l6-supply = <&pm8916_s4>;
249	vdd_l7-supply = <&pm8916_s4>;
250
251	s1 {
252		regulator-min-microvolt = <500000>;
253		regulator-max-microvolt = <1300000>;
254	};
255
256	s3 {
257		regulator-min-microvolt = <1200000>;
258		regulator-max-microvolt = <1300000>;
259	};
260
261	s4 {
262		regulator-min-microvolt = <1800000>;
263		regulator-max-microvolt = <2100000>;
264	};
265
266	l1 {
267		regulator-min-microvolt = <1225000>;
268		regulator-max-microvolt = <1225000>;
269	};
270
271	l2 {
272		regulator-min-microvolt = <1200000>;
273		regulator-max-microvolt = <1200000>;
274	};
275
276	l3 {
277		regulator-min-microvolt = <500000>;
278		regulator-max-microvolt = <1287500>;
279	};
280
281	l4 {
282		regulator-min-microvolt = <2050000>;
283		regulator-max-microvolt = <2050000>;
284	};
285
286	l5 {
287		regulator-min-microvolt = <1800000>;
288		regulator-max-microvolt = <1800000>;
289	};
290
291	l6 {
292		regulator-min-microvolt = <1800000>;
293		regulator-max-microvolt = <1800000>;
294	};
295
296	l7 {
297		regulator-min-microvolt = <1800000>;
298		regulator-max-microvolt = <1800000>;
299	};
300
301	l8 {
302		regulator-min-microvolt = <2850000>;
303		regulator-max-microvolt = <2900000>;
304	};
305
306	l9 {
307		regulator-min-microvolt = <3300000>;
308		regulator-max-microvolt = <3300000>;
309	};
310
311	l10 {
312		regulator-min-microvolt = <2700000>;
313		regulator-max-microvolt = <2800000>;
314	};
315
316	l11 {
317		regulator-min-microvolt = <1800000>;
318		regulator-max-microvolt = <2950000>;
319		regulator-allow-set-load;
320		regulator-system-load = <200000>;
321	};
322
323	l12 {
324		regulator-min-microvolt = <1800000>;
325		regulator-max-microvolt = <2950000>;
326	};
327
328	l13 {
329		regulator-min-microvolt = <3075000>;
330		regulator-max-microvolt = <3075000>;
331	};
332
333	l14 {
334		regulator-min-microvolt = <1800000>;
335		regulator-max-microvolt = <3300000>;
336	};
337
338	l15 {
339		regulator-min-microvolt = <1800000>;
340		regulator-max-microvolt = <3300000>;
341	};
342
343	l16 {
344		regulator-min-microvolt = <1800000>;
345		regulator-max-microvolt = <3300000>;
346	};
347
348	l17 {
349		regulator-min-microvolt = <2850000>;
350		regulator-max-microvolt = <2850000>;
351	};
352
353	l18 {
354		regulator-min-microvolt = <2700000>;
355		regulator-max-microvolt = <2700000>;
356	};
357};
358
359&spmi_bus {
360	pm8916@0 {
361		pon@800 {
362			volume-down {
363				compatible = "qcom,pm8941-resin";
364				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
365				bias-pull-up;
366				linux,code = <KEY_VOLUMEDOWN>;
367			};
368		};
369	};
370};
371