How to read back the fan speed?

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

How to read back the fan speed?

跳至解决方案
1,343 次查看
eskimoalva
Contributor III

I am on a custom board using an i.MX6. I am using Yocto (Pyro) to build my kernel (4.14.16).

I am using the generic imx6qdl.dtsi device tree entry for PWM2 to drive the fan and it appears to work fine. The fan has a Tachometer input, which is connected to GPIO2_7. How do I read the fan speed? I have seen device tree blobs for cooling devices, but none of the examples I found have a tachometer input to monitor the fan's speed.

标签 (4)
0 项奖励
回复
1 解答
1,254 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Allen

seems most simple is to configure gpio interrupt and measure tachometer period.

Other option may be using GPT, if there is iomux option for that (may be checked in

IOMUX Chapter of Reference Manual).

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

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,255 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Allen

seems most simple is to configure gpio interrupt and measure tachometer period.

Other option may be using GPT, if there is iomux option for that (may be checked in

IOMUX Chapter of Reference Manual).

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

0 项奖励
回复
1,254 次查看
eskimoalva
Contributor III

This works, and I have a prototype (and extremely ugly) program that can read it.  I was hoping for a device tree solution, but there doesn't appear to be one.  It just boggles my mind that in 2019 there isn't a fan driver.

0 项奖励
回复