I’m trying to enable I2S0 to be a master for an ADC and I am trying to use rt5639.
I changed the assignments of rt5659 to rt5639 in the tegra210-jetson-cv-base-p2597-2180-a00.dts.
According to some other posts, I had to do a gpio-to-sfio for the I2S0 pins and the AUDIO_MCLK
Here is a snippet of my dts:
sound_card: sound {
compatible = "nvidia,tegra-audio-t210ref-mobile-rt5639";
nvidia,model = "tegra-snd-t210ref-mobile-rt5639";
nvidia,ldo-gpios = <&gpio TEGRA_GPIO(BB, 3) GPIO_ACTIVE_HIGH>;
nvidia,hp-det-gpios = <&gpio TEGRA_GPIO(E, 6) GPIO_ACTIVE_HIGH>;
nvidia,num-codec-link = <5>;
nvidia,audio-routing =
"x Headphone Jack", "x HPO L Playback",
"x Headphone Jack", "x HPO R Playback",
"x MICBIAS1", "x Mic Jack",
"x IN1P", "x Mic Jack",
"x Mic Det Power", "x Mic Jack",
"x Int Spk", "x SPO Playback",
"x DMIC L1", "x Int Mic",
"x DMIC L2", "x Int Mic",
"x DMIC R1", "x Int Mic",
"x DMIC R2", "x Int Mic",
"x Headphone", "x OUT",
"x IN", "x Mic",
"y Headphone", "y OUT",
"y IN", "y Mic",
"l IN", "l OUT",
"s Headphone", "s OUT",
"s IN", "s Mic";
nvidia,xbar = <&tegra_axbar>;
nvidia,dai-link-1 {
link-name = "rt5639-playback";
cpu-dai = <&tegra_i2s1>;
codec-dai = <&rt5639>;
cpu-dai-name = "I2S1";
codec-dai-name = "rt5639-aif1";
format = "i2s";
bitclock-master;
frame-master;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
bclk_ratio = <0>;
srate = <48000>;
num-channel = <2>;
ignore_suspend;
name-prefix = "x";
};
nvidia,dai-link-2 {
link-name = "spdif-dit-1";
cpu-dai = <&tegra_i2s2>;
codec-dai = <&spdif_dit1>;
cpu-dai-name = "I2S2";
codec-dai-name = "dit-hifi";
format = "dsp_a";
bitclock-slave;
frame-slave;
bitclock-inversion;
frame-inversion;
bit-format = "s16_le";
bclk_ratio = <4>;
srate = <8000>;
num-channel = <1>;
ignore_suspend;
name-prefix = "y";
};
nvidia,dai-link-3 {
link-name = "spdif-dit-2";
cpu-dai = <&tegra_dmic3>;
codec-dai = <&spdif_dit2>;
cpu-dai-name = "DMIC3";
codec-dai-name = "dit-hifi";
format = "i2s";
bit-format = "s16_le";
srate = <48000>;
num-channel = <2>;
ignore_suspend;
name-prefix = "z";
};
nvidia,dai-link-4 {
link-name = "spdif-dit-3";
cpu-dai = <&tegra_i2s3>;
codec-dai = <&spdif_dit3>;
cpu-dai-name = "I2S3";
codec-dai-name = "dit-hifi";
format = "i2s";
bitclock-slave;
frame-slave;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
bclk_ratio = <0>;
srate = <48000>;
num-channel = <2>;
ignore_suspend;
name-prefix = "l";
};
nvidia,dai-link-5 {
link-name = "spdif-dit-0";
cpu-dai = <&tegra_i2s4>;
codec-dai = <&spdif_dit0>;
cpu-dai-name = "I2S4";
codec-dai-name = "dit-hifi";
format = "i2s";
bitclock-slave;
frame-slave;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
bclk_ratio = <0>;
srate = <48000>;
num-channel = <2>;
ignore_suspend;
name-prefix = "s";
};
};
gpio@6000d000 {
gpio_default: default {
gpio-to-sfio = <
TEGRA_GPIO(B, 0) /* I2S0_LRCLK */
TEGRA_GPIO(B, 1) /* I2S0_SDIN */
TEGRA_GPIO(B, 2) /* I2S0_SDOUT */
TEGRA_GPIO(B, 3) /* I2S0_CLK/SRCLK */
TEGRA_GPIO(BB, 0) /* AUDIO_MCLK */
>;
};
};
I am not getting an output from any of the I2S0 clocks or the AUDIO_MCLK, I looked at the clock_tree but for one I’m not sure where the AUDIO_MCLK is in the clock_tree.
I’m also not getting an attempted routing it says
[7.125973] Error: Driver 'tegra-snd-t210ref-mobile-rt5639' is already registered, aborting...
Is there something wrong with my device tree that is causing this?
I am also new to this, if I am making a wrong assumption please let me know if I am going about this the wrong way.
Thanks!