AnsweredAssumed Answered

i.MX6 and MA98357a with simple-audio-card

Question asked by Alexander Koch on May 9, 2018
Latest reply on Oct 19, 2018 by Souleymane Conte

We're trying to hook up a MAX98357a Amp/Codec to an i.MX 6Solo using the 'simple-audio-card' device tree abstraction. We see no errors in dmesg and the ALSA device is visible, we can play audio files using 'aplay' but speakers remain silent.

 

Using a scope we see that data is transmitted over the I2S interface but clock lines remain silent. We also tried the solution using 'imx-pt10ex' driver instead of simple-audio-card, as suggested in #384918, but this yielded the opposite behaviour: clocks turn on and off but not data transmitted.

 

The Amp/Codec is hooked up as I2S slave on Port 3. We're using the following DTS (only relevant parts):

 

codec: max98357a@0 {
    compatible = "maxim,max98357a";
    #sound-dai-cells = <0>;
};

sound {
    compatible = "simple-audio-card";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_audmux>;
    simple-audio-card,name = "TI3 Audio";
    simple-audio-card,format = "i2s";
    simple-audio-card,widgets = "Speaker", "Speakers";
    simple-audio-card,routing = "Speakers", "Speaker";
    simple-audio-card,bitclock-master = <&cpu_dai>;
    simple-audio-card,frame-master = <&cpu_dai>;
    cpu_dai: simple-audio-card,cpu {
        sound-dai = <&ssi1 0>;
    };
    codec_dai: simple-audio-card,codec {
        sound-dai = <&codec>;
    };
};

&audmux {
    status = "okay";

    ssi0 {
        fsl,audmux-port = <MX31_AUDMUX_PORT1_SSI0>;
        fsl,port-config = <
                (IMX_AUDMUX_V2_PTCR_SYN |
                IMX_AUDMUX_V2_PTCR_TFSDIR |
                IMX_AUDMUX_V2_PTCR_TFSEL(MX31_AUDMUX_PORT3_SSI_PINS_3) |
                IMX_AUDMUX_V2_PTCR_TCLKDIR |
                IMX_AUDMUX_V2_PTCR_TCSEL(MX31_AUDMUX_PORT3_SSI_PINS_3))
                IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT3_SSI_PINS_3)
            >;
    };

    aud3 {
        fsl,audmux-port = <MX31_AUDMUX_PORT3_SSI_PINS_3>;
        fsl,port-config = <
                IMX_AUDMUX_V2_PTCR_SYN
                IMX_AUDMUX_V2_PDCR_RXDSEL(MX31_AUDMUX_PORT1_SSI0)
            >;
    };
};

&ssi1 {
    fsl,mode = "i2s-master";
    status = "okay";
};

 

(I know 'ssi0' in audmux and 'ssi1' look inconsistent, however we had a different codec running fine with these definitions so we just kept them.)

 

Any ideas or advice what might be wrong? Thanks in advance!

Outcomes