Kernel driver w83791d

Supported chips:

Author: Charles Spirakis <bezaur@gmail.com>

This driver was derived from the w83781d.c and w83792d.c source files.

Credits:

w83781d.c:

w83792d.c:

Additional contributors:

Module Parameters

  • init boolean

    (default 0)

    Use ‘init=1’ to have the driver do extra software initializations.The default behavior is to do the minimum initialization possibleand depend on the BIOS to properly setup the chip. If you know youhave a w83791d and you’re having problems, try init=1 before tryingreset=1.

  • reset boolean

    (default 0)

    Use ‘reset=1’ to reset the chip (via index 0x40, bit 7). The defaultbehavior is no chip reset to preserve BIOS settings.

  • force_subclients=bus,caddr,saddr,saddr

    This is used to force the i2c addresses for subclients ofa certain chip. Example usage isforce_subclients=0,0x2f,0x4a,0x4bto force the subclients of chip 0x2f on bus 0 to i2c addresses0x4a and 0x4b.

Description

This driver implements support for the Winbond W83791D chip. The W83791Gchip appears to be the same as the W83791D but is lead free.

Detection of the chip can sometimes be foiled because it can be in aninternal state that allows no clean access (Bank with ID register is notcurrently selected). If you know the address of the chip, use a ‘force’parameter; this will put it into a more well-behaved state first.

The driver implements three temperature sensors, ten voltage sensors,five fan rotation speed sensors and manual PWM control of each fan.

Temperatures are measured in degrees Celsius and measurement resolution is 1degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered whenthe temperature gets higher than the Overtemperature Shutdown value; it stayson until the temperature falls below the Hysteresis value.

Voltage sensors (also known as IN sensors) report their values in millivolts.An alarm is triggered if the voltage has crossed a programmable minimumor maximum limit.

Fan rotation speeds are reported in RPM (rotations per minute). An alarm istriggered if the rotation speed has dropped below a programmable limit. Fanreadings can be divided by a programmable divider (1, 2, 4, 8, 16,32, 64 or 128 for all fans) to give the readings more range or accuracy.

Each fan controlled is controlled by PWM. The PWM duty cycle can be read andset for each fan separately. Valid values range from 0 (stop) to 255 (full).PWM 1-3 support Thermal Cruise mode, in which the PWMs are automaticallyregulated to keep respectively temp 1-3 at a certain target temperature.See below for the description of the sysfs-interface.

The w83791d has a global bit used to enable beeping from the speaker when analarm is triggered as well as a bitmask to enable or disable the beep forspecific alarms. You need both the global beep enable bit and thecorresponding beep bit to be on for a triggered alarm to sound a beep.

The sysfs interface to the global enable is via the sysfs beep_enable file.This file is used for both legacy and new code.

The sysfs interface to the beep bitmask has migrated from the original legacymethod of a single sysfs beep_mask file to a newer method using multiple*_beep files as described inDocumentation/hwmon/sysfs-interface.rst.

A similar change has occurred for the bitmap corresponding to the alarms. Theoriginal legacy method used a single sysfs alarms file containing a bitmapof triggered alarms. The newer method uses multiple sysfs*_alarm files(again following the pattern described in sysfs-interface).

Since both methods read and write the underlying hardware, they can be usedinterchangeably and changes in one will automatically be reflected bythe other. If you use the legacy bitmask method, your user-space code isresponsible for handling the fact that the alarms and beep_mask bitmapsare not the same (see the table below).

NOTE: All new code should be written to use the newer sysfs-interfacespecification as that avoids bitmap problems and is the preferred interfacegoing forward.

The driver reads the hardware chip values at most once every three seconds.User mode code requesting values more often will receive cached values.

/sys files

The sysfs-interface is documented in the ‘sysfs-interface’ file. Onlychip-specific options are documented here.

pwm[1-3]_enable

this file controls mode of fan/temperature control forfan 1-3. Fan/PWM 4-5 only support manual mode.

  • 1 Manual mode
  • 2 Thermal Cruise mode
  • 3 Fan Speed Cruise mode (no further support)
temp[1-3]_targetdefines the target temperature for Thermal Cruise mode.Unit: millidegree CelsiusRW
temp[1-3]_tolerancetemperature tolerance for Thermal Cruise mode.Specifies an interval around the target temperaturein which the fan speed is not changed.Unit: millidegree CelsiusRW

Alarms bitmap vs. beep_mask bitmask

For legacy code using the alarms and beep_mask files:

SignalAlarmsbeep_maskObs
in0 (VCORE)0x0000010x000001 
in1 (VINR0)0x0000020x002000<== mismatch
in2 (+3.3VIN)0x0000040x000004 
in3 (5VDD)0x0000080x000008 
in4 (+12VIN)0x0001000x000100 
in5 (-12VIN)0x0002000x000200 
in6 (-5VIN)0x0004000x000400 
in7 (VSB)0x0800000x010000<== mismatch
in8 (VBAT)0x1000000x020000<== mismatch
in9 (VINR1)0x0040000x004000 
temp10x0000100x000010 
temp20x0000200x000020 
temp30x0020000x000002<== mismatch
fan10x0000400x000040 
fan20x0000800x000080 
fan30x0008000x000800 
fan40x2000000x200000 
fan50x4000000x400000 
tart10x0100000x040000<== mismatch
tart20x0200000x080000<== mismatch
tart30x0400000x100000<== mismatch
case_open0x0010000x001000 
global_enable
0x800000(modified via beep_enable)