This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TAS5825MEVM-SB: Problems encountered in porting tas5720 drivers to IMX6SX

Part Number: TAS5825MEVM-SB
Other Parts Discussed in Thread: TAS5720M

Dear Expert

I want to transplant TAS5720 to NXP IMX6SX, download the program of TAS5720 codec from the official website, and transplant the program of TAS5720 according to the program of IMX6SX WM8920 machine part. I am not familiar with tas5720 chip at the present stage. The debugging method is also relatively limited, and the project schedule is difficult.

The hardware schematic diagram is as follows:

Pin IMX6_GPIO4_29_EN_AUDIO_AMP is set to low level to ensure that the codec chip can work normally

IMX6_GPIO5_19_I2S1_MCLK is configured as an input pin

MCLK clocks are provided through BCLK

Q1: This hardware circuit scheme uses BCLK to provide MCLK and ports tas5720 driver to IMX6SX. Does the ALSA driver model support it? And considerations for using BCLK

The parameters of the audio file are as follows:

1. Sampling rate 44.1kHz;

2. Left and right double channels;

3. Data accuracy is 16 bits;

Question 2: Does the sampling frequency of this chip only support 44.1kHz, 48 kHz, 88.2kHz, 96 kHz?

/* Codec Defaults:

                   - I2S stereo mode

                   - TDM slot 0 output (mono right channel),

                   - PCM 16 bit audio data

                   - 44100/48000 Hz single speed

                   - 20.7 dBV analog gain         */

Question 3: How to configure the register related configuration of TAS5720 chip in machine code part?

TAS5720M supports 8 channels and only uses 2 channels. How should I configure it? Is there any problem with the following configuration

The configuration of CPU DAI and code DAI in machine is as follows

/* Set codec DAI Configuration slave mode */

ret = snd_soc_dai_set_fmt(codec_dai, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);

if (ret) {

dev_err(cpu_dai->dev, "failed to set codec dai fmt: %d\n", ret);

return ret;

}

 

ret = snd_soc_dai_set_fmt(cpu_dai, SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS);

if (ret) {

dev_err(cpu_dai->dev, "failed to set dai fmt\n");

return ret;

}

// Start from solt 0, 2 channels, 32

ret = snd_soc_dai_set_tdm_slot(codec_dai, 0, 0, 2, 32);

if (ret) {

dev_err(cpu_dai->dev, "failed to set codec dai tdm slot\n");

return ret;

}

 

ret = snd_soc_dai_set_tdm_slot(cpu_dai, 0, 0, 2, 32);

if (ret) {

dev_err(cpu_dai->dev, "failed to set dai tdm slot\n");

return ret;

}

 //cpu output clock

ret = snd_soc_dai_set_sysclk(cpu_dai, 0, 0, SND_SOC_CLOCK_OUT);

if (ret)

dev_err(cpu_dai->dev, "failed to set cpu sysclk\n");

Q4: It would be nice if you could provide some code reference for tas5720 driver transplant machine

Thank you very much!

  • Hi Gabriel

       For Q1:  You can connect BCLK and MCLK together, but must compliance with datasheet. Please check it.

      For Q2: Yes, only support these sample rate.

      For Q3: For your 16bit TDM mode, you only need to config Register 0x02, bits 2:0, with value 3’b011, and control your I2S clock well.

       We can't support the codes check in your system.