ADC/TX1 and I2S

Hi,

I’m trying to record the audio signal coming from my PCM4204EVM ADC board via I2S. After searching for some Linux ASoC drivers I found that there aren’t any for this particular ADC.
Would the easiest way to set this up to use a driver like tlv320aic325x driver and modify it for the pcm4204?
I’ve been trying to use the rt5639 but I haven’t been able to quite get that working so I’m looking for other options. Or should I continue with trying to use rt5639?
I would think I just need to set up the pins so I can capture and a driver, but I’m not sure.

I’m not sure how to proceed. If anyone has experience connecting an adc and recording audio on the tx1 I would appreciate any advice.

Thank you.

Hi Rain
Have you review document? There’s a chapter tegra_soc driver may help.

Hi Shane,

Thanks for the reply.

I have reviewed the tegra_soc driver section in the documentation.
I’m confused on how it explains to populate the dai-links is it something you do in the device tree or in the tegra210_machine_driver.h file?

I have the error where there is “no source widget found” and “Failed to add route”.
Could you explain more on how I would fix this issue? The documentation sort of covers it but doesn’t cover what files to change unless I am missing something.

Also, I’m assuming this is a problem that has to do with “Failed to add route”, when I try to use amixer commands I get "amixer: Unable to find simple control ‘I2S1 Mux’,0
Is my assumption correct?

Hi Takingrain

Here’s the patch for to enable the reference rt5639
And you need to reference to below link to add "gpio-to-sfio like below.

gpio-to-sfio = < 
	TEGRA_GPIO(B, 0)     /*   8 H1 I2S0_LRCLK/SFSYNC */
	TEGRA_GPIO(B, 1)     /*   9 G1 I2S0_SDIN         */
	TEGRA_GPIO(B, 2)     /*  10 H2 I2S0_SDOUT        */
	TEGRA_GPIO(B, 3)     /*  11 G2 I2S0_CLK/SRCLK    */
	TEGRA_GPIO(BB, 0)    /* 216 F1 AUDIO_MCLK     */
>;

https://devtalk.nvidia.com/default/topic/1006883
c676f2c5.diff.zip (1.09 KB)

@ShaneCCC, the patch (c676f2c5.diff) you’ve posted seems to be enabling a rt5658 codec device. Could you confirm the rt5658 (or rt5659) codec driver also works for rt5639?

Don’t struggling with the name. I think they are pin to pin chip. And should be worked with the same driver.

Hi @ShaneCCC,

This is what I have for the gpio-to-sfio, that should work right?

gpio: gpio@6000d000 {
    gpio-init-names = "default";
        gpio-init-0 = <&gpio_default>;
        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/SCLK */
            TEGRA_GPIO(BB, 0) /* AUDIO_MCLK */
        >;
    };
};

I think so, if not try to use dtc to un-compile the DTB to dts to make sure of it.

Example of using dtc to reverse compile and re-compile:

dtc -I dtb -O dts -o /tmp/extracted.dts /boot/the_firmware_in_extlinux.dtb
dtc -I dts -O dtb -o /tmp/modified.dtb /tmp/extracted.dts

You can either “apt-get install dtc” or use the version which is built with the kernel in the scripts.