Hi all,
I have a SPH0645 I2S mic and a MAX98357a amplifier on my PCB, the mic uses SAI3 and the audio amp uses SAI1. I am using an iMX8MP
First I had the MAX98357a working very well, now for some reason when I tried to add the mic to my device tree it seems to have messed up playback through my amplifier. It has somehow made the MIC the default playback device, I was able to force aplay to use the MAX98357 but then the rate was totally wrong.
My DT looked like this:
/ {
model = "Toradex Verdin iMX8M Plus WB on Dahlia Board";
compatible = "toradex,verdin-imx8mp-wifi-dahlia",
"toradex,verdin-imx8mp-wifi",
"toradex,verdin-imx8mp",
"fsl,imx8mp";
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>;
};
};
};
Now I added this for the MIC:
/ {
model = "Toradex Verdin iMX8M Plus WB on Dahlia Board";
compatible = "toradex,verdin-imx8mp-wifi-dahlia",
"toradex,verdin-imx8mp-wifi",
"toradex,verdin-imx8mp",
"fsl,imx8mp";
codec_ext: max98357a@0 {
compatible = "maxim,max98357a";
#sound-dai-cells = <0>;
sdmode-gpios = <&gpio3 0 GPIO_ACTIVE_HIGH>;
};
sound {
compatible = "fsl,imx-audio-sph0645",
"fsl,imx-mic-sph0645";
model = "sph0645-audio";
cpu-dai = <&sai3>;
status = "okay";
};
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>;
};
};
};
What have I done wrong? For some reason both appear as playback devices:
root@verdin-imx8mp-07129897:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxaudiosph0645 [imx-audio-sph0645], device 0: imx-sph0645 snd-soc-dummy-dai-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: max98357a [max98357a], device 0: 30c10000.sai-HiFi HiFi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0