I have a ICS-43434 microphone connected with I2S to the IMX8DX CPU (Colibri). Our system is closed to the Iris board, but with another Audio chip. We use Torizon Os 6 version 6.5.0+build.8.
I was able to disable the SGLT5000 from the Colibri and add the ICS-43434, I can see it in the system:
root@32708f6ff5ab:/home/torizon# arecord --list-devices
**** List of CAPTURE Hardware Devices ****
card 0: ics43434 [ics43434], device 0: 59050000.sai-ics43432-hifi ics43432-hifi-0 [59050000.sai-ics43432-hifi ics43432-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
But I get an error when I try to record:
arecord: pcm_read:2221: read error: Input/output error
My guess is that I missing the clock configuration in my device tree, here what I have:
#include "imx8dx-colibri.dtsi"
/ {
model = "Toradex Colibri iMX8DX on Hygie MainBoard v1";
compatible =
"toradex,colibri-imx8x", "fsl,imx8qxp", "fsl,imx8dx";
aliases {
rtc0 = &rtc_i2c;
rtc1 = &rtc;
};
/* No sgtl5000 on Hygie */
sound_card: sound-card {
status = "disable";
};
/* ICS 43434 microphone */
sound2: sound-2 {
compatible = "simple-audio-card";
simple-audio-card,name = "ics43434";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink2>;
simple-audio-card,frame-master = <&dailink2>;
status = "okay";
dailink2: simple-audio-card,codec {
sound-dai = <&ics43432>;
clocks = <&sai1_lpcg 0>;
};
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
};
ics43432: codec@0 {
#sound-dai-cells = <0>;
compatible = "invensense,ics43432";
assigned-clock-rates = <786432000>, <49152000>, <12000000>, <12000000>;
status = "okay";
};
};
[...]
/* Override Colibri pinctrl_lpuart3_ctrl, those pins are used differently on Hygie */
pinctrl_lpuart3_ctrl: lpuart3ctrlgrp {
fsl,pins =
<IMX8QXP_SAI1_RXD_ADMA_SAI1_RXD 0x06000040>, /* SODIMM 25, SAI1 RXD */
<IMX8QXP_SAI1_RXC_ADMA_SAI1_TXC 0x0E000040>; /* SODIMM 27, I2S_SCK */ };
/* Override Colibri pinctrl_hog0, those pins are used differently on Hygie */
pinctrl_hog0: hog0grp {
fsl,pins = <IMX8QXP_SAI1_RXFS_ADMA_SAI1_TXFS 0x0E000040>; /* SODIMM 100, I2S_WS */
};
/* Override Colibri PWM_A, those pins are used differently on Hygie */
pinctrl_pwm_a: pwmagrp {
fsl,pins = <IMX8QXP_SPI0_CS1_ADMA_SAI1_TXD 0x16000040>; /* SODIMM 59, I2S_SDOUT */
};
[...]
/* I2S for Microphone */
&sai1 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_pwm_a>, <&pinctrl_lpuart3_ctrl>, <&pinctrl_hog0>;
status = "okay";
};
Could anyone help me with the device tree and the SAI clock configuration? Shall I do something else for the activation of the SAI (power?) ? Or maybe I cannot use SAI1 for my ICS 43434 audio chip?
Any help would be greatly appreciated !