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		wcnss@a21b000 {
76			status = "okay";
77		};
78
79		/*
80		 * Attempting to enable these devices causes a "synchronous
81		 * external abort". Suspected cause is that the debug power
82		 * domain is not enabled by default on this device.
83		 * Disable these devices for now to avoid the crash.
84		 *
85		 * See: https://lore.kernel.org/linux-arm-msm/20190618202623.GA53651@gerhold.net/
86		 */
87		tpiu@820000 { status = "disabled"; };
88		funnel@821000 { status = "disabled"; };
89		replicator@824000 { status = "disabled"; };
90		etf@825000 { status = "disabled"; };
91		etr@826000 { status = "disabled"; };
92		funnel@841000 { status = "disabled"; };
93		debug@850000 { status = "disabled"; };
94		debug@852000 { status = "disabled"; };
95		debug@854000 { status = "disabled"; };
96		debug@856000 { status = "disabled"; };
97		etm@85c000 { status = "disabled"; };
98		etm@85d000 { status = "disabled"; };
99		etm@85e000 { status = "disabled"; };
100		etm@85f000 { status = "disabled"; };
101	};
102
103	gpio-keys {
104		compatible = "gpio-keys";
105
106		pinctrl-names = "default";
107		pinctrl-0 = <&gpio_keys_default>;
108
109		label = "GPIO Buttons";
110
111		volume-up {
112			label = "Volume Up";
113			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
114			linux,code = <KEY_VOLUMEUP>;
115		};
116
117		home {
118			label = "Home";
119			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
120			linux,code = <KEY_HOMEPAGE>;
121		};
122	};
123
124	gpio-hall-sensor {
125		compatible = "gpio-keys";
126
127		pinctrl-names = "default";
128		pinctrl-0 = <&gpio_hall_sensor_default>;
129
130		label = "GPIO Hall Effect Sensor";
131
132		hall-sensor {
133			label = "Hall Effect Sensor";
134			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
135			linux,input-type = <EV_SW>;
136			linux,code = <SW_LID>;
137			linux,can-disable;
138		};
139	};
140
141	i2c-muic {
142		compatible = "i2c-gpio";
143		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
144		scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
145
146		#address-cells = <1>;
147		#size-cells = <0>;
148
149		muic: sm5502@25 {
150			compatible = "siliconmitus,sm5502-muic";
151
152			reg = <0x25>;
153			interrupt-parent = <&msmgpio>;
154			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
155
156			pinctrl-names = "default";
157			pinctrl-0 = <&muic_int_default>;
158		};
159	};
160};
161
162&msmgpio {
163	gpio_keys_default: gpio_keys_default {
164		pinmux {
165			function = "gpio";
166			pins = "gpio107", "gpio109";
167		};
168		pinconf {
169			pins = "gpio107", "gpio109";
170			drive-strength = <2>;
171			bias-pull-up;
172		};
173	};
174
175	gpio_hall_sensor_default: gpio_hall_sensor_default {
176		pinmux {
177			function = "gpio";
178			pins = "gpio52";
179		};
180		pinconf {
181			pins = "gpio52";
182			drive-strength = <2>;
183			bias-disable;
184		};
185	};
186
187	muic_int_default: muic_int_default {
188		pinmux {
189			function = "gpio";
190			pins = "gpio12";
191		};
192		pinconf {
193			pins = "gpio12";
194			drive-strength = <2>;
195			bias-disable;
196		};
197	};
198};
199
200&smd_rpm_regulators {
201	vdd_l1_l2_l3-supply = <&pm8916_s3>;
202	vdd_l4_l5_l6-supply = <&pm8916_s4>;
203	vdd_l7-supply = <&pm8916_s4>;
204
205	s1 {
206		regulator-min-microvolt = <500000>;
207		regulator-max-microvolt = <1300000>;
208	};
209
210	s3 {
211		regulator-min-microvolt = <1200000>;
212		regulator-max-microvolt = <1300000>;
213	};
214
215	s4 {
216		regulator-min-microvolt = <1800000>;
217		regulator-max-microvolt = <2100000>;
218	};
219
220	l1 {
221		regulator-min-microvolt = <1225000>;
222		regulator-max-microvolt = <1225000>;
223	};
224
225	l2 {
226		regulator-min-microvolt = <1200000>;
227		regulator-max-microvolt = <1200000>;
228	};
229
230	l3 {
231		regulator-min-microvolt = <500000>;
232		regulator-max-microvolt = <1287500>;
233	};
234
235	l4 {
236		regulator-min-microvolt = <2050000>;
237		regulator-max-microvolt = <2050000>;
238	};
239
240	l5 {
241		regulator-min-microvolt = <1800000>;
242		regulator-max-microvolt = <1800000>;
243	};
244
245	l6 {
246		regulator-min-microvolt = <1800000>;
247		regulator-max-microvolt = <1800000>;
248	};
249
250	l7 {
251		regulator-min-microvolt = <1800000>;
252		regulator-max-microvolt = <1800000>;
253	};
254
255	l8 {
256		regulator-min-microvolt = <2850000>;
257		regulator-max-microvolt = <2900000>;
258	};
259
260	l9 {
261		regulator-min-microvolt = <3300000>;
262		regulator-max-microvolt = <3300000>;
263	};
264
265	l10 {
266		regulator-min-microvolt = <2700000>;
267		regulator-max-microvolt = <2800000>;
268	};
269
270	l11 {
271		regulator-min-microvolt = <1800000>;
272		regulator-max-microvolt = <2950000>;
273		regulator-allow-set-load;
274		regulator-system-load = <200000>;
275	};
276
277	l12 {
278		regulator-min-microvolt = <1800000>;
279		regulator-max-microvolt = <2950000>;
280	};
281
282	l13 {
283		regulator-min-microvolt = <3075000>;
284		regulator-max-microvolt = <3075000>;
285	};
286
287	l14 {
288		regulator-min-microvolt = <1800000>;
289		regulator-max-microvolt = <3300000>;
290	};
291
292	l15 {
293		regulator-min-microvolt = <1800000>;
294		regulator-max-microvolt = <3300000>;
295	};
296
297	l16 {
298		regulator-min-microvolt = <1800000>;
299		regulator-max-microvolt = <3300000>;
300	};
301
302	l17 {
303		regulator-min-microvolt = <2850000>;
304		regulator-max-microvolt = <2850000>;
305	};
306
307	l18 {
308		regulator-min-microvolt = <2700000>;
309		regulator-max-microvolt = <2700000>;
310	};
311};
312
313&spmi_bus {
314	pm8916@0 {
315		pon@800 {
316			volume-down {
317				compatible = "qcom,pm8941-resin";
318				interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
319				bias-pull-up;
320				linux,code = <KEY_VOLUMEDOWN>;
321			};
322		};
323	};
324};
325