| 1 | Kernel driver `lm90.o' |
|---|
| 2 | ====================== |
|---|
| 3 | |
|---|
| 4 | Status: Complete and well tested |
|---|
| 5 | |
|---|
| 6 | Supported chips: |
|---|
| 7 | * National Semiconductor LM90 |
|---|
| 8 | Prefix: 'lm90' |
|---|
| 9 | Addresses scanned: I2C 0x4c |
|---|
| 10 | Datasheet: Publicly available at the National Semiconductor website |
|---|
| 11 | http://www.national.com/pf/LM/LM90.html |
|---|
| 12 | * National Semiconductor LM89 |
|---|
| 13 | Prefix: 'lm99' |
|---|
| 14 | Addresses scanned: I2C 0x4c and 0x4d |
|---|
| 15 | Datasheet: Publicly available at the National Semiconductor website |
|---|
| 16 | http://www.national.com/pf/LM/LM89.html |
|---|
| 17 | * National Semiconductor LM99 |
|---|
| 18 | Prefix: 'lm99' |
|---|
| 19 | Addresses scanned: I2C 0x4c and 0x4d |
|---|
| 20 | Datasheet: Publicly available at the National Semiconductor website |
|---|
| 21 | http://www.national.com/pf/LM/LM99.html |
|---|
| 22 | * National Semiconductor LM86 |
|---|
| 23 | Prefix: 'lm86' |
|---|
| 24 | Addresses scanned: I2C 0x4c |
|---|
| 25 | Datasheet: Publicly available at the National Semiconductor website |
|---|
| 26 | http://www.national.com/pf/LM/LM86.html |
|---|
| 27 | * Analog Devices ADM1032 |
|---|
| 28 | Prefix: 'adm1032' |
|---|
| 29 | Addresses scanned: I2C 0x4c and 0x4d |
|---|
| 30 | Datasheet: Publicly available at the Analog Devices website |
|---|
| 31 | http://products.analog.com/products/info.asp?product=ADM1032 |
|---|
| 32 | * Analog Devices ADT7461 |
|---|
| 33 | Prefix: 'adt7461' |
|---|
| 34 | Addresses scanned: I2C 0x4c and 0x4d |
|---|
| 35 | Datasheet: Publicly available at the Analog Devices website |
|---|
| 36 | http://products.analog.com/products/info.asp?product=ADT7461 |
|---|
| 37 | Note: Only if in ADM1032 compatibility mode |
|---|
| 38 | * Maxim MAX6657 |
|---|
| 39 | Prefix: 'max6657' |
|---|
| 40 | Addresses scanned: I2C 0x4c |
|---|
| 41 | Datasheet: Publicly available at the Maxim website |
|---|
| 42 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 |
|---|
| 43 | * Maxim MAX6658 |
|---|
| 44 | Prefix: 'max6657' |
|---|
| 45 | Addresses scanned: I2C 0x4c |
|---|
| 46 | Datasheet: Publicly available at the Maxim website |
|---|
| 47 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 |
|---|
| 48 | * Maxim MAX6659 |
|---|
| 49 | Prefix: 'max6657' |
|---|
| 50 | Addresses scanned: I2C 0x4c and 0x4d |
|---|
| 51 | Datasheet: Publicly available at the Maxim website |
|---|
| 52 | http://www.maxim-ic.com/quick_view2.cfm/qv_pk/2578 |
|---|
| 53 | |
|---|
| 54 | |
|---|
| 55 | Author: Jean Delvare <khali@linux-fr.org> |
|---|
| 56 | |
|---|
| 57 | License: GPL |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | Module Parameters |
|---|
| 61 | ----------------- |
|---|
| 62 | |
|---|
| 63 | * force: short array (min = 1, max = 48) |
|---|
| 64 | List of adapter,address pairs to boldly assume to be present |
|---|
| 65 | * force_lm90: short array (min = 1, max = 48) |
|---|
| 66 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 67 | a `lm90' chip |
|---|
| 68 | * force_adm1032: short array (min = 1, max = 48) |
|---|
| 69 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 70 | a `adm1032' chip |
|---|
| 71 | * force_lm99: short array (min = 1, max = 48) |
|---|
| 72 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 73 | a `lm99' chip |
|---|
| 74 | * force_lm86: short array (min = 1, max = 48) |
|---|
| 75 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 76 | a `lm86' chip |
|---|
| 77 | * force_max6657: short array (min = 1, max = 48) |
|---|
| 78 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 79 | a `max6657' chip |
|---|
| 80 | * force_adt7461: short array (min = 1, max = 48) |
|---|
| 81 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 82 | a `adt7461' chip |
|---|
| 83 | * probe: short array (min = 1, max = 48) |
|---|
| 84 | List of adapter,address pairs to scan additionally |
|---|
| 85 | * probe_range: short array (min = 1, max = 48) |
|---|
| 86 | List of adapter,start-addr,end-addr triples to scan additionally |
|---|
| 87 | * ignore: short array (min = 1, max = 48) |
|---|
| 88 | List of adapter,address pairs not to scan |
|---|
| 89 | * ignore_range: short array (min = 1, max = 48) |
|---|
| 90 | List of adapter,start-addr,end-addr triples not to scan |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | Description |
|---|
| 94 | ----------- |
|---|
| 95 | |
|---|
| 96 | The LM90 is a digital temperature sensor. It senses its own temperature as |
|---|
| 97 | well as the temperature of up to one external diode. It is compatible |
|---|
| 98 | with many other devices such as the LM86, the LM89, the LM99, the ADM1032, |
|---|
| 99 | the MAX6657, the MAX6658, and the MAX6659, all of which are supported by |
|---|
| 100 | this driver. Additionally, the ADT7461 is supported if found in ADM1032 |
|---|
| 101 | compatibility mode. |
|---|
| 102 | |
|---|
| 103 | The specificity of this family of chipsets over the ADM1021/LM84 |
|---|
| 104 | family is that it features critical limits with hysteresis, and an |
|---|
| 105 | increased resolution of the remote temperature measurement. |
|---|
| 106 | |
|---|
| 107 | The different chipsets of the family are not strictly identical, although |
|---|
| 108 | very similar. This driver doesn't handle any specific feature for now, |
|---|
| 109 | with the exception of SMBus PEC. For reference, here comes a non-exhaustive |
|---|
| 110 | list of specific features: |
|---|
| 111 | |
|---|
| 112 | LM90: |
|---|
| 113 | * Filter and alert configuration register at 0xBF. |
|---|
| 114 | * ALERT is triggered by temperatures over critical limits. |
|---|
| 115 | |
|---|
| 116 | LM86 and LM89: |
|---|
| 117 | * Same as LM90 |
|---|
| 118 | * Better external channel accuracy |
|---|
| 119 | |
|---|
| 120 | LM99: |
|---|
| 121 | * Same as LM89 |
|---|
| 122 | * External temperature shifted by 16 degrees down |
|---|
| 123 | |
|---|
| 124 | ADM1032: |
|---|
| 125 | * Consecutive alert register at 0x22. |
|---|
| 126 | * Conversion averaging. |
|---|
| 127 | * Up to 64 conversions/s. |
|---|
| 128 | * ALERT is triggered by open remote sensor. |
|---|
| 129 | * SMBus PEC support for Write Byte and Receive Byte transactions. |
|---|
| 130 | |
|---|
| 131 | ADT7461 |
|---|
| 132 | * Extended temperature range (breaks compatibility) |
|---|
| 133 | * Lower resolution for remote temperature |
|---|
| 134 | |
|---|
| 135 | MAX6657 and MAX6658: |
|---|
| 136 | * Remote sensor type selecion |
|---|
| 137 | |
|---|
| 138 | MAX6659 |
|---|
| 139 | * Selectable address |
|---|
| 140 | * Second critical temperature limit |
|---|
| 141 | |
|---|
| 142 | All temperature values are given in degrees Celsius. Resolution |
|---|
| 143 | is 1.0 degree for the local temperature, 0.125 degree for the remote |
|---|
| 144 | temperature. |
|---|
| 145 | |
|---|
| 146 | Each sensor has its own high and low limits, plus a critical limit. |
|---|
| 147 | Additionally, there is a relative hysteresis value common to both critical |
|---|
| 148 | values. To make life easier to user-space applications, two absolute values |
|---|
| 149 | are exported, one for each channel, but these values are of course linked. |
|---|
| 150 | Only the local hysteresis can be set from user-space, and the same delta |
|---|
| 151 | applies to the remote hysteresis. |
|---|
| 152 | |
|---|
| 153 | The lm90 driver will not update its values more frequently than every |
|---|
| 154 | other second; reading them more often will do no harm, but will return |
|---|
| 155 | 'old' values. |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | PEC Support |
|---|
| 159 | ----------- |
|---|
| 160 | |
|---|
| 161 | The ADM1032 is the only chip of the family which supports PEC. It does |
|---|
| 162 | not support PEC on all transactions though, so some care must be taken. |
|---|
| 163 | |
|---|
| 164 | When reading a register value, the PEC byte is computed and sent by the |
|---|
| 165 | ADM1032 chip. However, in the case of a combined transaction (SMBus Read |
|---|
| 166 | Byte), the ADM1032 computes the CRC value over only the second half of |
|---|
| 167 | the message rather than its entirety, because it thinks the first half |
|---|
| 168 | of the message belongs to a different transaction. As a result, the CRC |
|---|
| 169 | value differs from what the SMBus master expects, and all reads fail. |
|---|
| 170 | |
|---|
| 171 | For this reason, the lm90 driver will enable PEC for the ADM1032 only if |
|---|
| 172 | the bus supports the SMBus Send Byte and Receive Byte transaction types. |
|---|
| 173 | These transactions will be used to read register values, instead of |
|---|
| 174 | SMBus Read Byte, and PEC will work properly. |
|---|
| 175 | |
|---|
| 176 | Additionally, the ADM1032 doesn't support SMBus Send Byte with PEC. |
|---|
| 177 | Instead, it will try to write the PEC value to the register (because the |
|---|
| 178 | SMBus Send Byte transaction with PEC is similar to a Write Byte transaction |
|---|
| 179 | without PEC), which is not what we want. Thus, PEC is explicitely disabled |
|---|
| 180 | on SMBus Send Byte transactions in the lm90 driver. |
|---|
| 181 | |
|---|
| 182 | PEC on byte data transactions represents a significant increase in bandwidth |
|---|
| 183 | usage (+33% for writes, +25% for reads) in normal conditions. With the need |
|---|
| 184 | to use two SMBus transaction for reads, this overhead jumps to +50%. Worse, |
|---|
| 185 | two transactions will typically mean twice as much delay waiting for |
|---|
| 186 | transaction completion, effectively doubling the register cache refresh time. |
|---|
| 187 | I guess reliability comes at a price, but it's quite expensive this time. |
|---|
| 188 | |
|---|
| 189 | So, as not everyone might enjoy the slowdown, PEC can be disabled through |
|---|
| 190 | procfs. Just write 0 to the "pec" file and PEC will be disabled. Write 1 |
|---|
| 191 | to that file to enable PEC again. |
|---|
| 192 | |
|---|
| 193 | |
|---|
| 194 | Chip Features |
|---|
| 195 | ------------- |
|---|
| 196 | |
|---|
| 197 | Chips 'lm90', adm1032', 'lm99', 'lm86', 'max6657' and 'adt7461' |
|---|
| 198 | |
|---|
| 199 | LABEL LABEL CLASS COMPUTE CLASS MODE MAGN |
|---|
| 200 | temp1 - - R- 0 |
|---|
| 201 | temp1_high temp1 temp1 RW 0 |
|---|
| 202 | temp1_low temp1 temp1 RW 0 |
|---|
| 203 | temp2 - - R- 1 |
|---|
| 204 | temp2_high temp2 temp2 RW 1 |
|---|
| 205 | temp2_low temp2 temp2 RW 1 |
|---|
| 206 | tcrit1 temp1 temp1 RW 0 |
|---|
| 207 | tcrit2 temp2 temp2 RW 0 |
|---|
| 208 | hyst1 temp1 temp1 RW 0 |
|---|
| 209 | hyst2 temp2 temp2 R- 0 |
|---|
| 210 | alarms - - R- 0 |
|---|
| 211 | |
|---|
| 212 | LABEL FEATURE SYMBOL SYSCTL FILE:N |
|---|
| 213 | temp1 SENSORS_LM90_LOCAL_TEMP temp1:3 |
|---|
| 214 | temp1_high SENSORS_LM90_LOCAL_HIGH temp1:1 |
|---|
| 215 | temp1_low SENSORS_LM90_LOCAL_LOW temp1:2 |
|---|
| 216 | temp2 SENSORS_LM90_REMOTE_TEMP temp2:3 |
|---|
| 217 | temp2_high SENSORS_LM90_REMOTE_HIGH temp2:1 |
|---|
| 218 | temp2_low SENSORS_LM90_REMOTE_LOW temp2:2 |
|---|
| 219 | tcrit1 SENSORS_LM90_LOCAL_TCRIT tcrit1:1 |
|---|
| 220 | tcrit2 SENSORS_LM90_REMOTE_TCRIT tcrit2:1 |
|---|
| 221 | hyst1 SENSORS_LM90_LOCAL_TCRIT_HYST hyst1:1 |
|---|
| 222 | hyst2 SENSORS_LM90_REMOTE_TCRIT_HYST hyst2:1 |
|---|
| 223 | alarms SENSORS_LM90_ALARMS alarms:1 |
|---|