Home | History | Annotate | Download | only in i2c
History log of /src/sys/dev/i2c/emcfan.c
RevisionDateAuthorComments
 1.2  08-Jul-2025  gutteridge branches: 1.2.4;
emcfan.c: minor spelling and grammar tweaks in comments
 1.1  11-Mar-2025  brad A driver and userland utility for a couple of families of the
Microchip Technology / SMSC fan controller chips.

The driver and utility supports the:

o EMC2101 and EMC2101-R
o EMC2103-1, EMC2102-2 and EMC2103-4
o EMC2104
o EMC2106
o EMC2301
o EMC2302
o EMC2303
o EMC2305

The EMC210X family supports 1 or 2 fans with tachometer. Depending on
the chip, it may support 2 additional fans without tach and might
support a high side attachment (i.e. a fan, usually 5v, driven
directly from the chip and not PWM or DAC). All versions of EMC210X
support internal temperature measurements, and depending on the chip,
may support up to 5 additional temperature zones. The tachometers and
temperature measurements are provided to the system via the envsys(4)
framework. Some chip types support GPIO pins and support is provided
via the gpio(4) framework.

The EMC230X family supports 1, 2, 3 or 5 fans with the same number of
tachometers. No temperature zone or GPIO support. The tachometers
are provided to the system via the envsys(4) framework. The fan
support can be provided by PWM signaling or DAC.

The two chip families mostly do PWM signaling for the fan speed, but a
number of them support DAC output, a 0 to 3v or so voltage. When the
chip supports external temperature zones, this is done usually by a
bipolar NPN or PNP transister configured as a diode, but some of the
chip varients support thermistors.

The emcfan(4) kernel driver provides a simple read / write / seek
device in /dev/ to the register set in the chip. The heavy lifting is
done in the userland utility emcfanctl(8) which provides the ability
to read and write to any valid register and provides some basic higher
level commands to control fan behavior. The output is simple text
lines, or JSON.

The kernel driver does not reset or other mess with the chip, aside
from reading registers. It is entirely possible that something else
in any particular system is the major manager of the fan controller
and it would not do for the kernel driver to mess too much with the
attached device. All interactions are intentional via the userland
utility.

It is known that a EMC2301 is present on the Raspberry PI 4 Compute IO
module (not to be confused with the Raspberry PI 4 Compute module
itself) and there is a breakout board from Adafruit with a EMC2101 on
it. The chips themselves are pretty inexpensive from Mouser or
Digi-key and can be soldered using the simpler SMD soldering
techniques. A number of the variants are QFN packages, but the pads
are exposed to the side of the chip. No other external components are
required to use these fan controllers.
 1.2.4.2  02-Aug-2025  perseant Sync with HEAD
 1.2.4.1  08-Jul-2025  perseant file emcfan.c was added on branch perseant-exfatfs on 2025-08-02 05:56:39 +0000

RSS XML Feed