How to read back the fan speed?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to read back the fan speed?

Jump to solution
905 Views
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.

Labels (4)
0 Kudos
1 Solution
816 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
817 Views
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 Kudos
816 Views
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 Kudos