IMX8MP Audio Codec TLV320AIC3101 Interface

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8MP Audio Codec TLV320AIC3101 Interface

2,517 Views
MJD
Contributor II

Hello,
We are working with custom board with imx8mp processor, we are using TLV320AIC3101 chip for audio codec, i have configured imx8mp-evk.dts file as below

#include <dt-bindings/phy/phy-imx8-pcie.h>
#include <dt-bindings/usb/pd.h>
#include "imx8mp.dtsi"
....
sound-tlv320aic3101 {
compatible = "simple-audio-card";
simple-audio-card,name = "HTC2-Sound-Card";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai3>;
};
};
&i2c3 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";

tlv320aic3101: tlv320aic3101@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic31xx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tlv320>;
reg = <0x18>;
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
IOVDD-supply = <&buck5>; /* 3V3 buck5 */
DVDD-supply = <&buck5>; /* 1V8 buck5 */
AVDD-supply = <&buck4>; /* 3V3 buck4 */
DRVDD-supply = <&buck4>; /* 3V3 buck4 */
};
&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
fsl,sai-mclk-direction-output;
status = "okay";
};

pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
>;
};
 
pinctrl_tlv320: tlv320grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x00 
>;
};
i2c bus 2 
root@imx8mp-lpddr4-evk:~# i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@imx8mp-lpddr4-evk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxaudioxcvr [imx-audio-xcvr], device 0: XCVR PCM snd-soc-dummy-dai-0 [XCVR PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: btscoaudio [bt-sco-audio], device 0: 30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

>Is my Dts configuring is correct?
>i have not removed codec wm8960 in dtb do i need to remove?
> is this enough if we configure in imx8mp-evk.dts file? or do i need to make changes in any file?. Please guide me to fix.

complete dts file attached below.

ThankYou.

@mathad22 . @david_ochs

0 Kudos
9 Replies

669 Views
MJD
Contributor II

Hi @JosephAtNXP 
I am getting bellow logs when i try to start pulseaudio --start

[ 1740.322659] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.331071] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.344818] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.351902] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.360301] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.371158] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.378237] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.386635] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.397486] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.404569] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.412972] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.423770] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.430851] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.439251] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.450095] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.457177] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22
[ 1740.465576] 30c30000.sai-tlv320aic3x-hifi: ASoC: error at __soc_pcm_hw_params on 30c30000.sai-tlv320aic3x-hifi: -22
[ 1740.479482] fsl-sai 30c30000.sai: failed to derive required Rx rate: 1411200
[ 1740.486571] fsl-sai 30c30000.sai: ASoC: error at snd_soc_dai_hw_params on 30c30000.sai: -22

Bellow are the dts inputs,
1 sound-tlv320aic310x {
152 compatible = "simple-audio-card";
153 simple-audio-card,name = "sound-tlv320aic310x";
154 simple-audio-card,format = "i2s";
155 simple-audio-card,bitclock-master = <&cpudai2>;
156 simple-audio-card,frame-master = <&cpudai2>;
157 simple-audio-card,mclk-fs = <256>;
158 simple-audio-card,widgets =
159 "Microphone", "Microphone Jack",
160 "Line", "Line In Jack",
161 "Line", "Line Out Jack",
162 "Headphone", "Headphone Jack",
163 "Speaker", "Speaker External";
164 simple-audio-card,routing =
165 "Headphone Jack", "HPLOUT",
166 "Headphone Jack", "HPROUT";
167 cpudai2:simple-audio-card,cpu {
168 sound-dai = <&sai3>;
169 };
170 simple-audio-card,codec {
171 sound-dai = <&codec>;
172 clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
173 };
174 };

660 &i2c3 {
661 clock-frequency = <400000>;
662 pinctrl-names = "default", "gpio";
663 pinctrl-0 = <&pinctrl_i2c3>;
664 status = "okay";
665
666 codec: codec@18 {
667 #sound-dai-cells=<0>;
668 pinctrl-names = "default";
669 pinctrl-0 = <&pinctrl_tlv320>;
670 compatible = "ti,tlv320aic3x";
671 reg = <0x18>;
672 reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
673 IOVDD-supply = <&buck5>;
674 DVDD-supply = <&buck5>;
675 AVDD-supply = <&buck4>;
676 DRVDD-supply = <&buck4>;
677 };
678
&sai3 {
903 #sound-dai-cells = <0>;
904 pinctrl-names = "default";
905 pinctrl-0 = <&pinctrl_sai3>;
906 assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
907 assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
908 assigned-clock-rates = <12288000>;
909 clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
910 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
911 <&clk IMX8MP_CLK_DUMMY>, <&clk IMX8MP_AUDIO_PLL1_OUT>, <&clk IMX8MP_AUDIO_PLL2_OUT>;
912 clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
913 fsl,sai-synchronous-rx;
914 status = "okay";
915 };

pinctrl_tlv320: tlv320grp {
1254 fsl,pins = <
1255 MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x00
1256 >;
1257 };
1258
1259 pinctrl_sai3: sai3grp {
1260 fsl,pins = <
1261 MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
1262 MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
1263 MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
1264 MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
1265 MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
1266 MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
1267 MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
1268 >;
1269 };
root@imx8mp-lpddr4-evk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: btscoaudio [bt-sco-audio], device 0: 30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: soundtlv320aic3 [sound-tlv320aic310x], device 0: 30c30000.sai-tlv320aic3x-hifi tlv320aic3x-hifi-0 [30c30000.sai-tlv320aic3x-hifi tlv320aic3x-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
root@imx8mp-lpddr4-evk:~#
 

root@imx8mp-lpddr4-evk:~# aplay -f S16_LE -c 1 -r 48000 --device plughw:1,0 Rear_Center.wav
Playing WAVE 'Rear_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
^CAborted by signal Interrupt...
aplay: pcm_write:2127: write error: Interrupted system call
root@imx8mp-lpddr4-evk:~# aplay -f S16_LE -c 2 -r 8000 --device plughw:1,0 Rear_Center.wav
Playing WAVE 'Rear_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
^CAborted by signal Interrupt...
aplay: pcm_write:2127: write error: Interrupted system call
root@imx8mp-lpddr4-evk:~#
root@imx8mp-lpddr4-evk:~#
root@imx8mp-lpddr4-evk:~# grep -E "clock|sai3" /sys/kernel/debug/clk/clk_summary
clock count count count rate accuracy phase cycle enable
sai3_mclk 0 0 0 0 0 0 50000 Y
sai3_mclk3_clk 0 0 0 49152000 0 0 50000 N
sai3_mclk2_sel 0 0 0 24000000 0 0 50000 Y
sai3_mclk2_clk 0 0 0 24000000 0 0 50000 N
sai3_ipg_clk 0 0 0 400000000 0 0 50000 N
sai3 0 0 0 12288000 0 0 50000 N
sai3_root 0 0 0 12288000 0 0 50000 N
sai3_mclk1_sel 0 0 0 12288000 0 0 50000 Y
sai3_mclk1_clk 0 0 0 12288000 0 0 50000 N
root@imx8mp-lpddr4-evk:~#

We are not able listen music, but some buss sound we can listen.

Guide me if in any changes required are any necessary things to check.

0 Kudos

639 Views
MJD
Contributor II

@JosephAtNXP 

Reminder

0 Kudos

607 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your inputs, I've seen that there is no error detected in the digital interface, therefore, there probably aren't errors on your current setup.

I'd look in the analog side, there might be the issue, the error message that you saw is prompted when the play is interrupted, therefore the communication is ok, now look into the analog side,

Sorry for the delay,

Regards,

0 Kudos

2,451 Views
mathad22
Contributor III

Hi MJD,

I can see already 2 mistakes in the devicetree you shared, 2 devices are trying to use the same SAI(sai3), and your audio sound card doesn't indicate what codec you want to use.

Also, you have to decide which device is the master, SAI or codec, and configure your GPIO depending on that, see more information in the iMX8 user guide PDF.

0 Kudos

2,443 Views
MJD
Contributor II

hi @mathad22 

Thankyou for your response,

Ya i have corrected those, but still i am not able to get the chip up, below are the updated configurations.

sound-tlv320aic31xx {
151 compatible = "simple-audio-card";
152 simple-audio-card,name = "HTC2-Sound-Card";
153 simple-audio-card,format = "i2s";
154 simple-audio-card,frame-master = <&dailink_master>;
155 simple-audio-card,bitclock-master = <&dailink_master>;
156 simple-audio-card,mclk-fs = <256>;
157 simple-audio-card,widgets =
158 "Microphone", "Microphone Jack",
159 "Line", "Line In Jack",
160 "Line", "Line Out Jack",
161 "Headphone", "Headphone Jack",
162 "Speaker", "Speaker External";
163 simple-audio-card,routing =
164 "Headphone Jack", "HPLOUT",
165 "Headphone Jack", "HPROUT";
166 dailink_master: simple-audio-card,cpu {
167 sound-dai = <&sai3>;
168 };
169 simple-audio-card,codec {
170 sound-dai = <&codec>;
171 clock = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
172 };
173 };

170 vdd_input: vdd_input {
171 compatible = "regulator-fixed";
172 regulator-name = "vdd_input";
173 regulator-min-microvolt = <5000000>;
174 regulator-max-microvolt = <5000000>;
175 };

&i2c3 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
 
codec: tlv320aic3101@18 {
#sound-dai-cells=<0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dac_rst>;
        compatible = "ti,tlv320aic3101";
                reg = <0x18>;
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
HPVDD-supply = <&buck4>; 
                SPRVDD-supply = <&vdd_input>; //5V Input How To Show? 
                SPLVDD-supply = <&vdd_input>; //5V Input
                AVDD-supply = <&buck4>; 
                IOVDD-supply = <&buck5>; 
                DVDD-supply = <&buck5>;
};

&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
// fsl,sai-mclk-direction-output;
status = "okay";
};

pinctrl_dac_rst: dacrstgrp { 
                fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10     0x00 
                >; 
        }; 
 
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
>;
};
root@imx8mp-lpddr4-evk:~# dmesg | grep "tlv*"
[ 0.050896] audit: initializing netlink subsys (disabled)
[ 2.001262] OF: /sound-tlv320aic31xx/simple-audio-card,cpu: could not get #sound-dai-cells for /soc@0/bus@30c00000/spba-bus@30c00000/sai@30c30000
[ 2.015850] asoc-simple-card sound-tlv320aic31xx: error -EINVAL: parse error
[ 2.027439] asoc-simple-card: probe of sound-tlv320aic31xx failed with error -22
[ 3.259982] mxc-mipi-csi2-sam 32e40000.csi: lanes: 2, hs_settle: 13, clk_settle: 2, wclk: 1, freq: 500000000
[ 5.432635] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ 5.525277] systemd[1]: Listening on Network Service Netlink Socket.
[ 12.021468] audit: type=1327 audit(1677836965.896:15): proctitle="(weston)"

can you please guide me to fix this.

0 Kudos

2,477 Views
MJD
Contributor II

Hi,

 169     sound-tlv320aic3101 {

 170         compatible = "simple-audio-card";

 171         simple-audio-card,name = "HTC2-Sound-Card";

 172         simple-audio-card,format = "i2s";

 173         simple-audio-card,bitclock-master = <&dailink_master>;

 174         simple-audio-card,frame-master = <&dailink_master>;

 175         simple-audio-card,mclk-fs = <256>;

 176         simple-audio-card,widgets =

 177             "Microphone", "Microphone Jack",

 178             "Line", "Line In Jack",

 179             "Line", "Line Out Jack",

 180             "Headphone", "Headphone Jack",

 181             "Speaker", "Speaker External";

 182         simple-audio-card,routing =

 183             "Headphone Jack", "HPLOUT",

 184             "Headphone Jack", "HPROUT";

 185     dailink_master: simple-audio-card,cpu {

 186         sound-dai = <&sai3>;

 187         };

 188     simple-audio-card,codec {

 189         sound-dai = <&tlv320aic3101>;

 190         clock = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;

 191         };

 192     };

559 &i2c2 {

 560     clock-frequency = <100000>;

 561     pinctrl-names = "default";

 562     pinctrl-0 = <&pinctrl_i2c2>;

 563     status = "okay";

 564 

 565     adv_bridge: adv7535@3d {

 566         compatible = "adi,adv7535";

 567         reg = <0x3d>;

 568         adi,addr-cec = <0x3b>;

 569         adi,dsi-lanes = <4>;

 570         status = "okay";

 571 

 572         port {

 573             adv7535_from_dsim: endpoint {

 574                 remote-endpoint = <&dsim_to_adv7535>;

 575             };

 576         };

 577     };

 ..

 579     lvds_bridge: lvds-to-hdmi-bridge@4c {

 580         compatible = "ite,it6263";

 581         reg = <0x4c>;

 582         reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;

 583 

 584         port {

 585             it6263_in: endpoint {

 586                 remote-endpoint = <&lvds_out>;

 587             };

 588         };

 589     };

 590 

 591     tlv320aic3101: tlv320aic3101@18 {

 592         #sound-dai-cells = <0>;

 593         compatible = "ti,tlv320aic31xx";

 594         pinctrl-names = "default";

 595         pinctrl-0 = <&pinctrl_tlv320>;

 596         reg = <0x18>;

 597         reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;

 598         IOVDD-supply = <&buck5>; /* 3V3 buck5 */

 599         DVDD-supply = <&buck5>; /* 1V8 buck5 */

 600         AVDD-supply = <&buck4>; /* 3V3 buck4 */

 601         DRVDD-supply = <&buck4>; /* 3V3 buck4 */

 602     };

 901 &sai3 {

 902     #sound-dai-cells = <0>;

 903     pinctrl-names = "default";

 904     pinctrl-0 = <&pinctrl_sai3>;

 905     assigned-clocks = <&clk IMX8MP_CLK_SAI3>;

 906     assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;

 907     assigned-clock-rates = <12288000>;

 908     clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,

 909         <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,

 910         <&clk IMX8MP_CLK_DUMMY>;

 911     clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";

 912     fsl,sai-mclk-direction-output;

 913     status = "okay";

 914 };

1252     pinctrl_sai3: sai3grp {

1253         fsl,pins = <

1254             MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC  0xd6

1255             MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK  0xd6

1256             MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6

1257             MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6

1258             MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK   0xd6

1259             MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28       0xd6

1260             MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29        0xd6

1261         >;

1262     };

1263 

1264     pinctrl_tlv320: tlv320grp {

1265         fsl,pins = <

1266             MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10   0x00 

1267         >;

1268     };

1269 

with the above configuration i am able to see the log below has mentioned

root@imx8mp-lpddr4-evk:~# dmesg | grep "tlv"

[  20.195192] platform sound-tlv320aic3101: deferred probe pending


>Is my Dts configuring is correct?
>i have not removed codec wm8960 in dtb do i need to remove?
> is this enough if we configure in imx8mp-evk.dts file? or do i need to make changes in any file?. Please guide me to fix.

Thankyou,

 

 

0 Kudos

2,471 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

I'm reviewing your dts, if WM codec isn't in your board you could remove it,

Regards

0 Kudos

2,269 Views
MJD
Contributor II

Hi @JosephAtNXP 
Thankyou for your response,

sound-tlv320aic31xx {
compatible = "simple-audio-card";
simple-audio-card,name = "HTC2-Sound-Card";
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai3>;
};
simple-audio-card,codec {
sound-dai = <&codec>;
clock = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
};
};

vdd_input: vdd_input {
compatible = "regulator-fixed";
regulator-name = "vdd_input";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
};

&i2c3 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";

codec: tlv320aic3101@18 {
#sound-dai-cells=<0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_dac_rst>;
compatible = "ti,tlv320aic3101";
reg = <0x18>;
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
HPVDD-supply = <&buck4>;
SPRVDD-supply = <&vdd_input>; //5V Input How To Show?
SPLVDD-supply = <&vdd_input>; //5V Input
AVDD-supply = <&buck4>;
IOVDD-supply = <&buck5>;
DVDD-supply = <&buck5>;
};

&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
// fsl,sai-mclk-direction-output;
status = "okay";
};

pinctrl_dac_rst: dacrstgrp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x00
>;
};

pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
>;
};
this is my latest testing configuration as in the above 
imx8mp-lpddr4-evk login: root
root@imx8mp-lpddr4-evk:~# dmesg | grep "tlv*"
[ 0.050829] audit: initializing netlink subsys (disabled)
[ 1.999522] OF: /sound-tlv320aic31xx/simple-audio-card,cpu: could not get #sound-dai-cells for /soc@0/bus@30c00000/spba-bus@30c00000/sai@30c30000
[ 2.013810] asoc-simple-card sound-tlv320aic31xx: error -EINVAL: parse error
[ 2.025404] asoc-simple-card: probe of sound-tlv320aic31xx failed with error -22
[ 3.287772] mxc-mipi-csi2-sam 32e40000.csi: lanes: 2, hs_settle: 13, clk_settle: 2, wclk: 1, freq: 500000000
[ 5.508521] systemd[1]: Listening on initctl Compatibility Named Pipe.
[ 5.601072] systemd[1]: Listening on Network Service Netlink Socket.
[ 13.155046] audit: type=1327 audit(1677836966.992:10): proctitle="(systemd)"
[ 13.194468] audit: type=1327 audit(1677836967.004:11): proctitle="(systemd)"
root@imx8mp-lpddr4-evk:~# [ 42.936746] kauditd_printk_skb: 8 callbacks suppressed

Please update with this.

0 Kudos

1,797 Views
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your inputs, could you see if this helps?

0 Kudos