IMX6Q with TLV320AIC3104

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

IMX6Q with TLV320AIC3104

1,331 Views
linwangzhao
Contributor II

项目中使用TLV320AIC3104音频芯片,电路图如下所示。软件的内核版本:linux-4.1.15。目前存在的问题如下:

使用命令播放音乐时:使用示波器测量AUD3_TXC的频率为1.4115Mhz, AUD3_TXFS的频率为44.1Khz,AUD3_TXD上没有任何数据,一直为低电平。 

设备树中的相关配置如下:

sound {
compatible = "fsl,imx-audio-tlv320";
model = "tlv320-audio";
cpu-dai = <&ssi2>;
audio-codec = <&codec>;
asrc-controller = <&asrc>;
audio-routing =
"Line Out", "LLOUT",
"Line Out", "RLOUT",
"Speaker", "SPOP",
"Speaker", "SPOM",
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT",
"MIC3L", "Mic Jack",
"MIC3R", "Mic Jack",
"Mic Jack", "Mic Bias",
"LINE1L", "Line In",
"LINE1R", "Line In";
mux-int-port = <2>;
mux-ext-port = <3>;
codec-master;
};

&ssi2 {
status = "okay";
};

&i2c3 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
codec: tlv320aic3x@18 {
compatible = "ti,tlv320aic3x";
reg = <0x18>;
clocks = <&clks IMX6QDL_CLK_CKO>;
// clock-frequency = <19200000>;
gpio-reset = <&gpio1 1 GPIO_ACTIVE_LOW>;
ai3x-micbias-vg = <2>;
status = "okay";
AVDD-supply = <&reg_3p3v>;
IOVDD-supply = <&reg_3p3v>;
DRVDD-supply = <&reg_3p3v>;
DVDD-supply = <&reg_1p8v>;
};
};

reg_3p3v: regulator@6 {
compatible = "regulator-fixed";
reg = <6>;
regulator-name = "3P3V";
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
};

reg_1p8v: regulator@7 {
compatible = "regulator-fixed";
reg = <7>;
regulator-name = "1P8V";
regulator-min-microvolt = <1800000>;
regulator-max-microvolt = <1800000>;
regulator-always-on;
};

  

codec驱动文件tlv320aic3x.c、machine驱动文件imx-tlv320aic3x.c、设备树imx6qdl-sabresd.dtsi和启动log信息boot.log如附件所示。

pastedImage_1.png

使用命令查看audio的相关信息如下:

root@imx6qsabresd:~# ls /dev/snd/
by-path controlC0 pcmC0D0c pcmC0D0p timer

root@imx6qsabresd:~# i2cdetect -y -a -r 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

root@imx6qsabresd:~#
root@imx6qsabresd:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tlv320audio [tlv320-audio], device 0: HiFi tlv320aic3x-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0


root@imx6qsabresd:~#
root@imx6qsabresd:~# aplay -Dplughw:0,0 /unit_tests/audio8k16S.wav
Playing WAVE '/unit_tests/audio8k16S.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo
aplay: pcm_write:1940: write error: Input/output error

root@imx6qsabresd:~#
root@imx6qsabresd:~# i2cget -f -y 2 0x18 0x5
0x00


root@imx6qsabresd:~#
root@imx6qsabresd:~# cat /proc/asound/cards
0 [tlv320audio ]: tlv320-audio - tlv320-audio
tlv320-audio


root@imx6qsabresd:~#
root@imx6qsabresd:~# cat /proc/asound/devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
24: [ 0- 0]: digital audio capture
33: : timer


root@imx6qsabresd:~#
root@imx6qsabresd:~# cat /proc/asound/card0/id
tlv320audio


root@imx6qsabresd:~#
root@imx6qsabresd:~# i2cdump -f -y 2 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80 ...??......?...?
10: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00 ?..xxxxxx?.?..?.
20: 00 00 00 00 00 00 00 00 00 00 00 80 80 00 00 00 ...........??...
30: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00 ...?......?.....
40: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00 .?......?.......
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
60: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 ......?.........
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
80: 00 00 00 10 04 00 00 00 00 00 00 01 00 00 00 80 ...??......?...?
90: 80 ff ff 78 78 78 78 78 78 06 00 fe 00 00 fe 00 ?..xxxxxx?.?..?.
a0: 00 00 00 00 00 00 00 00 00 00 00 80 80 00 00 00 ...........??...
b0: 00 00 00 04 00 00 00 00 00 00 04 00 00 00 00 00 ...?......?.....
c0: 00 04 00 00 00 00 00 00 04 00 00 00 00 00 00 00 .?......?.......
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
e0: 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 00 ......?.........
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
root@imx6qsabresd:~#

Labels (1)
1 Reply

891 Views
igorpadykov
NXP Employee
NXP Employee

Hi Lee

for IMX6Q with TLV320AIC3104 one can look at example of eukrea board and its driver:

linux/sound/soc/fsl/eukrea-tlv320.c

linux-imx.git - i.MX Linux Kernel 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------