How to enable I2S2 in dts file?

I’m using TX1 on our carrier board with L4T R28.1.

I need use I2S2 as master, and use the default dummy codec spidf_dit0.

But there is not any signal in I2S2 interface.

I change dts file base on tegra210-jetson-tx1-p2597-2180-a01-devkit.dts

After I changed,the dts like this:

nvidia,num-codec-link = <1>;

nvidia,audio-routing =
“x Headphone”, “x OUT”,
“x IN”, “x Mic”;
nvidia,dai-link-1 {
link-name = “rt565x-playback”;
cpu-dai = <&tegra_i2s2>;
codec-dai = <&spdif_dit0>;
cpu-dai-name = “I2S2”;
codec-dai-name = “dit-hifi”;
format = “i2s”;
//bitclock-slave;
bitclock-master;
//frame-slave;
frame-master;
bitclock-noninversion;
frame-noninversion;
bit-format = “s16_le”;
bclk_ratio = <0>;
srate = <48000>;
num-channel = <2>;
name-prefix = “x”;I
};

I also enabled the sfio.
gpios = <
TEGRA_GPIO(B, 0) 0
TEGRA_GPIO(B, 1) 0
TEGRA_GPIO(B, 2) 0
TEGRA_GPIO(B, 3) 0
TEGRA_GPIO(K, 0) 0
TEGRA_GPIO(K, 1) 0
TEGRA_GPIO(K, 2) 0
TEGRA_GPIO(K, 3) 0
TEGRA_GPIO(BB, 0) 0
TEGRA_GPIO(BB, 3) 0
>;

Is there other things need to do?

I found there is some different default setting in I2S2.

i2s@702d1100 {
pinctrl-names = “dap_active”, “dap_inactive”;
pinctrl-0 = <>;
pinctrl-1 = <>;
regulator-supplies = “vdd-1v8-spi-hv”, “vdd-1v8-spi-hv-bias”;
vdd-1v8-spi-hv-supply = <&max77620_sd3>;
vdd-1v8-spi-hv-bias-supply = <&max77620_sd3>;
fsync-width = <0>;
};

Like the “fsync-width”.

when use this command:

amixer -c 1 sset ‘I2S2 Mux’ ‘ADMAIF1’
aplay -Dhw:1,0 piano2.wav

print this error:
[ 41.269251] tegra210-i2s tegra210-i2s.1: Failed at I2S1_TX sw reset
[ 41.275518] tegra210-i2s tegra210-i2s.1: ASoC: PRE_PMU: I2S2 DAP TX event failed: -22
then end. Not really play audio.

When I use the I2S1 instead I2S2, the error became "Failed at I2S0_TX sw reset ", But there is not I2S0_TX in /sys/kernel/debug/asoc/. Why use I2Sn, it will report I2S(n-1)?

The dummy codec spidf_dit can not use bitclock-master and frame-master ?

And my I2S2 setting is right?
fsync-width need remove? It does not work after remove.

Somebody of NVidia can help me ?

Discussing at [url]https://devtalk.nvidia.com/default/topic/1026157/jetson-tx1/how-to-enable-i2s2-i2s5b-in-tx1-/[/url]

The spdif_dit is a slave driver only can configure as slave mode.

…/kernel/kernel-4.4/sound/soc/tegra-virtual/tegra124_virt_apbif_slave.c