音频Codec芯片的时钟

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

音频Codec芯片的时钟

5,619件の閲覧回数
likangmao
Contributor I

您好!

当前我们的处理器芯片为i.MX 6Solo/6DualLite双核,音频Codec芯片使用的TAS2505芯片, Codec芯片主时钟信号由CPU引脚GPIO_19/CCM_CLK01提供,芯片驱动加载完成后,用示波器测量发现主时钟信号无输出,设备树的配置如下所示,不知道哪里出了问题,希望得到您的帮助,谢谢!

sound {
compatible = "fsl,imx-audio-tlv320";
model = "imx-tlv320";
ssi-controller = <&ssi1>;
audio-codec = <&codec>;
audio-routing =
"SPK", "Speaker Jack",
"Headphone Jack", "HPOUT";
mux-int-port = <1>;
mux-ext-port = <4>;
codec-master;
};

codec: tas2505@18 {
compatible = "ti,tas2505";
reg = <0x18>;
clocks = <&clks IMX6QDL_CLK_CKO1>;
clock-frequency = <12000000>;
};

&ssi1 {
fsl,mode = "i2s-slave";
status = "okay";
};

&audmux {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_audmux>;
};

&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;

imx6qdl-wisehmi {
pinctrl_hog: hoggrp {
fsl,pins = <
MX6QDL_PAD_GPIO_19__CCM_CLKO1 0x1b0b1
>;
};

pinctrl_audmux: audmuxgrp {
fsl,pins = <
MX6QDL_PAD_CSI0_DAT7__AUD3_RXD 0x130b0
MX6QDL_PAD_CSI0_DAT4__AUD3_TXC 0x130b0
MX6QDL_PAD_CSI0_DAT5__AUD3_TXD 0x110b0
MX6QDL_PAD_CSI0_DAT6__AUD3_TXFS 0x130b0

MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
MX6QDL_PAD_DISP0_DAT20__AUD4_TXC 0x130b0
MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x110b0
MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
>;
};

0 件の賞賛
返信
10 返答(返信)

5,013件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Kangmao,

   See the code below, please!

codec: tas2505@18 {
compatible = "ti,tas2505";
reg = <0x18>;
clocks = <&clks IMX6QDL_CLK_CKO1>;
clock-frequency = <12000000>;
};

IMX6QDL_CLK_CKO1 should be changed to be "IMX6QDL_CLK_CKO".

try it , please!

Have a nice day!

BR,

weidong

0 件の賞賛
返信

5,013件の閲覧回数
likangmao
Contributor I

Mr Wigros Sun:

Sorry!根据您说的,我将codec的clocks由&clks IMX6QDL_CLK_CKO1改为&clks IMX6QDL_CLK_CKO,重新编译烧录后,发现主时钟信号还是无输出,现在呈上原理图及相关驱动代码,烦请帮我分析一下,不胜感激!

pastedImage_1.png

pastedImage_2.png

pastedImage_3.png

0 件の賞賛
返信

5,013件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

hello Kangmao,

   Probably there are 2 ways you will try:

1. Enable and set rate directly in clk-imx6q.c (drivers/clk/imx/clk-imx6q.c).

or

2. play a xxx.wav file on command line, and measure the clock on GPIO_19 pin of CPU

I remember that only when playback begins, the clock will be enabled.

try it , please!

Weidong

0 件の賞賛
返信

5,013件の閲覧回数
likangmao
Contributor I

Hi Weidong:

第二种方式我已测试,发现无时钟信号输出, 第一种方式,我不太确定在clk-imx6q.c中如何改动代码,烦请提示一下,谢谢!

0 件の賞賛
返信

5,013件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Kangmao

 

you can enable clock in clk-imx6q.c ( drivers/clk/imx/clk-imx6q.c) at first, then measure it to see if it is 12MHz

 

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], 12000000);

                imx_clk_prepare_enable(clk[IMX6QDL_CLK_CKO]);

... ...

}

 

Have a nice day!

NXP TIC weidong sun

0 件の賞賛
返信

5,013件の閲覧回数
likangmao
Contributor I

Hi weidong:

谢谢!我尽快试一下

0 件の賞賛
返信

5,013件の閲覧回数
likangmao
Contributor I

Hi WeiDong:

不好意思,按照您上次说的,修改时钟初始化的部分,进行了尝试,音频codec芯片的主时钟信号还是没有12M,不知道问题到底出在哪里了 哭!

0 件の賞賛
返信

5,013件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi kangmao,

   No any signal or no 12MHz?

weidong

0 件の賞賛
返信

5,012件の閲覧回数
likangmao
Contributor I

Hi WeiDong:

我用示波器测量了一下,是没有任何信号输出

0 件の賞賛
返信

5,013件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hi Kangmao,

   I sent an email to you, giving you a detailed document on how to port audio driver to i.MX6, check it, please!

Have a nice day!

BR,

Weidong

0 件の賞賛
返信