iMX8 Selecting IMX8MM_AUDIO_PLL1_OUT or IMX8MM_AUDIO_PLL2_OUT using sofware

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

iMX8 Selecting IMX8MM_AUDIO_PLL1_OUT or IMX8MM_AUDIO_PLL2_OUT using sofware

跳至解决方案
1,800 次查看
edwardtyrrell
Senior Contributor I

Hi All,

Is it possible to swap/change PLLs (IMX8MM_AUDIO_PLL1_OUT, IMX8MM_AUDIO_PLL2_OUT) within a driver via software? Currently our SoC CODEC driver uses a fixed PLL as its main reference for calculating audio rates. I understand the normal way to use the PLL source is to declare it in the device tree using the "assigned-clock-parents" property; but we now need to change the PLL source within the driver on demand.

Any advice appreciated.

Thanks.

 

   

 

0 项奖励
回复
1 解答
1,755 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

Hi @edwardtyrrell,

I understand your use case, but unfortunately, the frequencies cannot be changed at run time from the software. The NXP does not provide support for the same.
Changes in the device tree are recommended.

Thanks & Regards,
Ritesh M Patel

在原帖中查看解决方案

0 项奖励
回复
7 回复数
1,770 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

Hi @edwardtyrrell,

Hope you are doing well.
Please accept my apologies for the delay in response.

As per the hierarchy, The driver shall take the reference from device-tree nodes. Here the audio driver is connected to the SAI interface, so if we change the "assigned-clock-parents" property of the 
particular SAI node in the device tree, it will change the PLL source automatically.

Thanks & Regards,
Ritesh M Patel

0 项奖励
回复
1,767 次查看
edwardtyrrell
Senior Contributor I

Hi @riteshmpatel ,

Thanks for your reply; yes I understand when you said "if we change the "assigned-clock-parents" property of the particular SAI node in the device tree, it will change the PLL source automatically"; but my question is I need to change the PLL source inside the driver on demand. Fixing the parent clock in the device tree forces the audio rates to be ether all 44K1 based or all 48K based. Our customers who want to listen to 44K1, 88K2 and 48K, 96K rates won't want to recompile their device trees every time they want to change audio rates! We need a build that will do both rates (44K1+ and 48K+). Is the only other way using an external MCLK clock like a PL611?

Cheers.

 

0 项奖励
回复
1,756 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

Hi @edwardtyrrell,

I understand your use case, but unfortunately, the frequencies cannot be changed at run time from the software. The NXP does not provide support for the same.
Changes in the device tree are recommended.

Thanks & Regards,
Ritesh M Patel

0 项奖励
回复
1,749 次查看
edwardtyrrell
Senior Contributor I

Hi @riteshmpatel,

Just rereading your reply; it's not the frequencies that need changing in the driver it's the source selection i.e PLL1 or PLL2 to clock the SAI. The fixed device tree frequencies are fine, it's we'd like to switch the routing of either PLL1 or PLL2 to the SAI hardware. Possible?

 

Thanks.

 

0 项奖励
回复
1,745 次查看
riteshmpatel
NXP TechSupport
NXP TechSupport

Hi @edwardtyrrell,

Unfortunately, switching the routing of either PLL1 or PLL2 to SAI hardware is not possible.

The only possible solution is to change the PLL clock in the device tree.

Thanks & Regards,
Ritesh M Patel

0 项奖励
回复
1,743 次查看
edwardtyrrell
Senior Contributor I
Thanks! Appreciate the quick response.
0 项奖励
回复
1,752 次查看
edwardtyrrell
Senior Contributor I

Hi @riteshmpatel,

Thanks, that's the information I am looking for. So the way to go is an external MCLK that I can toggle the two base frequencies via a GPIO (depending on requested base rate). Well, at least in theory..

Cheers!

0 项奖励
回复