Linux device tree question - Use internal clock for SAI peripheral on IMX8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Linux device tree question - Use internal clock for SAI peripheral on IMX8

跳至解决方案
2,833 次查看
MasterFoo
Contributor II

Hi,

I have a board with a ICS43434 microphone (I2S device) connected to SAI interface of an IMX8DX. Linux runs on that microprocessor. I'm kind of novice with device tree configuration and I'm struggling to find the correct configuration for the clocks. Whatever configuration I try I have no signal going out of the SAI pins (bit clock and word clock). 
I uploaded my device tree file. This is the output of /sys/kernel/debug/clk/clk_summary when runnig arecord:

clk.png

arecord -l gives me a correct output:
arecordlist.png

But I get the following error when recording: pcm_read:2221: read error: Input/output error

What is missing so that the SAI1 clock is enabled?

Any help appreciated !

 

0 项奖励
回复
1 解答
2,709 次查看
jimmychan
NXP TechSupport
NXP TechSupport

Please try to set like this:

simple-audio-card,bitclock-master = <&cpudai>;
simple-audio-card,frame-master = <&cpudai>;

cpudai: simple-audio-card,cpu {
          sound-dai = <&sai1>;
};

在原帖中查看解决方案

6 回复数
2,791 次查看
jimmychan
NXP TechSupport
NXP TechSupport

Is your audio codec control by I2C? so put it under the I2C node.

FYI. this is the evk device tree file.

https://github.com/nxp-imx/linux-imx/blob/imx_5.4.70_2.3.0/arch/arm64/boot/dts/freescale/imx8x-mek.d...

0 项奖励
回复
2,755 次查看
MasterFoo
Contributor II

No, the ICS43434 has no I2C/SPI interface. I removed the "@" and "reg=" in the codec defintion, those were copy/paste mistakes.
Do you think I shall put the codec under another node so that the clocks are correctly configured?

0 项奖励
回复
2,749 次查看
jimmychan
NXP TechSupport
NXP TechSupport

Have you try to measure the signals? is the clock correct?

You may try to set the mclkout0_lpcg to 12288000.

0 项奖励
回复
2,727 次查看
MasterFoo
Contributor II

Yes, I'm measuring the signals (all 3 pins on I2S) and there is no clock at all. I tried many clocks rates including 12288000,
I think that I'm maybe misunderstanding what clocks, assigned-clocks and assigned-clock-parents mean...
And what I should set for sai1, the codec and the sound entry in the device tree. The others example I found while googling seem to use an external clock for the master clock, but I need to use the SAI master clock.
With the attached version of DTS I can see now sai1_lpcg_mclk enabled. But still no signals.

MasterFoo_0-1717065966159.png

 

0 项奖励
回复
2,710 次查看
jimmychan
NXP TechSupport
NXP TechSupport

Please try to set like this:

simple-audio-card,bitclock-master = <&cpudai>;
simple-audio-card,frame-master = <&cpudai>;

cpudai: simple-audio-card,cpu {
          sound-dai = <&sai1>;
};

2,695 次查看
MasterFoo
Contributor II
Thank you so much!
0 项奖励
回复