源代码是Yocto 4.1.15 ,codec是wm8960,移植后,可以正确识别wm8960
aplay -L也显示识别出wm8960,
但是使用aplay test.wav时报错:
ASoC: HiFi startup failed: -16
aplay: main:828: audio open error: Device or resource busy
然后源代码里加打印,报错是sound/soc/fsl/imx-wm8960.c里的imx_hifi_startup()返回-16
这里判断条件里的话,猜测是ssi总线上数据不对
然后示波器量了MCLK确实没有信号,AUD3_TCK,TFS,TXD,RTX均为低电平
查看设备树
采用默认的配置,引脚和实际电路图对应也是对的
查看codec的代码,clocks使用的是默认的169,换了201和别的值,还是一样
最后参考别的板子的,imx7d和imx6ul上的wm8960使用的都是sai总线,
而imx6qdl.dtsi里面只有ssi总线,设备树是从wm8962改的,8962使用ssi,是不是这里不对?
恳请有经验的大佬指导下下,谢谢
Hi,
you can enable clock in clk-imx6q.c ( drivers/clk/imx/clk-imx6q.c) at first, then measure it to see if it is 24MHz
drivers/clk/imx/clk-imx6q.c
static void __init imx6q_clocks_init(struct device_node *ccm_node)
{
......
imx_clk_set_parent(clk[IMX6QDL_CLK_CKO2_SEL], clk[IMX6QDL_CLK_OSC]);
imx_clk_set_parent(clk[IMX6QDL_CLK_CKO], clk[IMX6QDL_CLK_CKO2]);
clk_set_rate(clk[IMX6QDL_CLK_CKO], 24000000);
imx_clk_prepare_enable(clk[IMX6QDL_CLK_CKO]);
... ...
}
Have a nice day!
NXP TIC weidong sun
Hi Wigros,
I have the same problem on platform 6q. I found these things(below), but not be solved.
WM8960 driver with SSI2 on Kernel 4.1.15
https://community.nxp.com/message/642991?commentID=642991#comment-642991
is there a patch for WM8960 that uses SSI?
Thanks.
Hi Eric,
You can't use imx-wm8960.c directly, the best way is that you should refer to imx-wm8962.c and write a new machine driver for your application. Because imx-wm8960.c is used to connect SAI DAI to CODEC DAI.
-----------Chinese------
你最好不要直接使用imx-wm8960.c,因为这个machine driver是把SAI DAI和WM8960 DAI连接在一起的。最好的办法是在imx-wm8962.c的基础上,写一个自己的machine driver,你可以把它叫做imx6u-wm8960.c。定义方式和imx-wm8962.c基本一致。
-------------------------
Have a nice day!
NXP TIC weidong
Hi
Thanks , I modified it according to your steps and recompiled the kernel into the board.The MCLK pin successfully generated 24MHZ waveform.
But run commond "aplay test.wav",system still error:
root@ubuntu:~# aplay test.wav
ASoC: HiFi startup failed: -16
aplay: main:828: audio open error: Device or resource busy
I measured the I2S pin:
AUD3_TCK AUD3_TFS AUD3_RXD is low
AUD3_TXD is high
Is wm8962 driver compatible with wm8960?
Thanks