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