GithubHelp home page GithubHelp logo

neggles / cm4io-fan Goto Github PK

View Code? Open in Web Editor NEW
77.0 8.0 14.0 57 KB

CM4 IO board PWM fan controller driver

License: GNU General Public License v2.0

Makefile 8.44% C 76.73% Shell 14.83%
raspberry-pi compute-module-4 cm4io emc2301 fan hwmon

cm4io-fan's Introduction

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:
sudo apt install dkms
  1. Download the latest source .tar.gz from the releases page
  2. Untar it to /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
  1. 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.
# 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
  1. 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:
emc2301

Install from git

  1. Install dkms if you haven't already:
sudo apt install dkms
  1. Clone the repo
mkdir -p ~/src
cd ~/src
git clone https://github.com/neg2led/cm4io-fan.git
cd cm4io-fan
  1. 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:

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)

many thanks to:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.