ADAU7002 interfacing with SAI on iMX6UL

Hello,

I am trying to setup the device tree of my Variscite iMX6UL Dart SOM to interface with multiple ADAU7002 in TDM format using simple sound card. I have made edits in the dtsi file to try and enable SAI3 with no luck. Here are my edits to the simple sound card with the ADAU7002 as input and the WM8731 as my output.

_________imx6ul-imx6ull-var-dart-common.dtsi___________

sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "master-sound";
        simple-audio-card,widgets =
            "Headphone", "Headphone Jack",
            "Line", "Line Jack",
            "Microphone", "Mic Jack";
        simple-audio-card,routing =
            "Headphone Jack", "RHPOUT",
            "Headphone Jack", "LHPOUT",
            "LLINEIN", "Line Jack",
            "RLINEIN", "Line Jack",
            "MICIN", "Mic Bias",
            "Mic Bias", "Mic Jack";

        simple-audio-card,dai-link@0{
            format = "i2s";
            bitclock-master = <&wm8731_dac>;
            frame-master = <&wm8731_dac>;
            /*bitclock-inversion;*/
    
            cpu {
                sound-dai = <&sai2>;
            };
    
            wm8731_dac: codec {
                sound-dai = <&codec>;
                system-clock-id = <2>;  /* WM8731_SYSCLK_MCLK */
                system-clock-frequency = <12288000>;
            };
        };

        simple-audio-card,dai-link@1{
            format = "left_j";
            bitclock-master = <&adau7002_adc>;
            frame-master = <&adau7002_adc>;
            mclk-fs = <3>;
    
            cpu {
                sound-dai = <&sai3>;
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <32>;
            };
    
            adau7002_adc: codec {
                sound-dai = <&sai3>;
                system-clock-id = <3>;  
                system-clock-frequency = <12288000>;
            };
        };
        
        adau7002: adau7002-tdm {
            compatible = "adi,adau7002";
        };    
    };

Also here are some edits for the iomux:

        pinctrl_sai3: sai3grp {
            fsl,pins = <
                MX6UL_PAD_LCD_DATA09__SAI3_MCLK        0x17088
                MX6UL_PAD_LCD_DATA11__SAI3_RX_BCLK      0x17088
                MX6UL_PAD_LCD_DATA14__SAI3_RX_DATA    0x11088
                MX6UL_PAD_LCD_DATA10__SAI3_RX_SYNC      0x17088
            >;
        };

Here is the addition of SAI3 to the device tree as well:

&sai3 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_sai3>;
    assigned-clocks = <&clks IMX6UL_CLK_SAI3_SEL>,
              <&clks IMX6UL_CLK_SAI3>;
    assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
    assigned-clock-rates = <0>, <12288000>;
    fsl,sai-mclk-direction-output;
    status = "okay";
};

When I look at the boot log I get errors regarding my dai-link parsing. Not sure what the problem is with my parsing but here are the errors from the log:

[    2.373092] OF: /sound/simple-audio-card,dai-link@0/cpu: could not get #sound-dai-cells for /soc/aips-bus@02000000/spba-bus@02000000/sai@0202c000
[    2.385201] asoc-simple-card sound: parse error -22
[    2.388850] asoc-simple-card: probe of sound failed with error -22
[    2.395213] fsl-asrc 2034000.asrc: failed to get spba clock
[    2.405975] imx6ul-pinctrl 20e0000.iomuxc: pin MX6UL_PAD_LCD_DATA11 already requested by 21c8000.lcdif; cannot claim for 2030000.sai
[    2.417085] imx6ul-pinctrl 20e0000.iomuxc: pin-81 (2030000.sai) status -22
[    2.423870] imx6ul-pinctrl 20e0000.iomuxc: could not request pin 81 (MX6UL_PAD_LCD_DATA11) from group sai3grp  on device 20e0000.iomuxc
[    2.435009] fsl-sai 2030000.sai: Error applying setting, reverse things back
[    2.442949] fsl-sai: probe of 2030000.sai failed with error -22

Thank you,

Jordan

  • 0
    •  Analog Employees 
    on Mar 5, 2019 9:41 PM

    Hello Jordan,

    I cannot help you much with the actual code but I can say that it looks like you are trying to make the ADAU7002 be a master and that is not possible. The 7002 has to have clocks sent to it. From those clocks it figures out what the format is and will setup the part accordingly. I suggest you hook up a scope to look at the clocks being sent to the 7002 to see if it is in the correct format. All you need to send to it is bit clock and LRCLK (sometimes called frame clock)

    Then also put a scope probe on the SDATA out of the 7002 to see if it is sending any data. This post of mine will give you some suggestions as to how to setup the scope to see the data and then take screenshots to post.

    https://ez.analog.com/audio/f/discussions/3510/how-to-take-meaningful-screenshots-of-i2s-audio-signals

    Dave T