Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 1 | Kernel driver w83791d |
| 2 | ===================== |
| 3 | |
| 4 | Supported chips: |
| 5 | * Winbond W83791D |
| 6 | Prefix: 'w83791d' |
| 7 | Addresses scanned: I2C 0x2c - 0x2f |
Charles Spirakis | 125751cb | 2006-09-24 20:53:04 +0200 | [diff] [blame] | 8 | Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/W83791D_W83791Gb.pdf |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 9 | |
| 10 | Author: Charles Spirakis <bezaur@gmail.com> |
| 11 | |
| 12 | This driver was derived from the w83781d.c and w83792d.c source files. |
| 13 | |
| 14 | Credits: |
| 15 | w83781d.c: |
| 16 | Frodo Looijaard <frodol@dds.nl>, |
| 17 | Philip Edelbrock <phil@netroedge.com>, |
| 18 | and Mark Studebaker <mdsxyz123@yahoo.com> |
| 19 | w83792d.c: |
| 20 | Chunhao Huang <DZShen@Winbond.com.tw>, |
Jean Delvare | 7188cc6 | 2006-12-12 18:18:30 +0100 | [diff] [blame] | 21 | Rudolf Marek <r.marek@assembler.cz> |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 22 | |
Charles Spirakis | 125751cb | 2006-09-24 20:53:04 +0200 | [diff] [blame] | 23 | Additional contributors: |
| 24 | Sven Anders <anders@anduras.de> |
Marc Hulsman | ad02ad8 | 2008-08-06 22:41:04 +0200 | [diff] [blame] | 25 | Marc Hulsman <m.hulsman@tudelft.nl> |
Charles Spirakis | 125751cb | 2006-09-24 20:53:04 +0200 | [diff] [blame] | 26 | |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 27 | Module Parameters |
| 28 | ----------------- |
| 29 | |
| 30 | * init boolean |
| 31 | (default 0) |
| 32 | Use 'init=1' to have the driver do extra software initializations. |
| 33 | The default behavior is to do the minimum initialization possible |
| 34 | and depend on the BIOS to properly setup the chip. If you know you |
| 35 | have a w83791d and you're having problems, try init=1 before trying |
| 36 | reset=1. |
| 37 | |
| 38 | * reset boolean |
| 39 | (default 0) |
| 40 | Use 'reset=1' to reset the chip (via index 0x40, bit 7). The default |
| 41 | behavior is no chip reset to preserve BIOS settings. |
| 42 | |
| 43 | * force_subclients=bus,caddr,saddr,saddr |
| 44 | This is used to force the i2c addresses for subclients of |
| 45 | a certain chip. Example usage is `force_subclients=0,0x2f,0x4a,0x4b' |
| 46 | to force the subclients of chip 0x2f on bus 0 to i2c addresses |
| 47 | 0x4a and 0x4b. |
| 48 | |
| 49 | |
| 50 | Description |
| 51 | ----------- |
| 52 | |
Charles Spirakis | 125751cb | 2006-09-24 20:53:04 +0200 | [diff] [blame] | 53 | This driver implements support for the Winbond W83791D chip. The W83791G |
| 54 | chip appears to be the same as the W83791D but is lead free. |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 55 | |
| 56 | Detection of the chip can sometimes be foiled because it can be in an |
| 57 | internal state that allows no clean access (Bank with ID register is not |
| 58 | currently selected). If you know the address of the chip, use a 'force' |
| 59 | parameter; this will put it into a more well-behaved state first. |
| 60 | |
Marc Hulsman | 6495ce1 | 2008-10-17 17:51:17 +0200 | [diff] [blame^] | 61 | The driver implements three temperature sensors, ten voltage sensors, |
| 62 | five fan rotation speed sensors and manual PWM control of each fan. |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 63 | |
| 64 | Temperatures are measured in degrees Celsius and measurement resolution is 1 |
| 65 | degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when |
| 66 | the temperature gets higher than the Overtemperature Shutdown value; it stays |
| 67 | on until the temperature falls below the Hysteresis value. |
| 68 | |
Marc Hulsman | 6495ce1 | 2008-10-17 17:51:17 +0200 | [diff] [blame^] | 69 | Voltage sensors (also known as IN sensors) report their values in millivolts. |
| 70 | An alarm is triggered if the voltage has crossed a programmable minimum |
| 71 | or maximum limit. |
| 72 | |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 73 | Fan rotation speeds are reported in RPM (rotations per minute). An alarm is |
| 74 | triggered if the rotation speed has dropped below a programmable limit. Fan |
Marc Hulsman | ad02ad8 | 2008-08-06 22:41:04 +0200 | [diff] [blame] | 75 | readings can be divided by a programmable divider (1, 2, 4, 8, 16, |
| 76 | 32, 64 or 128 for all fans) to give the readings more range or accuracy. |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 77 | |
Marc Hulsman | 6495ce1 | 2008-10-17 17:51:17 +0200 | [diff] [blame^] | 78 | Each fan controlled is controlled by PWM. The PWM duty cycle can be read and |
| 79 | set for each fan separately. Valid values range from 0 (stop) to 255 (full). |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 80 | |
Charles Spirakis | 6438312 | 2007-09-04 13:31:56 -0700 | [diff] [blame] | 81 | The w83791d has a global bit used to enable beeping from the speaker when an |
| 82 | alarm is triggered as well as a bitmask to enable or disable the beep for |
| 83 | specific alarms. You need both the global beep enable bit and the |
| 84 | corresponding beep bit to be on for a triggered alarm to sound a beep. |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 85 | |
Marc Hulsman | 6495ce1 | 2008-10-17 17:51:17 +0200 | [diff] [blame^] | 86 | The sysfs interface to the global enable is via the sysfs beep_enable file. |
Charles Spirakis | 6438312 | 2007-09-04 13:31:56 -0700 | [diff] [blame] | 87 | This file is used for both legacy and new code. |
Charles Spirakis | 125751cb | 2006-09-24 20:53:04 +0200 | [diff] [blame] | 88 | |
Charles Spirakis | 6438312 | 2007-09-04 13:31:56 -0700 | [diff] [blame] | 89 | The sysfs interface to the beep bitmask has migrated from the original legacy |
| 90 | method of a single sysfs beep_mask file to a newer method using multiple |
| 91 | *_beep files as described in .../Documentation/hwmon/sysfs-interface. |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 92 | |
Charles Spirakis | 6438312 | 2007-09-04 13:31:56 -0700 | [diff] [blame] | 93 | A similar change has occured for the bitmap corresponding to the alarms. The |
| 94 | original legacy method used a single sysfs alarms file containing a bitmap |
| 95 | of triggered alarms. The newer method uses multiple sysfs *_alarm files |
| 96 | (again following the pattern described in sysfs-interface). |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 97 | |
Charles Spirakis | 6438312 | 2007-09-04 13:31:56 -0700 | [diff] [blame] | 98 | Since both methods read and write the underlying hardware, they can be used |
| 99 | interchangeably and changes in one will automatically be reflected by |
| 100 | the other. If you use the legacy bitmask method, your user-space code is |
| 101 | responsible for handling the fact that the alarms and beep_mask bitmaps |
| 102 | are not the same (see the table below). |
| 103 | |
| 104 | NOTE: All new code should be written to use the newer sysfs-interface |
| 105 | specification as that avoids bitmap problems and is the preferred interface |
| 106 | going forward. |
| 107 | |
| 108 | The driver reads the hardware chip values at most once every three seconds. |
| 109 | User mode code requesting values more often will receive cached values. |
| 110 | |
| 111 | Alarms bitmap vs. beep_mask bitmask |
| 112 | ------------------------------------ |
| 113 | For legacy code using the alarms and beep_mask files: |
| 114 | |
| 115 | in0 (VCORE) : alarms: 0x000001 beep_mask: 0x000001 |
| 116 | in1 (VINR0) : alarms: 0x000002 beep_mask: 0x002000 <== mismatch |
| 117 | in2 (+3.3VIN): alarms: 0x000004 beep_mask: 0x000004 |
| 118 | in3 (5VDD) : alarms: 0x000008 beep_mask: 0x000008 |
| 119 | in4 (+12VIN) : alarms: 0x000100 beep_mask: 0x000100 |
| 120 | in5 (-12VIN) : alarms: 0x000200 beep_mask: 0x000200 |
| 121 | in6 (-5VIN) : alarms: 0x000400 beep_mask: 0x000400 |
| 122 | in7 (VSB) : alarms: 0x080000 beep_mask: 0x010000 <== mismatch |
| 123 | in8 (VBAT) : alarms: 0x100000 beep_mask: 0x020000 <== mismatch |
| 124 | in9 (VINR1) : alarms: 0x004000 beep_mask: 0x004000 |
| 125 | temp1 : alarms: 0x000010 beep_mask: 0x000010 |
| 126 | temp2 : alarms: 0x000020 beep_mask: 0x000020 |
| 127 | temp3 : alarms: 0x002000 beep_mask: 0x000002 <== mismatch |
| 128 | fan1 : alarms: 0x000040 beep_mask: 0x000040 |
| 129 | fan2 : alarms: 0x000080 beep_mask: 0x000080 |
| 130 | fan3 : alarms: 0x000800 beep_mask: 0x000800 |
| 131 | fan4 : alarms: 0x200000 beep_mask: 0x200000 |
| 132 | fan5 : alarms: 0x400000 beep_mask: 0x400000 |
| 133 | tart1 : alarms: 0x010000 beep_mask: 0x040000 <== mismatch |
| 134 | tart2 : alarms: 0x020000 beep_mask: 0x080000 <== mismatch |
| 135 | tart3 : alarms: 0x040000 beep_mask: 0x100000 <== mismatch |
| 136 | case_open : alarms: 0x001000 beep_mask: 0x001000 |
| 137 | global_enable: alarms: -------- beep_mask: 0x800000 (modified via beep_enable) |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 138 | |
| 139 | W83791D TODO: |
| 140 | --------------- |
Charles Spirakis | 9873964 | 2006-04-25 14:21:03 +0200 | [diff] [blame] | 141 | Provide a patch for smart-fan control (still need appropriate motherboard/fans) |