how to close audio clock when the codec doesn`t work

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

how to close audio clock when the codec doesn`t work

1,262 次查看
edwardfu
Contributor I

Hi all,

I am using a codec named es8323s like wm8988. The codec is the master and the imx6 is the slave.

I have already debuged the codec well. But I want to close the clock when the codec doesn`t work. The

clock is from clko.

I am wondering if the interface of the clock to open and close is clk_prepare_enable and clk_disable_unprepare.

And I don`t know where the interface should place in the codec driver.

Thanks and Regards,

Edward

标签 (1)
0 项奖励
回复
2 回复数

1,094 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Edward

in general one can enable clock in modprobe function.

For linux clock infrastructure one can check presentation

http://elinux.org/images/b/b8/Elc2013_Clement.pdf

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

1,094 次查看
edwardfu
Contributor I

Hi Igor,

Thank you for your reply!

I have read the presentation you provided. I know the common clock framework and the API. Now I want

to use the clock API to the audio driver.

Actually I use the clk_prepare_enable to open the clock and clk_disable_unprepare to close the clock

from the imx6 to the codec. You know when the codec doesn`t work, we should close the codec. So I add

clk_prepare_enable in the codec probe function and clk_disable_unprepare in the codec remove function.

But once the imx6 board starts, the audio driver will be added and also the audio clock will be open. The audio 

clock will be closed unless the audio driver is removed. My design aim is to close clock when the codec doesn`t

work in case we can pass EMC much easier.

Thanks and best regards,

Edward

0 项奖励
回复