Back to home page

OSCL-LXR

 
 

    


0001 Kernel driver w83791d
0002 =====================
0003 
0004 Supported chips:
0005 
0006   * Winbond W83791D
0007 
0008     Prefix: 'w83791d'
0009 
0010     Addresses scanned: I2C 0x2c - 0x2f
0011 
0012     Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83791D_W83791Gb.pdf
0013 
0014 Author: Charles Spirakis <bezaur@gmail.com>
0015 
0016 This driver was derived from the w83781d.c and w83792d.c source files.
0017 
0018 Credits:
0019 
0020   w83781d.c:
0021 
0022     - Frodo Looijaard <frodol@dds.nl>,
0023     - Philip Edelbrock <phil@netroedge.com>,
0024     - Mark Studebaker <mdsxyz123@yahoo.com>
0025 
0026   w83792d.c:
0027 
0028     - Shane Huang (Winbond),
0029     - Rudolf Marek <r.marek@assembler.cz>
0030 
0031 Additional contributors:
0032 
0033     - Sven Anders <anders@anduras.de>
0034     - Marc Hulsman <m.hulsman@tudelft.nl>
0035 
0036 Module Parameters
0037 -----------------
0038 
0039 * init boolean
0040     (default 0)
0041 
0042     Use 'init=1' to have the driver do extra software initializations.
0043     The default behavior is to do the minimum initialization possible
0044     and depend on the BIOS to properly setup the chip. If you know you
0045     have a w83791d and you're having problems, try init=1 before trying
0046     reset=1.
0047 
0048 * reset boolean
0049     (default 0)
0050 
0051     Use 'reset=1' to reset the chip (via index 0x40, bit 7). The default
0052     behavior is no chip reset to preserve BIOS settings.
0053 
0054 * force_subclients=bus,caddr,saddr,saddr
0055     This is used to force the i2c addresses for subclients of
0056     a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b`
0057     to force the subclients of chip 0x2f on bus 0 to i2c addresses
0058     0x4a and 0x4b.
0059 
0060 
0061 Description
0062 -----------
0063 
0064 This driver implements support for the Winbond W83791D chip. The W83791G
0065 chip appears to be the same as the W83791D but is lead free.
0066 
0067 Detection of the chip can sometimes be foiled because it can be in an
0068 internal state that allows no clean access (Bank with ID register is not
0069 currently selected). If you know the address of the chip, use a 'force'
0070 parameter; this will put it into a more well-behaved state first.
0071 
0072 The driver implements three temperature sensors, ten voltage sensors,
0073 five fan rotation speed sensors and manual PWM control of each fan.
0074 
0075 Temperatures are measured in degrees Celsius and measurement resolution is 1
0076 degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when
0077 the temperature gets higher than the Overtemperature Shutdown value; it stays
0078 on until the temperature falls below the Hysteresis value.
0079 
0080 Voltage sensors (also known as IN sensors) report their values in millivolts.
0081 An alarm is triggered if the voltage has crossed a programmable minimum
0082 or maximum limit.
0083 
0084 Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
0085 triggered if the rotation speed has dropped below a programmable limit. Fan
0086 readings can be divided by a programmable divider (1, 2, 4, 8, 16,
0087 32, 64 or 128 for all fans) to give the readings more range or accuracy.
0088 
0089 Each fan controlled is controlled by PWM. The PWM duty cycle can be read and
0090 set for each fan separately. Valid values range from 0 (stop) to 255 (full).
0091 PWM 1-3 support Thermal Cruise mode, in which the PWMs are automatically
0092 regulated to keep respectively temp 1-3 at a certain target temperature.
0093 See below for the description of the sysfs-interface.
0094 
0095 The w83791d has a global bit used to enable beeping from the speaker when an
0096 alarm is triggered as well as a bitmask to enable or disable the beep for
0097 specific alarms. You need both the global beep enable bit and the
0098 corresponding beep bit to be on for a triggered alarm to sound a beep.
0099 
0100 The sysfs interface to the global enable is via the sysfs beep_enable file.
0101 This file is used for both legacy and new code.
0102 
0103 The sysfs interface to the beep bitmask has migrated from the original legacy
0104 method of a single sysfs beep_mask file to a newer method using multiple
0105 `*_beep` files as described in `Documentation/hwmon/sysfs-interface.rst`.
0106 
0107 A similar change has occurred for the bitmap corresponding to the alarms. The
0108 original legacy method used a single sysfs alarms file containing a bitmap
0109 of triggered alarms. The newer method uses multiple sysfs `*_alarm` files
0110 (again following the pattern described in sysfs-interface).
0111 
0112 Since both methods read and write the underlying hardware, they can be used
0113 interchangeably and changes in one will automatically be reflected by
0114 the other. If you use the legacy bitmask method, your user-space code is
0115 responsible for handling the fact that the alarms and beep_mask bitmaps
0116 are not the same (see the table below).
0117 
0118 NOTE: All new code should be written to use the newer sysfs-interface
0119 specification as that avoids bitmap problems and is the preferred interface
0120 going forward.
0121 
0122 The driver reads the hardware chip values at most once every three seconds.
0123 User mode code requesting values more often will receive cached values.
0124 
0125 /sys files
0126 ----------
0127 The sysfs-interface is documented in the 'sysfs-interface' file. Only
0128 chip-specific options are documented here.
0129 
0130 ======================= =======================================================
0131 pwm[1-3]_enable         this file controls mode of fan/temperature control for
0132                         fan 1-3. Fan/PWM 4-5 only support manual mode.
0133 
0134                             * 1 Manual mode
0135                             * 2 Thermal Cruise mode
0136                             * 3 Fan Speed Cruise mode (no further support)
0137 
0138 temp[1-3]_target        defines the target temperature for Thermal Cruise mode.
0139                         Unit: millidegree Celsius
0140                         RW
0141 
0142 temp[1-3]_tolerance     temperature tolerance for Thermal Cruise mode.
0143                         Specifies an interval around the target temperature
0144                         in which the fan speed is not changed.
0145                         Unit: millidegree Celsius
0146                         RW
0147 ======================= =======================================================
0148 
0149 Alarms bitmap vs. beep_mask bitmask
0150 -----------------------------------
0151 
0152 For legacy code using the alarms and beep_mask files:
0153 
0154 =============  ========  ========= ==========================
0155 Signal         Alarms    beep_mask Obs
0156 =============  ========  ========= ==========================
0157 in0 (VCORE)    0x000001  0x000001
0158 in1 (VINR0)    0x000002  0x002000  <== mismatch
0159 in2 (+3.3VIN)  0x000004  0x000004
0160 in3 (5VDD)     0x000008  0x000008
0161 in4 (+12VIN)   0x000100  0x000100
0162 in5 (-12VIN)   0x000200  0x000200
0163 in6 (-5VIN)    0x000400  0x000400
0164 in7 (VSB)      0x080000  0x010000  <== mismatch
0165 in8 (VBAT)     0x100000  0x020000  <== mismatch
0166 in9 (VINR1)    0x004000  0x004000
0167 temp1          0x000010  0x000010
0168 temp2          0x000020  0x000020
0169 temp3          0x002000  0x000002  <== mismatch
0170 fan1           0x000040  0x000040
0171 fan2           0x000080  0x000080
0172 fan3           0x000800  0x000800
0173 fan4           0x200000  0x200000
0174 fan5           0x400000  0x400000
0175 tart1          0x010000  0x040000  <== mismatch
0176 tart2          0x020000  0x080000  <== mismatch
0177 tart3          0x040000  0x100000  <== mismatch
0178 case_open      0x001000  0x001000
0179 global_enable  -         0x800000  (modified via beep_enable)
0180 =============  ========  ========= ==========================