xref: /freebsd/sys/contrib/device-tree/src/arm64/qcom/msm8939-samsung-a7.dts (revision c57c26179033f64c2011a2d2a904ee3fa62e826a)
1// SPDX-License-Identifier: GPL-2.0-only
2
3/dts-v1/;
4
5#include "msm8939-pm8916.dtsi"
6#include "msm8916-modem-qdsp6.dtsi"
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/interrupt-controller/irq.h>
11#include <dt-bindings/sound/apq8016-lpass.h>
12
13/ {
14	model = "Samsung Galaxy A7 (2015)";
15	compatible = "samsung,a7", "qcom,msm8939";
16	chassis-type = "handset";
17
18	aliases {
19		mmc0 = &sdhc_1; /* SDC1 eMMC slot */
20		mmc1 = &sdhc_2; /* SDC2 SD card slot */
21		serial0 = &blsp_uart2;
22	};
23
24	chosen {
25		stdout-path = "serial0";
26	};
27
28	reserved-memory {
29		/* Additional memory used by Samsung firmware modifications */
30		tz-apps@85500000 {
31			reg = <0x0 0x85500000 0x0 0xb00000>;
32			no-map;
33		};
34	};
35
36	gpio-hall-sensor {
37		compatible = "gpio-keys";
38
39		pinctrl-0 = <&gpio_hall_sensor_default>;
40		pinctrl-names = "default";
41
42		label = "GPIO Hall Effect Sensor";
43
44		event-hall-sensor {
45			label = "Hall Effect Sensor";
46			gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
47			linux,input-type = <EV_SW>;
48			linux,code = <SW_LID>;
49			linux,can-disable;
50		};
51	};
52
53	gpio-keys {
54		compatible = "gpio-keys";
55
56		pinctrl-0 = <&gpio_keys_default>;
57		pinctrl-names = "default";
58
59		label = "GPIO Buttons";
60
61		button-volume-up {
62			label = "Volume Up";
63			gpios = <&tlmm 107 GPIO_ACTIVE_LOW>;
64			linux,code = <KEY_VOLUMEUP>;
65		};
66
67		button-home {
68			label = "Home";
69			gpios = <&tlmm 109 GPIO_ACTIVE_LOW>;
70			linux,code = <KEY_HOMEPAGE>;
71		};
72	};
73
74	i2c-fg {
75		compatible = "i2c-gpio";
76		sda-gpios = <&tlmm 106 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
77		scl-gpios = <&tlmm 105 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
78
79		pinctrl-0 = <&fg_i2c_default>;
80		pinctrl-names = "default";
81
82		#address-cells = <1>;
83		#size-cells = <0>;
84
85		battery@35 {
86			compatible = "richtek,rt5033-battery";
87			reg = <0x35>;
88
89			interrupt-parent = <&tlmm>;
90			interrupts = <121 IRQ_TYPE_EDGE_BOTH>;
91
92			pinctrl-0 = <&fg_alert_default>;
93			pinctrl-names = "default";
94		};
95	};
96
97	i2c-nfc {
98		compatible = "i2c-gpio";
99		sda-gpios = <&tlmm 0 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
100		scl-gpios = <&tlmm 1 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
101
102		pinctrl-0 = <&nfc_i2c_default>;
103		pinctrl-names = "default";
104
105		#address-cells = <1>;
106		#size-cells = <0>;
107
108		nfc@2b {
109			compatible = "nxp,pn547", "nxp,nxp-nci-i2c";
110			reg = <0x2b>;
111
112			interrupt-parent = <&tlmm>;
113			interrupts = <21 IRQ_TYPE_EDGE_RISING>;
114
115			enable-gpios = <&tlmm 116 GPIO_ACTIVE_HIGH>;
116			firmware-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
117
118			pinctrl-0 = <&nfc_default>;
119			pinctrl-names = "default";
120		};
121	};
122
123	i2c-sensor {
124		compatible = "i2c-gpio";
125		sda-gpios = <&tlmm 84 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
126		scl-gpios = <&tlmm 85 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
127
128		pinctrl-0 = <&sensor_i2c_default>;
129		pinctrl-names = "default";
130
131		#address-cells = <1>;
132		#size-cells = <0>;
133
134		accelerometer: accelerometer@10 {
135			compatible = "bosch,bmc150_accel";
136			reg = <0x10>;
137			interrupt-parent = <&tlmm>;
138			interrupts = <115 IRQ_TYPE_EDGE_RISING>;
139
140			vdd-supply = <&pm8916_l17>;
141			vddio-supply = <&pm8916_l5>;
142
143			pinctrl-0 = <&accel_int_default>;
144			pinctrl-names = "default";
145
146			mount-matrix = "-1", "0", "0",
147					"0", "-1", "0",
148					"0", "0", "1";
149		};
150
151		magnetometer@12 {
152			compatible = "bosch,bmc150_magn";
153			reg = <0x12>;
154
155			vdd-supply = <&pm8916_l17>;
156			vddio-supply = <&pm8916_l5>;
157		};
158	};
159
160	i2c-tkey {
161		compatible = "i2c-gpio";
162		sda-gpios = <&tlmm 16 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
163		scl-gpios = <&tlmm 17 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
164
165		pinctrl-0 = <&tkey_i2c_default>;
166		pinctrl-names = "default";
167
168		#address-cells = <1>;
169		#size-cells = <0>;
170
171		touchkey@20 {
172			/* Note: Actually an ABOV MCU that implements same interface */
173			compatible = "coreriver,tc360-touchkey";
174			reg = <0x20>;
175
176			interrupt-parent = <&tlmm>;
177			interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
178
179			vcc-supply = <&reg_touch_key>;
180			vdd-supply = <&reg_keyled>;
181			vddio-supply = <&pm8916_l6>;
182
183			linux,keycodes = <KEY_APPSELECT KEY_BACK>;
184
185			pinctrl-0 = <&tkey_default>;
186			pinctrl-names = "default";
187		};
188	};
189
190	pwm_vibrator: pwm-vibrator {
191		compatible = "clk-pwm";
192		#pwm-cells = <2>;
193
194		clocks = <&gcc GCC_GP2_CLK>;
195
196		pinctrl-0 = <&motor_pwm_default>;
197		pinctrl-names = "default";
198	};
199
200	reg_keyled: regulator-keyled {
201		compatible = "regulator-fixed";
202		regulator-name = "keyled";
203		regulator-min-microvolt = <3300000>;
204		regulator-max-microvolt = <3300000>;
205
206		/* NOTE: On some variants e.g. SM-A700FD it's GPIO 91 */
207		gpio = <&tlmm 100 GPIO_ACTIVE_HIGH>;
208		enable-active-high;
209
210		pinctrl-0 = <&tkey_led_en_default>;
211		pinctrl-names = "default";
212	};
213
214	reg_touch_key: regulator-touch-key {
215		compatible = "regulator-fixed";
216		regulator-name = "touch_key";
217		regulator-min-microvolt = <2800000>;
218		regulator-max-microvolt = <2800000>;
219
220		gpio = <&tlmm 56 GPIO_ACTIVE_HIGH>;
221		enable-active-high;
222
223		pinctrl-0 = <&tkey_en_default>;
224		pinctrl-names = "default";
225	};
226
227	reg_tsp_vdd: regulator-tsp-vdd {
228		compatible = "regulator-fixed";
229		regulator-name = "tsp_vdd";
230		regulator-min-microvolt = <1800000>;
231		regulator-max-microvolt = <1800000>;
232		vin-supply = <&pm8916_s4>;
233
234		gpio = <&tlmm 8 GPIO_ACTIVE_HIGH>;
235		enable-active-high;
236
237		pinctrl-0 = <&reg_tsp_io_en_default>;
238		pinctrl-names = "default";
239	};
240
241	reg_vdd_tsp: regulator-vdd-tsp {
242		compatible = "regulator-fixed";
243		regulator-name = "vdd_tsp";
244		regulator-min-microvolt = <3300000>;
245		regulator-max-microvolt = <3300000>;
246
247		gpio = <&tlmm 73 GPIO_ACTIVE_HIGH>;
248		enable-active-high;
249
250		pinctrl-0 = <&reg_tsp_en_default>;
251		pinctrl-names = "default";
252	};
253
254	reg_vibrator: regulator-vibrator {
255		compatible = "regulator-fixed";
256		regulator-name = "motor_en";
257		regulator-min-microvolt = <3000000>;
258		regulator-max-microvolt = <3000000>;
259
260		gpio = <&tlmm 86 GPIO_ACTIVE_HIGH>;
261		enable-active-high;
262
263		pinctrl-0 = <&motor_en_default>;
264		pinctrl-names = "default";
265	};
266
267	vibrator {
268		compatible = "pwm-vibrator";
269
270		pwms = <&pwm_vibrator 0 100000>;
271		pwm-names = "enable";
272
273		vcc-supply = <&reg_vibrator>;
274	};
275};
276
277&blsp_i2c1 {
278	status = "okay";
279
280	muic: extcon@25 {
281		compatible = "siliconmitus,sm5502-muic";
282		reg = <0x25>;
283
284		interrupt-parent = <&tlmm>;
285		interrupts = <12 IRQ_TYPE_EDGE_FALLING>;
286
287		pinctrl-0 = <&muic_int_default>;
288		pinctrl-names = "default";
289	};
290};
291
292&blsp_i2c2 {
293	status = "okay";
294
295	speaker_codec: audio-codec@34 {
296		compatible = "nxp,tfa9895";
297		reg = <0x34>;
298		vddd-supply = <&pm8916_l5>;
299		sound-name-prefix = "Speaker";
300		#sound-dai-cells = <0>;
301	};
302};
303
304&blsp_i2c5 {
305	status = "okay";
306
307	touchscreen@24 {
308		compatible = "cypress,tt21000";
309
310		reg = <0x24>;
311		interrupt-parent = <&tlmm>;
312		interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
313
314		vdd-supply = <&reg_vdd_tsp>;
315		vddio-supply = <&reg_tsp_vdd>;
316
317		pinctrl-0 = <&tsp_int_default>;
318		pinctrl-names = "default";
319	};
320};
321
322&blsp_uart2 {
323	status = "okay";
324};
325
326/*
327 * For some reason the speaker amplifier is connected to the second SD line
328 * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the
329 * device tree, otherwise audio will seemingly play fine on the wrong SD line
330 * but the speaker stays silent.
331 *
332 * When routing audio via QDSP6 (the default) the &lpass node is reserved and
333 * the definitions from &q6afedai are used. When the modem is disabled audio can
334 * be alternatively routed directly to the LPASS hardware with reduced latency.
335 * The definitions for &lpass are here for completeness to simplify changing the
336 * setup with minor changes to the DT (either manually or with DT overlays).
337 */
338&lpass {
339	dai-link@3 {
340		reg = <MI2S_QUATERNARY>;
341		qcom,playback-sd-lines = <1>;
342	};
343};
344
345&mpss_mem {
346	reg = <0x0 0x86800000 0x0 0x5800000>;
347};
348
349&pm8916_resin {
350	linux,code = <KEY_VOLUMEDOWN>;
351	status = "okay";
352};
353
354&pm8916_rpm_regulators {
355	pm8916_l17: l17 {
356		regulator-min-microvolt = <2850000>;
357		regulator-max-microvolt = <2850000>;
358	};
359};
360
361&q6afedai {
362	dai@22 {
363		reg = <QUATERNARY_MI2S_RX>;
364		qcom,sd-lines = <1>;
365	};
366};
367
368&sdhc_1 {
369	status = "okay";
370};
371
372&sdhc_2 {
373	pinctrl-0 = <&sdc2_default &sdc2_cd_default>;
374	pinctrl-1 = <&sdc2_sleep &sdc2_cd_default>;
375	pinctrl-names = "default", "sleep";
376
377	cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
378
379	status = "okay";
380};
381
382&sound {
383	model = "samsung-a2015";
384	audio-routing =
385		"AMIC1", "MIC BIAS External1",
386		"AMIC2", "MIC BIAS Internal2",
387		"AMIC3", "MIC BIAS External1";
388
389	pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>;
390	pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>;
391	pinctrl-names = "default", "sleep";
392
393	sound_link_backend2: backend2-dai-link {
394		link-name = "Quaternary MI2S";
395
396		cpu {
397			sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
398		};
399		platform {
400			sound-dai = <&q6routing>;
401		};
402		codec {
403			sound-dai = <&speaker_codec>;
404		};
405	};
406};
407
408&usb {
409	extcon = <&muic>, <&muic>;
410	status = "okay";
411};
412
413&usb_hs_phy {
414	extcon = <&muic>;
415};
416
417&wcnss {
418	status = "okay";
419};
420
421&wcnss_iris {
422	compatible = "qcom,wcn3660b";
423};
424
425&wcnss_mem {
426	status = "okay";
427};
428
429&tlmm {
430	accel_int_default: accel-int-default-state {
431		pins = "gpio115";
432		function = "gpio";
433		drive-strength = <2>;
434		bias-disable;
435	};
436
437	fg_alert_default: fg-alert-default-state {
438		pins = "gpio121";
439		function = "gpio";
440		drive-strength = <2>;
441		bias-disable;
442	};
443
444	fg_i2c_default: fg-i2c-default-state {
445		pins = "gpio105", "gpio106";
446		function = "gpio";
447		drive-strength = <2>;
448		bias-disable;
449	};
450
451	gpio_hall_sensor_default: gpio-hall-sensor-default-state {
452		pins = "gpio52";
453		function = "gpio";
454		drive-strength = <2>;
455		bias-disable;
456	};
457
458	gpio_keys_default: gpio-keys-default-state {
459		pins = "gpio107", "gpio109";
460		function = "gpio";
461		drive-strength = <2>;
462		bias-pull-up;
463	};
464
465	motor_en_default: motor-en-default-state {
466		pins = "gpio86";
467		function = "gpio";
468		drive-strength = <2>;
469		bias-disable;
470	};
471
472	motor_pwm_default: motor-pwm-default-state {
473		pins = "gpio50";
474		function = "gcc_gp2_clk_a";
475	};
476
477	muic_int_default: muic-int-default-state {
478		pins = "gpio12";
479		function = "gpio";
480		drive-strength = <2>;
481		bias-disable;
482	};
483
484	nfc_default: nfc-default-state {
485		irq-pins {
486			pins = "gpio21";
487			function = "gpio";
488			drive-strength = <2>;
489			bias-pull-down;
490		};
491
492		nfc-pins {
493			pins = "gpio49", "gpio116";
494			function = "gpio";
495			drive-strength = <2>;
496			bias-disable;
497		};
498	};
499
500	nfc_i2c_default: nfc-i2c-default-state {
501		pins = "gpio0", "gpio1";
502		function = "gpio";
503		drive-strength = <2>;
504		bias-disable;
505	};
506
507	reg_tsp_en_default: reg-tsp-en-default-state {
508		pins = "gpio73";
509		function = "gpio";
510		drive-strength = <2>;
511		bias-disable;
512	};
513
514	reg_tsp_io_en_default: reg-tsp-io-en-default-state {
515		pins = "gpio8";
516		function = "gpio";
517		drive-strength = <2>;
518		bias-disable;
519	};
520
521	sdc2_cd_default: sdc2-cd-default-state {
522		pins = "gpio38";
523		function = "gpio";
524		drive-strength = <2>;
525		bias-disable;
526	};
527
528	sensor_i2c_default: sensor-i2c-default-state {
529		pins = "gpio84", "gpio85";
530		function = "gpio";
531		drive-strength = <2>;
532		bias-disable;
533	};
534
535	tkey_default: tkey-default-state {
536		pins = "gpio20";
537		function = "gpio";
538		drive-strength = <2>;
539		bias-disable;
540	};
541
542	tkey_en_default: tkey-en-default-state {
543		pins = "gpio56";
544		function = "gpio";
545		drive-strength = <2>;
546		bias-disable;
547	};
548
549	tkey_i2c_default: tkey-i2c-default-state {
550		pins = "gpio16", "gpio17";
551		function = "gpio";
552		drive-strength = <2>;
553		bias-disable;
554	};
555
556	tkey_led_en_default: tkey-led-en-default-state {
557		pins = "gpio100";
558		function = "gpio";
559		drive-strength = <2>;
560		bias-disable;
561	};
562
563	tsp_int_default: tsp-int-default-state {
564		pins = "gpio13";
565		function = "gpio";
566		drive-strength = <2>;
567		bias-disable;
568	};
569};
570