To use ADAU7002 device as a PDM to i2s converter on i.MX8MQ board, wrote imx8mq-evk.dts file like below :
we use a SPH0641LM4H-1 mic as a PDM source .
sound_adau7002: sound-adau7002 {
compatible = "simple-audio-card";
simple-audio-card,name = "DigitalMics";
simple-audio-card,format = "i2s";
simple-audio-card,widgets =
"Microphone", "Microphone Jack" ;
// Maybe adde widget: PDM
simple-audio-card,routing =
"PDM_DAT" , "DigitalMics" ;
// The SSI2 is the I2S master.
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
status = "okay";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai2>;
/* system-clock-frequency = <883200>; */
};
dailink_slave: simple-audio-card,codec {
sound-dai = <&adau7002>;
clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
};
};
adau7002: pdm-to-i2s {
#sound-dai-cells = <0>;
#address-cells = <0>;
#size-cells = <0>;
compatible = "adi,adau7002";
status = "okay";
//IOVDD-supply = <®_3p3v>;
};
....
&sai2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
status = "okay";
};
above excerpted from apalis-imx6-support-i2s-output-to-adau7002
when board kernel boots, it displays kernel error messages :
oot@imx8mqevk:~# dmesg | grep -i adau
[ 2.480408] adau7002 pdm-to-i2s: pdm-to-i2s supply IOVDD not found, using dummy regulator
[ 2.496971] asoc-simple-card sound-adau7002: adau7002-hifi <-> 308b0000.sai mapping ok
[ 2.505012] asoc-simple-card sound-adau7002: ASoC: no source widget found for DigitalMics
[ 2.513305] asoc-simple-card sound-adau7002: ASoC: Failed to add route DigitalMics -> direct -> PDM_DAT
root@imx8mqevk:~# [ 35.873269] VSD_3V3: disabling
Thanks in advance
Solved! Go to Solution.
modified imx8mq-evk.dts , it works now
sound_adau7002: sound-adau7002 {
compatible = "simple-audio-card";
simple-audio-card,name = "adau7002";
simple-audio-card,format = "i2s";
simple-audio-card,widgets =
"Microphone", "Microphone Jack";
// Maybe adde widget: PDM
/*
simple-audio-card,routing =
"PDM_DAT", "Digital Mics" ;
*/
simple-audio-card,routing =
"Capture" , "PDM_DAT" ,
"ADAU AIF", "PDM_DAT" ,
"Capture", "IOVDD" ;
/*
simple-audio-card,routing =
"PDM_DAT", "Microphone Jack" ;
*/
// The SSI2 is the I2S master.
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
status = "okay";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai2>;
/*system-clock-frequency = <883200>; */
};
dailink_slave: simple-audio-card,codec {
sound-dai = <&adau7002>;
clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
};
};
adau7002: pdm-to-i2s {
#sound-dai-cells = <0>;
#address-cells = <0>;
#size-cells = <0>;
compatible = "adi,adau7002";
status = "okay";
/* IOVDD-supply = <®_3p3v>; */
IOVDD-supply = <&vgen5_reg>;
};
=== kernel bootng message ===
root@imx8mqevk:~# dmesg | grep -i adau
[ 5.431478] VineTel ### adau7002_component_probe start !!!
[ 5.431485] VineTel ### adau7002_component_probe ### success !!!
[ 5.456647] debugfs: Directory '308b0000.sai' with parent 'adau7002' already present!
[ 5.671118] asoc-simple-card sound-adau7002: adau7002-hifi <-> 308b0000.sai mapping ok
[ 5.705614] asoc-simple-card sound-adau7002: ASoC: no DMI vendor name!
[ 7.877467] #0: adau7002
root@imx8mqevk:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: adau7002 [adau7002], device 0: 308b0000.sai-adau7002-hifi adau7002-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@imx8mqevk:~#
My SAI2 Configuration is
sai2 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
assigned-clocks = <&clk IMX8MQ_CLK_SAI2>;
assigned-clock-parents = <&clk IMX8MQ_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
status = "okay";
};
pinctrl_sai2: sai2grp {
/*
fsl,pins = <
MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0xd6
MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0xd6
MX8MQ_IOMUXC_SAI2_MCLK_SAI2_MCLK 0xd6
MX8MQ_IOMUXC_SAI2_TXD0_SAI2_TX_DATA0 0xd6
>;
*/
fsl,pins = <
MX8MQ_IOMUXC_SAI2_RXD0_SAI2_RX_DATA0 0x000000C7
MX8MQ_IOMUXC_SAI2_TXC_SAI2_TX_BCLK 0x000000C7
MX8MQ_IOMUXC_SAI2_TXFS_SAI2_TX_SYNC 0x000018c7
>;
};
we don't need SAI MCLK pin In HW connection .
Maybe there can be SMT(Surface Maunt Technology ) problem .
Thanks && BR.
Hi jhpark_vine
one can look at pdm example
linux configuration in sect.7.6.4.3 Menu Configuration Options i.MX Linux Reference Manual
sect.7.5 Audio Mixer (AUDMIX), sect.7.6 PDM and unit tests:
https://source.codeaurora.org/external/imx/imx-test/tree/test/mxc_amix_test?h=imx_5.4.47_2.2.0
https://source.codeaurora.org/external/imx/imx-test/tree/test/mxc_pdm_test?h=imx_5.4.47_2.2.0
Best regards
igor
My development hw setup : IMX8M QuadEVK Interfaced to ADAU7002 ( PDM to I2S ) that has a SPH0641LM4H-1 (PDM MIC ) as a sound source :
.i.MX8M <---> I2S <---> ADAU70002 <----> PDM <---> SPH0641LM4H-1
so don't need "sound_adau7002: sound-adau7002" configuration which is a simple sound device ?
I finished kernel driver configuration for ADAU7002 and Pin-muxing with ADAU7002 via SAI2 bus .
some ADAU7002 routing configuration problem occurs..
// Maybe adde widget: PDM
simple-audio-card,routing =
"PDM_DAT" , "DigitalMics" ;
[ 2.513305] asoc-simple-card sound-adau7002: ASoC: Failed to add route DigitalMics -> direct -> PDM_DAT
modified imx8mq-evk.dts , it works now
sound_adau7002: sound-adau7002 {
compatible = "simple-audio-card";
simple-audio-card,name = "adau7002";
simple-audio-card,format = "i2s";
simple-audio-card,widgets =
"Microphone", "Microphone Jack";
// Maybe adde widget: PDM
/*
simple-audio-card,routing =
"PDM_DAT", "Digital Mics" ;
*/
simple-audio-card,routing =
"Capture" , "PDM_DAT" ,
"ADAU AIF", "PDM_DAT" ,
"Capture", "IOVDD" ;
/*
simple-audio-card,routing =
"PDM_DAT", "Microphone Jack" ;
*/
// The SSI2 is the I2S master.
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
status = "okay";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai2>;
/*system-clock-frequency = <883200>; */
};
dailink_slave: simple-audio-card,codec {
sound-dai = <&adau7002>;
clocks = <&clk IMX8MQ_CLK_SAI2_ROOT>;
};
};
adau7002: pdm-to-i2s {
#sound-dai-cells = <0>;
#address-cells = <0>;
#size-cells = <0>;
compatible = "adi,adau7002";
status = "okay";
/* IOVDD-supply = <®_3p3v>; */
IOVDD-supply = <&vgen5_reg>;
};
=== kernel bootng message ===
root@imx8mqevk:~# dmesg | grep -i adau
[ 5.431478] VineTel ### adau7002_component_probe start !!!
[ 5.431485] VineTel ### adau7002_component_probe ### success !!!
[ 5.456647] debugfs: Directory '308b0000.sai' with parent 'adau7002' already present!
[ 5.671118] asoc-simple-card sound-adau7002: adau7002-hifi <-> 308b0000.sai mapping ok
[ 5.705614] asoc-simple-card sound-adau7002: ASoC: no DMI vendor name!
[ 7.877467] #0: adau7002
root@imx8mqevk:~# arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: adau7002 [adau7002], device 0: 308b0000.sai-adau7002-hifi adau7002-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
root@imx8mqevk:~#
Hello, I'm doing similar work about adau7002 things and I have a question.
My HW connection is below which almost similar like yours.
i.MX8MM <----> adau7002(PDM to I2S) <----> ICS-41351(PDM MIC)
And I failed to initialize adau7002 device driver with this message "/sound-adau7002/simple-audio-card,cpu: could not get $sound-dai-cells for /sai@30030000".
In your device-tree dtsi, Can you tell me about SAI2 pinctrl sai2 settings?
Actually, there is just 3 connections which In my HW connection(Rx Data, Frame Sync, Bit Clock) so I modified my SAI pinctrl group like below but it's not working.
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_RXD_SAI3_RX_DATA0 0xd6
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6
>;
};
I did like above settings because we didn't connect anything at SAI MCLK pin In HW connection. Even we didn't put any MCLK in HW, Should I have to set MCLK at pinctrl grp?
It would be really helpful if you reply this question.
Thanks.