I have this amplifier working with my iMX8mp verdin
codec_ext: max98357a@0 {
compatible = "maxim,max98357a";
#sound-dai-cells = <0>;
sdmode-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
};
sound_ext {
compatible = "simple-audio-card";
simple-audio-card,name = "max98357a";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master1>;
simple-audio-card,frame-master = <&dailink_master1>;
dailink_master1: simple-audio-card,cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
simple-audio-card,codec {
sound-dai = <&codec_ext>;
};
};
and down further I have this for SAI1
/* VERDIN I2S_1 */
&sai1 {
#sound-dai-cells = <0>;
assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL2_OUT>;
assigned-clock-rates = <11289600>; /*works for 44.1kHz sample rate */
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI1_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
fsl,sai-mclk-direction-output;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
};
I had to make one other important change to this file sound/soc/fsl/fsl_sai.c
comment out this clock speed check around line 555
/*
* Drop the source that can not be
* divided into the required rate.
*/
//if (ret != 0 && clk_rate / ret < 1000)
//continue;