Skip to content

Commit 3a36c53

Browse files
jayesh-tir-vignesh
authored andcommitted
arm64: dts: ti: k3-j722s-evm: Enable analog audio support
The audio support on J722S-EVM is using TLV320AIC3106[0] codec connected to McASP1 serializers. - Add the nodes for sound-card, audio codec and McASP1. - Add hog for TRC_MUX_SEL to select between McASP and TRACE signals - Add hogs for GPIO_AUD_RSTn and MCASP1_FET_SEL which is used to switch between HDMI audio and codec audio. - Add pinmux for MCASP1 and AUDIO_EXT_REFCLK1. [0]: <https://www.ti.com/lit/gpn/TLV320AIC3106> Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com> Reviewed-by: Jai Luthra <j-luthra@ti.com> Link: https://lore.kernel.org/r/20240625113301.217369-3-j-choudhary@ti.com Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
1 parent a5cd706 commit 3a36c53

1 file changed

Lines changed: 109 additions & 0 deletions

File tree

arch/arm64/boot/dts/ti/k3-j722s-evm.dts

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@
107107
<3300000 0x1>;
108108
};
109109

110+
vsys_io_3v3: regulator-vsys-io-3v3 {
111+
compatible = "regulator-fixed";
112+
regulator-name = "vsys_io_3v3";
113+
regulator-min-microvolt = <3300000>;
114+
regulator-max-microvolt = <3300000>;
115+
regulator-always-on;
116+
regulator-boot-on;
117+
};
118+
110119
vsys_io_1v8: regulator-vsys-io-1v8 {
111120
compatible = "regulator-fixed";
112121
regulator-name = "vsys_io_1v8";
@@ -124,6 +133,35 @@
124133
regulator-always-on;
125134
regulator-boot-on;
126135
};
136+
137+
codec_audio: sound {
138+
compatible = "simple-audio-card";
139+
simple-audio-card,name = "J722S-EVM";
140+
simple-audio-card,widgets =
141+
"Headphone", "Headphone Jack",
142+
"Line", "Line In",
143+
"Microphone", "Microphone Jack";
144+
simple-audio-card,routing =
145+
"Headphone Jack", "HPLOUT",
146+
"Headphone Jack", "HPROUT",
147+
"LINE1L", "Line In",
148+
"LINE1R", "Line In",
149+
"MIC3R", "Microphone Jack",
150+
"Microphone Jack", "Mic Bias";
151+
simple-audio-card,format = "dsp_b";
152+
simple-audio-card,bitclock-master = <&sound_master>;
153+
simple-audio-card,frame-master = <&sound_master>;
154+
simple-audio-card,bitclock-inversion;
155+
156+
simple-audio-card,cpu {
157+
sound-dai = <&mcasp1>;
158+
};
159+
160+
sound_master: simple-audio-card,codec {
161+
sound-dai = <&tlv320aic3106>;
162+
clocks = <&audio_refclk1>;
163+
};
164+
};
127165
};
128166

129167
&main_pmx0 {
@@ -210,6 +248,21 @@
210248
J722S_IOPAD(0x0258, PIN_INPUT, 0) /* (B27) USB1_DRVVBUS */
211249
>;
212250
};
251+
252+
main_mcasp1_pins_default: main-mcasp1-default-pins {
253+
pinctrl-single,pins = <
254+
J722S_IOPAD(0x0090, PIN_INPUT, 2) /* (P27) GPMC0_BE0n_CLE.MCASP1_ACLKX */
255+
J722S_IOPAD(0x0098, PIN_INPUT, 2) /* (V21) GPMC0_WAIT0.MCASP1_AFSX */
256+
J722S_IOPAD(0x008c, PIN_OUTPUT, 2) /* (N23) GPMC0_WEn.MCASP1_AXR0 */
257+
J722S_IOPAD(0x0084, PIN_INPUT, 2) /* (N21) GPMC0_ADVn_ALE.MCASP1_AXR2 */
258+
>;
259+
};
260+
261+
audio_ext_refclk1_pins_default: audio-ext-refclk1-default-pins {
262+
pinctrl-single,pins = <
263+
J722S_IOPAD(0x00a0, PIN_OUTPUT, 1) /* (N24) GPMC0_WPn.AUDIO_EXT_REFCLK1 */
264+
>;
265+
};
213266
};
214267

215268
&cpsw3g {
@@ -285,6 +338,12 @@
285338
bootph-all;
286339
};
287340

341+
&k3_clks {
342+
/* Configure AUDIO_EXT_REFCLK1 pin as output */
343+
pinctrl-names = "default";
344+
pinctrl-0 = <&audio_ext_refclk1_pins_default>;
345+
};
346+
288347
&main_i2c0 {
289348
pinctrl-names = "default";
290349
pinctrl-0 = <&main_i2c0_pins_default>;
@@ -316,6 +375,41 @@
316375
gpios = <5 GPIO_ACTIVE_HIGH>;
317376
output-high;
318377
};
378+
379+
p01_hog: p01-hog {
380+
/* P01 - TRC_MUX_SEL */
381+
gpio-hog;
382+
gpios = <0 GPIO_ACTIVE_HIGH>;
383+
output-low;
384+
line-name = "TRC_MUX_SEL";
385+
};
386+
387+
p02_hog: p02-hog {
388+
/* P02 - MCASP1_FET_SEL */
389+
gpio-hog;
390+
gpios = <2 GPIO_ACTIVE_HIGH>;
391+
output-high;
392+
line-name = "MCASP1_FET_SEL";
393+
};
394+
395+
p13_hog: p13-hog {
396+
/* P13 - GPIO_AUD_RSTn */
397+
gpio-hog;
398+
gpios = <13 GPIO_ACTIVE_HIGH>;
399+
output-high;
400+
line-name = "GPIO_AUD_RSTn";
401+
};
402+
};
403+
404+
tlv320aic3106: audio-codec@1b {
405+
#sound-dai-cells = <0>;
406+
compatible = "ti,tlv320aic3106";
407+
reg = <0x1b>;
408+
ai3x-micbias-vg = <1>; /* 2.0V */
409+
AVDD-supply = <&vsys_io_3v3>;
410+
IOVDD-supply = <&vsys_io_3v3>;
411+
DRVDD-supply = <&vsys_io_3v3>;
412+
DVDD-supply = <&vsys_io_1v8>;
319413
};
320414
};
321415

@@ -457,3 +551,18 @@
457551
phys = <&serdes0_usb_link>;
458552
phy-names = "cdns3,usb3-phy";
459553
};
554+
555+
&mcasp1 {
556+
status = "okay";
557+
#sound-dai-cells = <0>;
558+
pinctrl-names = "default";
559+
pinctrl-0 = <&main_mcasp1_pins_default>;
560+
op-mode = <0>; /* MCASP_IIS_MODE */
561+
tdm-slots = <2>;
562+
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
563+
1 0 2 0
564+
0 0 0 0
565+
0 0 0 0
566+
0 0 0 0
567+
>;
568+
};

0 commit comments

Comments
 (0)