AnsweredAssumed Answered

Using ESAI1 Interface to connect I2S from another board as an ALSA card in iMX8QMMEK

Question asked by Mustafa Ozcelikors on Jul 31, 2019
Latest reply on Aug 4, 2019 by igorpadykov

I am trying to initialize ESAI1 interface on iMX8QMMEK so that it reads I2S from another board.

Our custom board has the following wiring:

 

                           SC_P_ESAI1_SCKR_AUD_ESAI1_SCKR <---------------------- WS
(iMX8QMMEK)   SC_P_ESAI1_TX5_RX0_AUD_ESAI1_TX5_RX0 <------------- DATA       (Board with I2S Out)

                           SC_P_ESAI1_FSR_AUD_ESAI1_FSR <--------------------------- BCK

 

Reading from examples, I came up with the following devicetree configuration (I use 4.14-sumo, release: fsl-imx8qm.dtsi\freescale\dts\boot\arm64\arch - linux-imx - i.MX Linux kernel ) :

 

    sound-custom {
        compatible = "simple-audio-card";
        simple-audio-card,name = "Custom_Sound_Card";
        simple-audio-card,format = "i2s";
        simple-audio-card,bitclock-master = <&dailink_master>;
        simple-audio-card,frame-master = <&dailink_master>;
        status = "okay";

 

        simple-audio-card,cpu {
            sound-dai = <&esai1>;
        };

 

        dailink_master: simple-audio-card,codec {
            sound-dai = <&codec_test>;
        };
    };

 

    codec_test: codec_test {
        compatible = "linux,snd-soc-dummy";
        #sound-dai-cells = <0>;
        status="okay";
    };

 

 

pinctrl_esai1: esai1grp {
                fsl,pins = <
                    SC_P_ESAI1_FSR_AUD_ESAI1_FSR        0xc6000040
                    SC_P_ESAI1_FST_AUD_ESAI1_FST        0xc6000040
                    SC_P_ESAI1_SCKR_AUD_ESAI1_SCKR        0xc6000040
                    SC_P_ESAI1_SCKT_AUD_ESAI1_SCKT        0xc6000040
                    SC_P_ESAI1_TX0_AUD_ESAI1_TX0        0xc6000040
                    SC_P_ESAI1_TX1_AUD_ESAI1_TX1        0xc6000040
                    SC_P_ESAI1_TX2_RX3_AUD_ESAI1_TX2_RX3    0xc6000040
                    SC_P_ESAI1_TX3_RX2_AUD_ESAI1_TX3_RX2    0xc6000040
                    /*SC_P_ESAI1_TX4_RX1_AUD_ESAI1_TX4_RX1    0xc6000040*/ /* This pin is used by another device, I commented it */
                    SC_P_ESAI1_TX5_RX0_AUD_ESAI1_TX5_RX0    0xc6000040
                >;
            };

 

esai1: esai@59810000 {
    compatible = "fsl,imx8qm-esai";
    reg = <0x0 0x59810000 0x0 0x10000>;
    interrupts = <GIC_SPI 411 IRQ_TYPE_LEVEL_HIGH>;
    clocks = <&clk IMX8QM_AUD_ESAI_1_IPG>,
        <&clk IMX8QM_AUD_ESAI_1_EXTAL_IPG>,
        <&clk IMX8QM_AUD_ESAI_1_IPG>,
        <&clk IMX8QM_CLK_DUMMY>;
    clock-names = "core", "extal", "fsys", "spba";
    dmas = <&edma3 6 0 1>, <&edma3 7 0 0>;
    dma-names = "rx", "tx";
    status = "disabled";
    power-domains = <&pd_esai1>;
};

 

&esai1 {
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_esai1>;
    assigned-clocks = <&clk IMX8QM_ACM_ESAI1_MCLK_SEL>,
            <&clk IMX8QM_AUD_PLL0_DIV>,
            <&clk IMX8QM_AUD_ACM_AUD_PLL_CLK0_DIV>,
            <&clk IMX8QM_AUD_ACM_AUD_REC_CLK0_DIV>,
            <&clk IMX8QM_AUD_ESAI_1_EXTAL_IPG>;
    assigned-clock-parents = <&clk IMX8QM_AUD_ACM_AUD_PLL_CLK0_CLK>;
    assigned-clock-rates = <0>, <786432000>, <49152000>, <24576000>, <49152000>;
    fsl,txm-rxs;
    status = "okay";
};

Unfortunately, there is no additional ALSA card showing up with the command "aplay -l". No warning or indication in "dmesg". Being able to configure esai and see a ALSA card are the first steps for me.

Another question is whether or not if using &esai1 phandle is possible with "simple-sound-card" driver.
I am quite new with this audio interfacing. I want to receive PCM data to ALSA (somehow). Is that possible? Any suggestions are greatly appreciated.

Outcomes