summaryrefslogtreecommitdiffstats
path: root/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-rt5682.dtsi
blob: 8b855345e5c70e9ced2cb32579ab57700dcc7813 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 *
 * This file defines the common audio settings for the child boards
 * using rt5682 codec.
 *
 * Copyright 2022 Google LLC.
 */

/ {
	/* BOARD-SPECIFIC TOP LEVEL NODES */
	sound: sound {
		compatible = "google,sc7280-herobrine";
		model = "sc7280-rt5682-max98360a-1mic";

		audio-routing = "Headphone Jack", "HPOL",
				"Headphone Jack", "HPOR";

		#address-cells = <1>;
		#size-cells = <0>;

		dai-link@0 {
			link-name = "MAX98360";
			reg = <0>;

			cpu {
				sound-dai = <&lpass_cpu MI2S_SECONDARY>;
			};

			codec {
				sound-dai = <&max98360a>;
			};
		};

		dai-link@1 {
			link-name = "DisplayPort";
			reg = <1>;

			cpu {
				sound-dai = <&lpass_cpu LPASS_DP_RX>;
			};

			codec {
				sound-dai = <&mdss_dp>;
			};
		};

		dai-link@2 {
			link-name = "ALC5682";
			reg = <2>;

			cpu {
				sound-dai = <&lpass_cpu MI2S_PRIMARY>;
			};

			codec {
				sound-dai = <&alc5682 0 /* aif1 */>;
			};
		};
	};
};

hp_i2c: &i2c2 {
	clock-frequency = <400000>;
	status = "okay";

	alc5682: codec@1a {
		compatible = "realtek,rt5682s";
		reg = <0x1a>;
		pinctrl-names = "default";
		pinctrl-0 = <&hp_irq>;

		#sound-dai-cells = <1>;

		interrupt-parent = <&tlmm>;
		interrupts = <101 IRQ_TYPE_EDGE_BOTH>;

		AVDD-supply = <&pp1800_alc5682>;
		DBVDD-supply = <&pp1800_alc5682>;
		LDO1-IN-supply = <&pp1800_alc5682>;
		MICVDD-supply = <&pp3300_codec>;

		realtek,dmic1-data-pin = <1>;
		realtek,dmic1-clk-pin = <2>;
		realtek,jd-src = <1>;
		realtek,dmic-clk-rate-hz = <2048000>;
	};
};

&lpass_cpu {
	pinctrl-names = "default";
	pinctrl-0 = <&mi2s0_data0>, <&mi2s0_data1>, <&mi2s0_mclk>, <&mi2s0_sclk>, <&mi2s0_ws>,
			<&mi2s1_data0>, <&mi2s1_sclk>, <&mi2s1_ws>;

	#address-cells = <1>;
	#size-cells = <0>;

	status = "okay";

	dai-link@0 {
		reg = <MI2S_PRIMARY>;
		qcom,playback-sd-lines = <1>;
		qcom,capture-sd-lines = <0>;
	};

	dai-link@1 {
		reg = <MI2S_SECONDARY>;
		qcom,playback-sd-lines = <0>;
	};

	dai-link@5 {
		reg = <LPASS_DP_RX>;
	};
};

/* PINCTRL - ADDITIONS TO NODES IN PARENT DEVICE TREE FILES */

&mi2s0_data0 {
	drive-strength = <6>;
	bias-disable;
};

&mi2s0_data1 {
	drive-strength = <6>;
	bias-disable;
};

&mi2s0_mclk {
	drive-strength = <6>;
	bias-disable;
};

&mi2s0_sclk {
	drive-strength = <6>;
	bias-disable;
};

&mi2s0_ws {
	drive-strength = <6>;
	bias-disable;
};