项目作者: neg2led

项目描述 :
CM4 IO board PWM fan controller driver
高级语言: C
项目地址: git://github.com/neg2led/cm4io-fan.git
创建时间: 2021-05-08T09:07:14Z
项目社区:https://github.com/neg2led/cm4io-fan

开源协议:GNU General Public License v2.0

下载


cm4io-fan

kernel module and device tree overlay to add support for the EMC2301 fan controller on the Raspberry Pi Compute Module 4 IO Board.

Works with 5.10+ 64-bit kernels only.

Uses Traverse Technologies’ EMC2301 hwmon driver for their ten64 board, which you should definitely check out because it’s awesome.

Usage

  1. Install dkms if you haven’t already:
    1. sudo apt install dkms
  2. Download the latest source .tar.gz from the releases page
  3. Untar it to /usr/src/cm4io-fan-<version> and run the dkms install:
    1. tar -xzvf 0.2.0.tar.gz -C /usr/src/
    2. sudo dkms install cm4io-fan/0.2.0
  4. Add these lines to your /boot/config.txt (adjust the rpm values for your specific fan, defaults are 3500 / 5500) and reboot.
    See below for more config options.
    1. # Enable I2C bus 1 on VideoCore (/dev/i2c-10 in Raspberry Pi OS)
    2. dtparam=i2c_vc=on
    3. # Enable CM4 IO Board fan controller
    4. dtoverlay=cm4io-fan,minrpm=1000,maxrpm=5000
  5. Some distributions may not automatically load the kernel module despite the devicetree entry; Raspberry Pi OS does, Ubuntu 21.10 does not, etc.
    To make the module load, edit /etc/modules (or make a new file called /etc/modules-load.d/cm4io-fan.conf), adding this line:
    1. emc2301

Install from git

  1. Install dkms if you haven’t already:
    1. sudo apt install dkms
  2. Clone the repo
    1. mkdir -p ~/src
    2. cd ~/src
    3. git clone https://github.com/neg2led/cm4io-fan.git
    4. cd cm4io-fan
  3. Run install.sh, feel free to inspect it yourself first. It will archive the current HEAD to /usr/src with an appropriate version, and run DKMS.

Config options

The device tree overlay has a few options, here’s the equivalent of a /boot/overlays/README info section:

  1. Name: cm4io-fan
  2. Info: Raspberry Pi Compute Module 4 IO Board fan controller
  3. Load: dtoverlay=cm4io-fan,<param>[=<val>]
  4. Params: minrpm RPM target for the fan when the SoC is below
  5. mintemp (default 3500)
  6. maxrpm RPM target for the fan when the SoC is above
  7. maxtemp (default 5500)
  8. midtemp Temperature (in millicelcius) at which the fan
  9. begins to speed up (default 50000)
  10. midtemp_hyst Temperature delta (in millicelcius) below mintemp
  11. at which the fan will drop to minrpm (default 2000)
  12. maxtemp Temperature (in millicelcius) at which the fan
  13. will be held at maxrpm (default 70000)
  14. maxtemp_hyst Temperature delta (in millicelcius) below maxtemp
  15. at which the fan begins to slow down (default 2000)

many thanks to: