Module Name: src Committed By: brad Date: Tue Mar 11 13:56:49 UTC 2025
Modified Files: src/distrib/sets/lists/base: mi src/distrib/sets/lists/comp: mi src/distrib/sets/lists/debug: mi module.mi src/distrib/sets/lists/man: mi src/distrib/sets/lists/manhtml: mi src/distrib/sets/lists/modules: mi src/etc: MAKEDEV.tmpl src/share/man/man4: Makefile src/sys/conf: majors src/sys/dev/i2c: Makefile files.i2c src/sys/modules: Makefile src/usr.sbin: Makefile Added Files: src/share/man/man4: emcfan.4 src/sys/dev/i2c: emcfan.c emcfaninfo.h emcfanreg.h emcfanvar.h src/sys/modules/emcfan: Makefile emcfan.ioconf src/usr.sbin/emcfanctl: Makefile emcfanctl.8 emcfanctl.c emcfanctl.h emcfanctlconst.h emcfanctloutputs.c emcfanctloutputs.h emcfanctlutil.c emcfanctlutil.h Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.1362 -r1.1363 src/distrib/sets/lists/base/mi cvs rdiff -u -r1.2488 -r1.2489 src/distrib/sets/lists/comp/mi cvs rdiff -u -r1.467 -r1.468 src/distrib/sets/lists/debug/mi cvs rdiff -u -r1.31 -r1.32 src/distrib/sets/lists/debug/module.mi cvs rdiff -u -r1.1799 -r1.1800 src/distrib/sets/lists/man/mi cvs rdiff -u -r1.21 -r1.22 src/distrib/sets/lists/manhtml/mi cvs rdiff -u -r1.163 -r1.164 src/distrib/sets/lists/modules/mi cvs rdiff -u -r1.235 -r1.236 src/etc/MAKEDEV.tmpl cvs rdiff -u -r1.741 -r1.742 src/share/man/man4/Makefile cvs rdiff -u -r0 -r1.1 src/share/man/man4/emcfan.4 cvs rdiff -u -r1.104 -r1.105 src/sys/conf/majors cvs rdiff -u -r1.3 -r1.4 src/sys/dev/i2c/Makefile cvs rdiff -u -r0 -r1.1 src/sys/dev/i2c/emcfan.c src/sys/dev/i2c/emcfaninfo.h \ src/sys/dev/i2c/emcfanreg.h src/sys/dev/i2c/emcfanvar.h cvs rdiff -u -r1.131 -r1.132 src/sys/dev/i2c/files.i2c cvs rdiff -u -r1.295 -r1.296 src/sys/modules/Makefile cvs rdiff -u -r0 -r1.1 src/sys/modules/emcfan/Makefile \ src/sys/modules/emcfan/emcfan.ioconf cvs rdiff -u -r1.293 -r1.294 src/usr.sbin/Makefile cvs rdiff -u -r0 -r1.1 src/usr.sbin/emcfanctl/Makefile \ src/usr.sbin/emcfanctl/emcfanctl.8 src/usr.sbin/emcfanctl/emcfanctl.c \ src/usr.sbin/emcfanctl/emcfanctl.h \ src/usr.sbin/emcfanctl/emcfanctlconst.h \ src/usr.sbin/emcfanctl/emcfanctloutputs.c \ src/usr.sbin/emcfanctl/emcfanctloutputs.h \ src/usr.sbin/emcfanctl/emcfanctlutil.c \ src/usr.sbin/emcfanctl/emcfanctlutil.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.