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.

PCM3060: The DIN and DOUT pins of PCM3060 are connected to the same I2S, only one of its ADC and DAC can work normally.

Part Number: PCM3060

Hi, we use pcm3060 under Linux, and only one ADC and DAC can work.

In terms of hardware design,The DIN and DOUT of the pcm3060 are connected to the same I2S of the SoC, as follows:

The software is the driver program provided by the official.

And I have two questions: 

1. Is our hardware design reasonable?Can DIN and DOUT pins be connected to the same I2S on the Soc?

2. We have referred to the drivers of many codec chips under Linux kernel4.9 and kernel5.1. ADC and DAC are usually integrated into one codec dai, while the pcm3060 codec dai is divided into two separate control interfaces, ADC and DAC. Can they be integrated into one in the pcm3060 driver? As shown in the following picture:

  • Is our hardware design reasonable?Can DIN and DOUT pins be connected to the same I2S on the Soc?

    Yes, this shouldn't be a problem.

    Also, I have added our Linux driver expert based in China to comment, please be patient as his comment on the thread may be in a few days.

    Regards,

  • Thanks. Looking forward to your reply from the Linux driver expert based in China.

  • Hi yl,

    Can you share the DTS file? and tell me how you config your sound node?

  • Hi. Thans for your reply.

    	i2c@31e0000 {
    		...
    		pcm3060: pcm3060@47 {
    			compatible = "ti,pcm3060";
    			reg = <0x47>;
    			ti,out-single-ended = "true";
    		};
    	};
    
    	sound {
    		iommus = <0x2 0x1e>;
    		dma-mask = <0x0 0x5e000000>;
    		iommu-resv-regions = <0x0 0x0 0x0 0x40000000 0x0 0x60000000 0xffffffff 0xffffffff>;
    		iommu-group-id = <0x2>;
    		status = "okay";
    		nvidia,num-codec-link = <0xc>;
    		nvidia,num-clk = <0x8>;
    		nvidia,clk-rates = <0x10266000 0xac4400 0x2b11000 0x2b11000 0xea60000 0xbb8000 0x2ee0000 0x2ee0000>;
    		nvidia,xbar = <0x2e>;
    		compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
    		nvidia,model = "jetson-xaviernx-ape";
    		clocks = <0x4 0x5d 0x4 0x68 0x4 0x7>;
    		clock-names = "pll_a", "pll_a_out0", "extern1";
    		assigned-clocks = <0x4 0x68 0x4 0x7>;
    		assigned-clock-parents = <0x4 0x5d 0x4 0x68>;
    		mclk-fs = <0x100>;
    		linux,phandle = <0xd0>;
    		phandle = <0xd0>;
    		
    		nvidia,audio-routing =
    			"x Headphone",          "x OUTL",
    			"x Headphone",          "x OUTR",
    			"x INL",               "x Mic",
    			"x INR",               "x Mic",
    			"y Headphone",          "y OUT",
    			"y IN",                 "y Mic",
    			"z Headphone",          "z OUT",
    			"z IN",                 "z Mic",
    			"m Headphone",          "m OUT",
    			"m IN",                 "m Mic",
    			"n Headphone",          "n OUT",
    			"n IN",                 "n Mic",
    			"o Headphone",          "o OUT",
    			"o IN",                 "o Mic",
    			"a IN",                 "a Mic",
    			"b IN",                 "b Mic",
    			"c IN",                 "c Mic",
    			"d IN",                 "d Mic",
    			"d1 Headphone",         "d1 OUT",
    			"d2 Headphone",         "d2 OUT";
    
    		...
    
    		nvidia,dai-link-5 {
    			link-name = "pcm3060-codec";
    			cpu-dai = <0x37>;
    			codec-dai = <&pcm3060>;
    			cpu-dai-name = "I2S5";
    			codec-dai-name = "pcm3060-hifi";
    			format = "i2s";
    			bit-format = "s16_le";
    			srate = <0xbb80>;
    			num-channel = <0x2>;
    			ignore_suspend;
    			name-prefix = "x";
    			status = "okay";
    		};
    	};

    This is the modified dts file after decompiling according to the dtb file.

  • Hi,

    Thanks for sharing!

    I think the DTS you shared is correct. Because only one dai-link in DTS, you can only define one DAI item in driver code.

    So yes, you can integrate ADC and DAC into one pcm3060 dai driver, like the image you had shown, 

    Thanks & Best Regards

    Kevin Lu