xref: /linux/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts (revision 34dc1baba215b826e454b8d19e4f24adbeb7d00d)
1// SPDX-License-Identifier: GPL-2.0-only
2
3/dts-v1/;
4
5#include "msm8939-pm8916.dtsi"
6
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	model = "Samsung Galaxy A7 (2015)";
13	compatible = "samsung,a7", "qcom,msm8939";
14	chassis-type = "handset";
15
16	aliases {
17		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
18		mmc1 = &sdhc_2; /* SDC2 SD card slot */
19		serial0 = &blsp_uart2;
20	};
21
22	chosen {
23		stdout-path = "serial0";
24	};
25
26	reserved-memory {
27		/* Additional memory used by Samsung firmware modifications */
28		tz-apps@85500000 {
29			reg = <0x0 0x85500000 0x0 0xb00000>;
30			no-map;
31		};
32	};
33
34	gpio-hall-sensor {
35		compatible = "gpio-keys";
36
37		pinctrl-0 = <&gpio_hall_sensor_default>;
38		pinctrl-names = "default";
39
40		label = "GPIO Hall Effect Sensor";
41
42		event-hall-sensor {
43			label = "Hall Effect Sensor";
44			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
45			linux,input-type = <EV_SW>;
46			linux,code = <SW_LID>;
47			linux,can-disable;
48		};
49	};
50
51	gpio-keys {
52		compatible = "gpio-keys";
53
54		pinctrl-0 = <&gpio_keys_default>;
55		pinctrl-names = "default";
56
57		label = "GPIO Buttons";
58
59		button-volume-up {
60			label = "Volume Up";
61			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
62			linux,code = <KEY_VOLUMEUP>;
63		};
64
65		button-home {
66			label = "Home";
67			gpios = <&tlmm 109 GPIO_ACTIVE_LOW>;
68			linux,code = <KEY_HOMEPAGE>;
69		};
70	};
71
72	i2c-fg {
73		compatible = "i2c-gpio";
74		sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
75		scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
76
77		pinctrl-0 = <&fg_i2c_default>;
78		pinctrl-names = "default";
79
80		#address-cells = <1>;
81		#size-cells = <0>;
82
83		battery@35 {
84			compatible = "richtek,rt5033-battery";
85			reg = <0x35>;
86
87			interrupt-parent = <&tlmm>;
88			interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
89
90			pinctrl-0 = <&fg_alert_default>;
91			pinctrl-names = "default";
92		};
93	};
94
95	i2c-nfc {
96		compatible = "i2c-gpio";
97		sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
98		scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
99
100		pinctrl-0 = <&nfc_i2c_default>;
101		pinctrl-names = "default";
102
103		#address-cells = <1>;
104		#size-cells = <0>;
105
106		nfc@2b {
107			compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
108			reg = <0x2b>;
109
110			interrupt-parent = <&tlmm>;
111			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
112
113			enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>;
114			firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
115
116			pinctrl-0 = <&nfc_default>;
117			pinctrl-names = "default";
118		};
119	};
120
121	i2c-sensor {
122		compatible = "i2c-gpio";
123		sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
124		scl-gpios = <&tlmm 85 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
125
126		pinctrl-0 = <&sensor_i2c_default>;
127		pinctrl-names = "default";
128
129		#address-cells = <1>;
130		#size-cells = <0>;
131
132		accelerometer: accelerometer@10 {
133			compatible = "bosch,bmc150_accel";
134			reg = <0x10>;
135			interrupt-parent = <&tlmm>;
136			interrupts = <115 IRQ_TYPE_EDGE_RISING>;
137
138			vdd-supply = <&pm8916_l17>;
139			vddio-supply = <&pm8916_l5>;
140
141			pinctrl-0 = <&accel_int_default>;
142			pinctrl-names = "default";
143
144			mount-matrix = "-1", "0", "0",
145					"0", "-1", "0",
146					"0", "0", "1";
147		};
148
149		magnetometer@12 {
150			compatible = "bosch,bmc150_magn";
151			reg = <0x12>;
152
153			vdd-supply = <&pm8916_l17>;
154			vddio-supply = <&pm8916_l5>;
155		};
156	};
157
158	i2c-tkey {
159		compatible = "i2c-gpio";
160		sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
161		scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
162
163		pinctrl-0 = <&tkey_i2c_default>;
164		pinctrl-names = "default";
165
166		#address-cells = <1>;
167		#size-cells = <0>;
168
169		touchkey@20 {
170			/* Note: Actually an ABOV MCU that implements same interface */
171			compatible = "coreriver,tc360-touchkey";
172			reg = <0x20>;
173
174			interrupt-parent = <&tlmm>;
175			interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
176
177			vcc-supply = <&reg_touch_key>;
178			vdd-supply = <&reg_keyled>;
179			vddio-supply = <&pm8916_l6>;
180
181			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
182
183			pinctrl-0 = <&tkey_default>;
184			pinctrl-names = "default";
185		};
186	};
187
188	pwm_vibrator: pwm-vibrator {
189		compatible = "clk-pwm";
190		#pwm-cells = <2>;
191
192		clocks = <&gcc GCC_GP2_CLK>;
193
194		pinctrl-0 = <&motor_pwm_default>;
195		pinctrl-names = "default";
196	};
197
198	reg_keyled: regulator-keyled {
199		compatible = "regulator-fixed";
200		regulator-name = "keyled";
201		regulator-min-microvolt = <3300000>;
202		regulator-max-microvolt = <3300000>;
203
204		/* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */
205		gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>;
206		enable-active-high;
207
208		pinctrl-0 = <&tkey_led_en_default>;
209		pinctrl-names = "default";
210	};
211
212	reg_touch_key: regulator-touch-key {
213		compatible = "regulator-fixed";
214		regulator-name = "touch_key";
215		regulator-min-microvolt = <2800000>;
216		regulator-max-microvolt = <2800000>;
217
218		gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
219		enable-active-high;
220
221		pinctrl-0 = <&tkey_en_default>;
222		pinctrl-names = "default";
223	};
224
225	reg_tsp_vdd: regulator-tsp-vdd {
226		compatible = "regulator-fixed";
227		regulator-name = "tsp_vdd";
228		regulator-min-microvolt = <1800000>;
229		regulator-max-microvolt = <1800000>;
230		vin-supply = <&pm8916_s4>;
231
232		gpio = <&tlmm 8 GPIO_ACTIVE_HIGH>;
233		enable-active-high;
234
235		pinctrl-0 = <&reg_tsp_io_en_default>;
236		pinctrl-names = "default";
237	};
238
239	reg_vdd_tsp: regulator-vdd-tsp {
240		compatible = "regulator-fixed";
241		regulator-name = "vdd_tsp";
242		regulator-min-microvolt = <3300000>;
243		regulator-max-microvolt = <3300000>;
244
245		gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
246		enable-active-high;
247
248		pinctrl-0 = <&reg_tsp_en_default>;
249		pinctrl-names = "default";
250	};
251
252	reg_vibrator: regulator-vibrator {
253		compatible = "regulator-fixed";
254		regulator-name = "motor_en";
255		regulator-min-microvolt = <3000000>;
256		regulator-max-microvolt = <3000000>;
257
258		gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
259		enable-active-high;
260
261		pinctrl-0 = <&motor_en_default>;
262		pinctrl-names = "default";
263	};
264
265	vibrator {
266		compatible = "pwm-vibrator";
267
268		pwms = <&pwm_vibrator 0 100000>;
269		pwm-names = "enable";
270
271		vcc-supply = <&reg_vibrator>;
272	};
273};
274
275&blsp_i2c1 {
276	status = "okay";
277
278	muic: extcon@25 {
279		compatible = "siliconmitus,sm5502-muic";
280		reg = <0x25>;
281
282		interrupt-parent = <&tlmm>;
283		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
284
285		pinctrl-0 = <&muic_int_default>;
286		pinctrl-names = "default";
287	};
288};
289
290&blsp_i2c5 {
291	status = "okay";
292
293	touchscreen@24 {
294		compatible = "cypress,tt21000";
295
296		reg = <0x24>;
297		interrupt-parent = <&tlmm>;
298		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
299
300		vdd-supply = <&reg_vdd_tsp>;
301		vddio-supply = <&reg_tsp_vdd>;
302
303		pinctrl-0 = <&tsp_int_default>;
304		pinctrl-names = "default";
305	};
306};
307
308&blsp_uart2 {
309	status = "okay";
310};
311
312&pm8916_resin {
313	linux,code = <KEY_VOLUMEDOWN>;
314	status = "okay";
315};
316
317&pm8916_rpm_regulators {
318	pm8916_l17: l17 {
319		regulator-min-microvolt = <2850000>;
320		regulator-max-microvolt = <2850000>;
321	};
322};
323
324&sdhc_1 {
325	status = "okay";
326};
327
328&sdhc_2 {
329	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
330	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
331	pinctrl-names = "default", "sleep";
332
333	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
334
335	status = "okay";
336};
337
338&usb {
339	extcon = <&muic>, <&muic>;
340	status = "okay";
341};
342
343&usb_hs_phy {
344	extcon = <&muic>;
345};
346
347&wcnss {
348	status = "okay";
349};
350
351&wcnss_iris {
352	compatible = "qcom,wcn3660b";
353};
354
355&tlmm {
356	accel_int_default: accel-int-default-state {
357		pins = "gpio115";
358		function = "gpio";
359		drive-strength = <2>;
360		bias-disable;
361	};
362
363	fg_alert_default: fg-alert-default-state {
364		pins = "gpio121";
365		function = "gpio";
366		drive-strength = <2>;
367		bias-disable;
368	};
369
370	fg_i2c_default: fg-i2c-default-state {
371		pins = "gpio105", "gpio106";
372		function = "gpio";
373		drive-strength = <2>;
374		bias-disable;
375	};
376
377	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
378		pins = "gpio52";
379		function = "gpio";
380		drive-strength = <2>;
381		bias-disable;
382	};
383
384	gpio_keys_default: gpio-keys-default-state {
385		pins = "gpio107", "gpio109";
386		function = "gpio";
387		drive-strength = <2>;
388		bias-pull-up;
389	};
390
391	motor_en_default: motor-en-default-state {
392		pins = "gpio86";
393		function = "gpio";
394		drive-strength = <2>;
395		bias-disable;
396	};
397
398	motor_pwm_default: motor-pwm-default-state {
399		pins = "gpio50";
400		function = "gcc_gp2_clk_a";
401	};
402
403	muic_int_default: muic-int-default-state {
404		pins = "gpio12";
405		function = "gpio";
406		drive-strength = <2>;
407		bias-disable;
408	};
409
410	nfc_default: nfc-default-state {
411		irq-pins {
412			pins = "gpio21";
413			function = "gpio";
414			drive-strength = <2>;
415			bias-pull-down;
416		};
417
418		nfc-pins {
419			pins = "gpio49", "gpio116";
420			function = "gpio";
421			drive-strength = <2>;
422			bias-disable;
423		};
424	};
425
426	nfc_i2c_default: nfc-i2c-default-state {
427		pins = "gpio0", "gpio1";
428		function = "gpio";
429		drive-strength = <2>;
430		bias-disable;
431	};
432
433	reg_tsp_en_default: reg-tsp-en-default-state {
434		pins = "gpio73";
435		function = "gpio";
436		drive-strength = <2>;
437		bias-disable;
438	};
439
440	reg_tsp_io_en_default: reg-tsp-io-en-default-state {
441		pins = "gpio8";
442		function = "gpio";
443		drive-strength = <2>;
444		bias-disable;
445	};
446
447	sdc2_cd_default: sdc2-cd-default-state {
448		pins = "gpio38";
449		function = "gpio";
450		drive-strength = <2>;
451		bias-disable;
452	};
453
454	sensor_i2c_default: sensor-i2c-default-state {
455		pins = "gpio84", "gpio85";
456		function = "gpio";
457		drive-strength = <2>;
458		bias-disable;
459	};
460
461	tkey_default: tkey-default-state {
462		pins = "gpio20";
463		function = "gpio";
464		drive-strength = <2>;
465		bias-disable;
466	};
467
468	tkey_en_default: tkey-en-default-state {
469		pins = "gpio56";
470		function = "gpio";
471		drive-strength = <2>;
472		bias-disable;
473	};
474
475	tkey_i2c_default: tkey-i2c-default-state {
476		pins = "gpio16", "gpio17";
477		function = "gpio";
478		drive-strength = <2>;
479		bias-disable;
480	};
481
482	tkey_led_en_default: tkey-led-en-default-state {
483		pins = "gpio100";
484		function = "gpio";
485		drive-strength = <2>;
486		bias-disable;
487	};
488
489	tsp_int_default: tsp-int-default-state {
490		pins = "gpio13";
491		function = "gpio";
492		drive-strength = <2>;
493		bias-disable;
494	};
495};
496