Mini 311 Fan Control Registers

Posted by matt

The 311 fan can be controlled by accessing registers in the ACPI embedded controller. My documentation of these registers follows.

Offset
 (decimal)

Width (bits)SymbolFunction
888RTMPRead temperature. The current CPU temperature is provided by this register, measured in degrees celcuis.
1728(FLEV)The current fan level (0-7) can be read from this register. Note that this doesn't have a symbol in the DSDT, but I have called it FLEV in my kernel module.
178, 17916RPM1,RPM2The current fan speed can be determined from this value, but it is not simply a 16-bit integer representing RPM. It is a reciprocal of RPM, with some time constant - i.e. it represents a number of clock ticks per revolution. Assuming a 1MHz clock results in reasonable looking values. Also note that when the fan is stationary, this register is zero (as opposed to infinity).
2448SFAN

Set fan. This register controls fan operation, but how it does this requires some explanation.

SFAN Register

By default this register is zero and the fan speed is controlled automatically by the system hardware.

Fan speed can be set manually by programming bits 6:1 of this register. The fan has 8 speed levels, or rather 7 in which it is spinning. Level 0 is dependent on the BIOS setting 'Fan Always On' - if enabled, level 0 is the same as level 1, otherwise level 0 turns the fan off.

The fan can always be disabled completely by setting bit 0 of this register. This will then override anything in bits 6:1, and the fan will be stationary.

Setting speed via bits 6:1 is not entirely straightforward, due to some built-in hysteresis. Writing value X will not always give the same speed Y. You need to consider what the current state is to determine what X to write. My kernel module abstracts this for you. The following tables give the threshold values to switch the fan level up or down.

Speed Up Transitions
Target LevelSFAN value
148
252
362
466
576
680
784
Speed Down Transitions
Target LevelSFAN Value
678
574
472
362
256
146
042
See this page if you are looking for a Linux driver to control your fan.
Tags: