1// SPDX-License-Identifier: GPL-2.0-only
2// Copyright (C) 2019 Stephan Gerhold
3
4/dts-v1/;
5
6#include "msm8916-pm8916.dtsi"
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/interrupt-controller/irq.h>
10
11/*
12 * NOTE: The original firmware from Samsung can only boot ARM32 kernels.
13 * Unfortunately, the firmware is signed and cannot be replaced easily.
14 * There seems to be no way to boot ARM64 kernels on this device at the moment,
15 * even though the hardware would support it.
16 *
17 * However, it is possible to use this device tree by compiling an ARM32 kernel
18 * instead. For clarity and build testing this device tree is maintained next
19 * to the other MSM8916 device trees. However, it is actually used through
20 *   arch/arm/boot/dts/qcom-msm8916-samsung-serranove.dts
21 */
22
23/ {
24	model = "Samsung Galaxy S4 Mini Value Edition";
25	compatible = "samsung,serranove", "qcom,msm8916";
26	chassis-type = "handset";
27
28	aliases {
29		serial0 = &blsp1_uart2;
30	};
31
32	chosen {
33		stdout-path = "serial0";
34	};
35
36	reserved-memory {
37		/* Additional memory used by Samsung firmware modifications */
38		tz-apps@85500000 {
39			reg = <0x0 0x85500000 0x0 0xb00000>;
40			no-map;
41		};
42	};
43
44	gpio-keys {
45		compatible = "gpio-keys";
46
47		pinctrl-names = "default";
48		pinctrl-0 = <&gpio_keys_default>;
49
50		label = "GPIO Buttons";
51
52		button-volume-up {
53			label = "Volume Up";
54			gpios = <&msmgpio 107 GPIO_ACTIVE_LOW>;
55			linux,code = <KEY_VOLUMEUP>;
56		};
57
58		button-home {
59			label = "Home";
60			gpios = <&msmgpio 109 GPIO_ACTIVE_LOW>;
61			linux,code = <KEY_HOMEPAGE>;
62		};
63	};
64
65	gpio-hall-sensor {
66		compatible = "gpio-keys";
67
68		pinctrl-names = "default";
69		pinctrl-0 = <&gpio_hall_sensor_default>;
70
71		label = "GPIO Hall Effect Sensor";
72
73		event-hall-sensor {
74			label = "Hall Effect Sensor";
75			gpios = <&msmgpio 52 GPIO_ACTIVE_LOW>;
76			linux,input-type = <EV_SW>;
77			linux,code = <SW_LID>;
78			linux,can-disable;
79		};
80	};
81
82	reg_vdd_tsp: regulator-vdd-tsp {
83		compatible = "regulator-fixed";
84		regulator-name = "vdd_tsp";
85		regulator-min-microvolt = <3300000>;
86		regulator-max-microvolt = <3300000>;
87
88		gpio = <&msmgpio 73 GPIO_ACTIVE_HIGH>;
89		enable-active-high;
90
91		pinctrl-names = "default";
92		pinctrl-0 = <&tsp_en_default>;
93	};
94
95	reg_touch_key: regulator-touch-key {
96		compatible = "regulator-fixed";
97		regulator-name = "touch_key";
98		regulator-min-microvolt = <2800000>;
99		regulator-max-microvolt = <2800000>;
100
101		gpio = <&msmgpio 86 GPIO_ACTIVE_HIGH>;
102		enable-active-high;
103
104		pinctrl-names = "default";
105		pinctrl-0 = <&tkey_en_default>;
106	};
107
108	reg_key_led: regulator-key-led {
109		compatible = "regulator-fixed";
110		regulator-name = "key_led";
111		regulator-min-microvolt = <3300000>;
112		regulator-max-microvolt = <3300000>;
113
114		gpio = <&msmgpio 60 GPIO_ACTIVE_HIGH>;
115		enable-active-high;
116
117		pinctrl-names = "default";
118		pinctrl-0 = <&tkey_led_en_default>;
119	};
120
121	i2c-muic {
122		compatible = "i2c-gpio";
123		sda-gpios = <&msmgpio 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
124		scl-gpios = <&msmgpio 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
125
126		pinctrl-names = "default";
127		pinctrl-0 = <&muic_i2c_default>;
128
129		#address-cells = <1>;
130		#size-cells = <0>;
131
132		muic: extcon@14 {
133			compatible = "siliconmitus,sm5504-muic";
134			reg = <0x14>;
135
136			interrupt-parent = <&msmgpio>;
137			interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
138
139			pinctrl-names = "default";
140			pinctrl-0 = <&muic_irq_default>;
141		};
142	};
143
144	i2c-tkey {
145		compatible = "i2c-gpio";
146		sda-gpios = <&msmgpio 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
147		scl-gpios = <&msmgpio 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
148
149		pinctrl-names = "default";
150		pinctrl-0 = <&tkey_i2c_default>;
151
152		#address-cells = <1>;
153		#size-cells = <0>;
154
155		touchkey@20 {
156			compatible = "coreriver,tc360-touchkey";
157			reg = <0x20>;
158
159			interrupt-parent = <&msmgpio>;
160			interrupts = <98 IRQ_TYPE_EDGE_FALLING>;
161
162			vcc-supply = <&reg_touch_key>;
163			vdd-supply = <&reg_key_led>;
164			vddio-supply = <&pm8916_l6>;
165
166			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
167
168			pinctrl-names = "default";
169			pinctrl-0 = <&tkey_default>;
170		};
171	};
172
173	i2c-nfc {
174		compatible = "i2c-gpio";
175		sda-gpios = <&msmgpio 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
176		scl-gpios = <&msmgpio 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
177
178		pinctrl-names = "default";
179		pinctrl-0 = <&nfc_i2c_default>;
180
181		#address-cells = <1>;
182		#size-cells = <0>;
183
184		nfc@2b {
185			compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
186			reg = <0x2b>;
187
188			interrupt-parent = <&msmgpio>;
189			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
190
191			enable-gpios = <&msmgpio 20 GPIO_ACTIVE_HIGH>;
192			firmware-gpios = <&msmgpio 49 GPIO_ACTIVE_HIGH>;
193
194			pinctrl-names = "default";
195			pinctrl-0 = <&nfc_default>;
196		};
197	};
198};
199
200&blsp_i2c2 {
201	status = "okay";
202
203	imu@6b {
204		compatible = "st,lsm6ds3";
205		reg = <0x6b>;
206
207		interrupt-parent = <&msmgpio>;
208		interrupts = <115 IRQ_TYPE_EDGE_RISING>;
209
210		pinctrl-names = "default";
211		pinctrl-0 = <&imu_irq_default>;
212	};
213};
214
215&blsp_i2c4 {
216	status = "okay";
217
218	battery@35 {
219		compatible = "richtek,rt5033-battery";
220		reg = <0x35>;
221
222		interrupt-parent = <&msmgpio>;
223		interrupts = <121 IRQ_TYPE_EDGE_FALLING>;
224
225		pinctrl-names = "default";
226		pinctrl-0 = <&fg_alert_default>;
227	};
228};
229
230&blsp_i2c5 {
231	status = "okay";
232
233	touchscreen@20 {
234		compatible = "zinitix,bt541";
235		reg = <0x20>;
236
237		interrupt-parent = <&msmgpio>;
238		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
239
240		touchscreen-size-x = <540>;
241		touchscreen-size-y = <960>;
242
243		vdd-supply = <&reg_vdd_tsp>;
244		vddo-supply = <&pm8916_l6>;
245
246		pinctrl-names = "default";
247		pinctrl-0 = <&tsp_irq_default>;
248	};
249};
250
251&blsp1_uart2 {
252	status = "okay";
253};
254
255&pm8916_resin {
256	status = "okay";
257	linux,code = <KEY_VOLUMEDOWN>;
258};
259
260&pm8916_vib {
261	status = "okay";
262};
263
264&pronto {
265	status = "okay";
266
267	iris {
268		compatible = "qcom,wcn3660b";
269	};
270};
271
272&sdhc_1 {
273	status = "okay";
274
275	pinctrl-names = "default", "sleep";
276	pinctrl-0 = <&sdc1_clk_on &sdc1_cmd_on &sdc1_data_on>;
277	pinctrl-1 = <&sdc1_clk_off &sdc1_cmd_off &sdc1_data_off>;
278};
279
280&sdhc_2 {
281	status = "okay";
282
283	pinctrl-names = "default", "sleep";
284	pinctrl-0 = <&sdc2_clk_on &sdc2_cmd_on &sdc2_data_on>;
285	pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off>;
286
287	non-removable;
288
289	/*
290	 * FIXME: Disable UHS-I modes since tuning fails with:
291	 *
292	 * sdhci_msm 7864900.sdhci: mmc1: No tuning point found
293	 * mmc1: tuning execution failed: -5
294	 * mmc1: error -5 whilst initialising SD card
295	 *
296	 * This is the quirk used on downstream, which suggests this is
297	 * a hardware limitation. However, probing a card using DDR50 works
298	 * (without tuning), so maybe only tuning is broken?
299	 */
300	no-1-8-v;
301};
302
303&usb {
304	status = "okay";
305	extcon = <&muic>, <&muic>;
306};
307
308&usb_hs_phy {
309	extcon = <&muic>;
310};
311
312&smd_rpm_regulators {
313	vdd_l1_l2_l3-supply = <&pm8916_s3>;
314	vdd_l4_l5_l6-supply = <&pm8916_s4>;
315	vdd_l7-supply = <&pm8916_s4>;
316
317	s3 {
318		regulator-min-microvolt = <1200000>;
319		regulator-max-microvolt = <1300000>;
320	};
321
322	s4 {
323		regulator-min-microvolt = <1800000>;
324		regulator-max-microvolt = <2100000>;
325	};
326
327	l1 {
328		regulator-min-microvolt = <1225000>;
329		regulator-max-microvolt = <1225000>;
330	};
331
332	l2 {
333		regulator-min-microvolt = <1200000>;
334		regulator-max-microvolt = <1200000>;
335	};
336
337	l4 {
338		regulator-min-microvolt = <2050000>;
339		regulator-max-microvolt = <2050000>;
340	};
341
342	l5 {
343		regulator-min-microvolt = <1800000>;
344		regulator-max-microvolt = <1800000>;
345	};
346
347	l6 {
348		regulator-min-microvolt = <1800000>;
349		regulator-max-microvolt = <1800000>;
350	};
351
352	l7 {
353		regulator-min-microvolt = <1800000>;
354		regulator-max-microvolt = <1800000>;
355	};
356
357	l8 {
358		regulator-min-microvolt = <2850000>;
359		regulator-max-microvolt = <2900000>;
360	};
361
362	l9 {
363		regulator-min-microvolt = <3300000>;
364		regulator-max-microvolt = <3300000>;
365	};
366
367	l10 {
368		regulator-min-microvolt = <2700000>;
369		regulator-max-microvolt = <2800000>;
370	};
371
372	l11 {
373		regulator-min-microvolt = <1800000>;
374		regulator-max-microvolt = <2950000>;
375		regulator-allow-set-load;
376		regulator-system-load = <200000>;
377	};
378
379	l12 {
380		regulator-min-microvolt = <1800000>;
381		regulator-max-microvolt = <2950000>;
382	};
383
384	l13 {
385		regulator-min-microvolt = <3075000>;
386		regulator-max-microvolt = <3075000>;
387	};
388
389	l14 {
390		regulator-min-microvolt = <1800000>;
391		regulator-max-microvolt = <3300000>;
392	};
393
394	l15 {
395		regulator-min-microvolt = <1800000>;
396		regulator-max-microvolt = <3300000>;
397	};
398
399	l16 {
400		regulator-min-microvolt = <1800000>;
401		regulator-max-microvolt = <3300000>;
402	};
403
404	l17 {
405		regulator-min-microvolt = <2850000>;
406		regulator-max-microvolt = <2850000>;
407	};
408
409	l18 {
410		regulator-min-microvolt = <2700000>;
411		regulator-max-microvolt = <2700000>;
412	};
413};
414
415&msmgpio {
416	fg_alert_default: fg-alert-default {
417		pins = "gpio121";
418		function = "gpio";
419
420		drive-strength = <2>;
421		bias-disable;
422	};
423
424	gpio_keys_default: gpio-keys-default {
425		pins = "gpio107", "gpio109";
426		function = "gpio";
427
428		drive-strength = <2>;
429		bias-pull-up;
430	};
431
432	gpio_hall_sensor_default: gpio-hall-sensor-default {
433		pins = "gpio52";
434		function = "gpio";
435
436		drive-strength = <2>;
437		bias-disable;
438	};
439
440	imu_irq_default: imu-irq-default {
441		pins = "gpio115";
442		function = "gpio";
443
444		drive-strength = <2>;
445		bias-disable;
446	};
447
448	muic_i2c_default: muic-i2c-default {
449		pins = "gpio105", "gpio106";
450		function = "gpio";
451
452		drive-strength = <2>;
453		bias-disable;
454	};
455
456	muic_irq_default: muic-irq-default {
457		pins = "gpio12";
458		function = "gpio";
459
460		drive-strength = <2>;
461		bias-disable;
462	};
463
464	nfc_default: nfc-default {
465		pins = "gpio20", "gpio49";
466		function = "gpio";
467
468		drive-strength = <2>;
469		bias-disable;
470
471		irq {
472			pins = "gpio21";
473			function = "gpio";
474
475			drive-strength = <2>;
476			bias-pull-down;
477		};
478	};
479
480	nfc_i2c_default: nfc-i2c-default {
481		pins = "gpio0", "gpio1";
482		function = "gpio";
483
484		drive-strength = <2>;
485		bias-disable;
486	};
487
488	tkey_default: tkey-default {
489		pins = "gpio98";
490		function = "gpio";
491
492		drive-strength = <2>;
493		bias-disable;
494	};
495
496	tkey_en_default: tkey-en-default {
497		pins = "gpio86";
498		function = "gpio";
499
500		drive-strength = <2>;
501		bias-disable;
502	};
503
504	tkey_i2c_default: tkey-i2c-default {
505		pins = "gpio16", "gpio17";
506		function = "gpio";
507
508		drive-strength = <2>;
509		bias-disable;
510	};
511
512	tkey_led_en_default: tkey-led-en-default {
513		pins = "gpio60";
514		function = "gpio";
515
516		drive-strength = <2>;
517		bias-disable;
518	};
519
520	tsp_en_default: tsp-en-default {
521		pins = "gpio73";
522		function = "gpio";
523
524		drive-strength = <2>;
525		bias-disable;
526	};
527
528	tsp_irq_default: tsp-irq-default {
529		pins = "gpio13";
530		function = "gpio";
531
532		drive-strength = <2>;
533		bias-disable;
534	};
535};
536