1. Hardware Environment
表格
| Item | Value |
|---|---|
| Platform | NVIDIA Jetson Orin NX (Tegra234) |
| L4T Version | R36.4.3 |
| Kernel | 5.15.148-rt-tegra |
| Audio ADC | ES7210 (Everest Semi, 4-channel) |
| I2C Bus | Bus 1 (i2c@c240000) |
| I2C Address | 0x40 |
| I2S Interface | I2S4 (DAP4) |
| MCLK | PLLA_OUT0 → AUD_MCLK, 12.288MHz |
| ES7210 Role | Slave (Jetson I2S4 acts as master and drives BCLK/LRCK) |
2. Device Tree Configuration
ES7210 Codec Node
dts
i2c@c240000 {
es7210: es7210@40 {
compatible = "MicArray_0";
reg = <0x40>;
#sound-dai-cells = <0>;
clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
clock-names = "mclk";
assigned-clocks = <&bpmp TEGRA234_CLK_AUD_MCLK>;
assigned-clock-rates = <12288000>;
status = "okay";
};
};
Reference sample configuration for sgtl5000:
dts
i2c@<addr> {
sgtl5000: sgtl5000@0a {
compatible = "fsl,sgtl5000";
reg = <0x0a>;
clocks = <&sgtl5000_mclk>;
micbias-resistor-k-ohms = <2>;
micbias-voltage-m-volts = <3000>;
VDDA-supply = <&vdd_3v3>;
VDDIO-supply = <&vdd_3v3>;
status = "okay";
};
};
i2s@<addr> {
status = "okay";
};
DAI Link Override (Based on nvidia-audio-card C2C Link Template)
dts
&i2s4_to_codec {
link-name = "es7210-capture";
srate = <48000>;
num-channel = <4>;
bit-format = "s32_le";
codec {
sound-dai = <&es7210>;
prefix = "ES7210";
};
};
Original I2S4 C2C link template (tegra234-soc-audio-dai-links.dtsi):
dts
i2s4_to_codec: nvidia-audio-card,dai-link@79 {
status = "okay";
format = "i2s";
link-type = <C2C_LINK>; /* link-type = 2 */
cpu {
sound-dai = <&tegra_i2s4 I2S_DAP>;
};
codec {
sound-dai = <&tegra_i2s4 I2S_DUMMY>;
};
};
3. ES7210 Driver Macro Definitions
c
运行
#define ES7210_CHANNELS_MAX MIC_CHN_4
#define ES7210_TDM_ENABLE DISABLE
#define ES7210_NFS_ENABLE DISABLE
#define ES7210_WORK_MODE ES7210_NORMAL_I2S
#define RATIO_MCLK_LRCK RATIO_MCLK_LRCK_256
#define ES7210_MCLK_SOURCE FROM_PAD_PIN
4. Boot Logs
log
[ 8.555086] es7210: loading out-of-tree module taints kernel.
[ 8.556448] enter into es7210_i2c_probe!
[ 8.557016] es7210_i2c_probe: CHP_ID1_REG3D = 0x72 (expect 0x72)
[ 8.557481] es7210_i2c_probe: CHP_ID0_REG3E = 0x10 (expect 0x10)
[ 8.557943] es7210_i2c_probe, ES7210 Version = 0!
# set_dai_fmt is called 5 times, all in Slave mode (ES7210 works as slave as expected)
[ 10.914301] enter into es7210_set_dai_fmt
[ 10.914308] es7210_set_dai_fmt Slave mode
[ 10.917172] es7210_set_dai_fmt 1FS TDM Mode
[ 11.302831] enter into es7210_set_dai_fmt
[ 11.302839] es7210_set_dai_fmt Slave mode
[ 11.305717] es7210_set_dai_fmt 1FS TDM Mode
... (repeated 5 times with identical logs)
# FE (ADMAIF) PCM constraints are normal: rate range 32000-192000
[ 16.322387] ES7210_DBG: hw_complete: info=0x1c90103 fmt=0x404 ch=2-8 rate=32000-192000
[ 16.335650] ES7210_DBG: hw_complete: info=0x1c90103 fmt=0x404 ch=2-8 rate=32000-192000
... (All 20 ADMAIF PCM instances show normal constraints)
# BE (C2C link) PCM constraints abnormal: rate=0--1, rates=0x80000000 (RATE_KNOT)
[ 16.457187] ES7210_DBG: __soc_pcm_open: after init_runtime_hw rates=0x80000000 fmt=0x445 ch=1-16 rate=0--1
[ 16.457199] ES7210_DBG: __soc_pcm_open: SUCCESS
[ 16.457202] ES7210_DBG: hw_complete: info=0x103 fmt=0x445 ch=1-16 rate=0--1
... (All 5 C2C BE PCM instances show abnormal constraints)
5. Recording Test & Errors
shell
# Configure XBAR routing
amixer -c APE cset name='I2S4 Mux' 'ADMAIF1'
# Start recording
arecord -D hw:APE,0 -c 4 -r 48000 -f S32_LE -d 5 /tmp/test.wav
Recording WAVE '/tmp/test.wav' : Signed 32 bit Little Endian, Rate 48000 Hz, Channels 4
arecord: pcm_read:2221: read error: Input/output error



