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.
sudo apt install dkms
/usr/src/cm4io-fan-<version>
and run the dkms install:
tar -xzvf 0.2.0.tar.gz -C /usr/src/
sudo dkms install cm4io-fan/0.2.0
# Enable I2C bus 1 on VideoCore (/dev/i2c-10 in Raspberry Pi OS)
dtparam=i2c_vc=on
# Enable CM4 IO Board fan controller
dtoverlay=cm4io-fan,minrpm=1000,maxrpm=5000
/etc/modules
(or make a new file called /etc/modules-load.d/cm4io-fan.conf
), adding this line:
emc2301
sudo apt install dkms
mkdir -p ~/src
cd ~/src
git clone https://github.com/neg2led/cm4io-fan.git
cd cm4io-fan
The device tree overlay has a few options, here's the equivalent of a /boot/overlays/README
info section:
Name: cm4io-fan
Info: Raspberry Pi Compute Module 4 IO Board fan controller
Load: dtoverlay=cm4io-fan,<param>[=<val>]
Params: minrpm RPM target for the fan when the SoC is below
mintemp (default 3500)
maxrpm RPM target for the fan when the SoC is above
maxtemp (default 5500)
midtemp Temperature (in millicelcius) at which the fan
begins to speed up (default 50000)
midtemp_hyst Temperature delta (in millicelcius) below mintemp
at which the fan will drop to minrpm (default 2000)
maxtemp Temperature (in millicelcius) at which the fan
will be held at maxrpm (default 70000)
maxtemp_hyst Temperature delta (in millicelcius) below maxtemp
at which the fan begins to slow down (default 2000)