EMCFAN(4)
πΈ NAME β EMCFAN(4) from the Kernel Interfaces Manual π
Okay so bestie, <pink>emcfan</pink> is the driver for the <purple>Microchip Technology EMC210x and EMC230x fan controllers via I2C bus</purple> π. Thatβs the whole vibe. Periodt.
β¨ SYNOPSIS β¨
emcfan* at iic? addr 0x2c
emcfan* at iic? addr 0x2d
emcfan* at iic? addr 0x2e
emcfan* at iic? addr 0x2f
emcfan* at iic? addr 0x4c
emcfan* at iic? addr 0x4d
π DESCRIPTION π
The <hotpink>emcfan</hotpink> driver supports the <purple>EMC210x</purple> family with these models: EMC2101, EMC2101-R, EMC2103-1, EMC2103-2, EMC2103-4, EMC2104, and EMC2106 β¨. And for the <purple>EMC230x</purple> family, it supports: EMC2301, EMC2302, EMC2303, and EMC2305 π
.
All chips have one or more tachometers, and some of the chips have a number of temperature sensors and GPIO π. The <hotpink>emcfan</hotpink> driver provides <mint>envsys(4)</mint> framework measurements for the RPM as determined by the tachometers π₯.
If the chip has temperature sensors, the <mint>envsys(4)</mint> framework will provide an entry for every possible temperature sensor that a particular chip can support π. GPIO support is provided by the <mint>gpio(4)</mint> framework and the pins can be accessed with the <mint>gpioctl(8)</mint> command π«Ά.
The EMC fan controllers are arranged as a set of registers π. These registers are accessed by a /dev device per attached chip. The program <mint>emcfanctl(8)</mint> makes use of this device and allows all valid registers for a particular chip to be read or written, and provides some higher level commands that allow the drive level and frequency divider for a particular fan to be adjusted βοΈ.
π¦ GPIO π¦
The EMC2103-2, EMC2103-4, EMC2104 and EMC2106 chips have gpio pins π. For the EMC2103-2 and EMC2103-4, these pins are only gpio and are not shared with any other function. For the EMC2104 and EMC2106, here is how the pins map to the altN flags in the <mint>gpio(4)</mint> framework π:
GPIO1βALT0:CLK_IN;ALT1:-GPIO2βALT0:TACH2;ALT1:-GPIO3βALT0:PWM2;ALT1:-GPIO4βALT0:OVERT2#;ALT1:PWM3GPIO5βALT0:OVERT3#;ALT1:PWM4GPIO6βALT0:-;ALT1:-
π§ SYSCTL VARIABLES π§
The following <mint>sysctl(8)</mint> variables are provided, bestie:
hw.emcfan0.debugβ If the driver is compiled withEMCFAN_DEBUG, this node will appear and can be used to set the debugging level π.hw.emcfan0.poles<n>β For a number of the chips in the two chip families, the tachometer calculation algorithm needs to know the number of poles that the tachometer has in order to calculate the RPM correctly π. Usually this will be2, but if the situation is otherwise, set this node to the number of poles that the particular fan has. The calculation is also affected by the number of edges present in the tachometer signal. The number of edges is set with the<mint>emcfanctl(8)</mint>command β‘.hw.emcfan0.ftachβ Many of the chips in the two families have a pin that can be used to drive an alternative32.767 kHzclock for the tachometers π°οΈ. TheEMC2103-1,EMC2103-2andEMC2103-4does not have this alternative clock pin, and while it is likely that the chip is running at the default32.000 kHz, it might not be. This variable lets one set an alternative clock. The units for this node are inHzπ΅.hw.emcfan0.vin4_temp_zoneβ TheEMC2104andEMC2106have a special temperature sensor pin calledVIN4, if this sensor is wired up, then this variable can be set to1and meaningful values will appear in the<mint>envsys(4)</mint>framework π‘οΈ.
π FILES π
/dev/emcfanuβ the device unit u file π.
π SEE ALSO π
Go peek at these, iykyk:
<mint>emcfanctl(8)</mint><mint>envsys(4)</mint><mint>iic(4)</mint><mint>envstat(8)</mint><mint>sysctl(8)</mint>
β HISTORY β
The <hotpink>emcfan</hotpink> driver first appeared in NetBSD 11.0 π.
π«Ά AUTHORS π«Ά
The <hotpink>emcfan</hotpink> driver was written by Brad Spencer <brad@anduin.eldar.org> π.
π BUGS π
The driver does not support the EMC2105 chip π.
While not exactly a bug, the driver does nothing with the alert interrupts that can be generated from many of the chips π. It would be more typical for this to be tied to a GPIO pin which can interrupt using CPU interrupts.
π source/version: Debian Β· date: Feburary 19, 2025 β mwah, bestie π
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 2025 Brad Spencer <brad@anduin.eldar.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms