How to read back the fan speed?

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

How to read back the fan speed?

ソリューションへジャンプ
1,341件の閲覧回数
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,252件の閲覧回数
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,253件の閲覧回数
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,252件の閲覧回数
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 件の賞賛
返信