Changeset 540
- Timestamp:
- 08/28/99 21:10:27 (14 years ago)
- Files:
-
- 1 modified
-
lm-sensors/trunk/prog/detect/sensors-detect (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/prog/detect/sensors-detect
r533 r540 124 124 lm80_detect w83781d_detect w83781d_alias_detect 125 125 w83781d_isa_detect gl518sm_detect gl520sm_detect adm9240_detect 126 adm1021_detect sis5595_isa_detect eeprom_detect ltc1710_detect); 126 adm1021_detect sis5595_isa_detect eeprom_detect 127 adm1022_detect ltc1710_detect); 127 128 128 129 # This is a list of all recognized chips. … … 132 133 # written yet. 133 134 # i2c_addrs (optional): For I2C chips, the range of valid I2C addresses to 134 # probe. 135 # probe. Recommend avoiding 0x69 because of clock chips. 135 136 # i2c_driver_addrs (optional): For I2C chips, the range of valid I2C 136 137 # addresses probed by the kernel driver. Strictly optional. … … 153 154 name => "National Semiconductor LM78", 154 155 driver => "lm78", 155 i2c_addrs => [0x00..0x 7f],156 i2c_addrs => [0x00..0x68,0x6a..0x7f], 156 157 i2c_driver_addrs => [0x20..0x2f], 157 158 i2c_detect => sub { lm78_detect 0, @_}, … … 163 164 name => "National Semiconductor LM78-J", 164 165 driver => "lm78", 165 i2c_addrs => [0x00..0x 7f],166 i2c_addrs => [0x00..0x68,0x6a..0x7f], 166 167 i2c_driver_addrs => [0x20..0x2f], 167 168 i2c_detect => sub { lm78_detect 1, @_ }, … … 173 174 name => "National Semiconductor LM79", 174 175 driver => "lm78", 175 i2c_addrs => [0x00..0x 7f],176 i2c_addrs => [0x00..0x68,0x6a..0x7f], 176 177 i2c_driver_addrs => [0x20..0x2f], 177 178 i2c_detect => sub { lm78_detect 2, @_ }, … … 195 196 name => "Winbond W83781D", 196 197 driver => "w83781d", 197 i2c_addrs => [0x00..0x 7f],198 i2c_addrs => [0x00..0x68,0x6a..0x7f], 198 199 i2c_detect => sub { w83781d_detect 0, @_}, 199 200 i2c_driver_addrs => [0x20..0x2f], … … 205 206 name => "Winbond W83782D", 206 207 driver => "w83781d", 207 i2c_addrs => [0x00..0x 7f],208 i2c_addrs => [0x00..0x68,0x6a..0x7f], 208 209 i2c_driver_addrs => [0x20..0x2f], 209 210 i2c_detect => sub { w83781d_detect 1, @_}, … … 215 216 name => "Winbond W83783S", 216 217 driver => "w83781d", 217 i2c_addrs => [0x00..0x 7f],218 i2c_addrs => [0x00..0x68,0x6a..0x7f], 218 219 i2c_driver_addrs => [0x20..0x2f], 219 220 i2c_detect => sub { w83781d_detect 2, @_}, … … 222 223 name => "Winbond W83627HF", 223 224 driver => "w83781d", 224 i2c_addrs => [0x00..0x 7f],225 i2c_addrs => [0x00..0x68,0x6a..0x7f], 225 226 i2c_driver_addrs => [0x20..0x2f], 226 227 i2c_detect => sub { w83781d_detect 3, @_}, … … 288 289 i2c_addrs => [0x18..0x1a,0x29..0x2b,0x4c..0x4e], 289 290 i2c_detect => sub { adm1021_detect 3, @_ }, 291 }, 292 { 293 name => "Analog Devices ADM1022", 294 # driver to be written 295 i2c_addrs => [0x2c..0x2f], 296 i2c_detect => sub { adm1022_detect 0, @_ }, 297 }, 298 { 299 name => "Texas Instruments THMC50", 300 # driver to be written 301 i2c_addrs => [0x2c..0x2f], 302 i2c_detect => sub { adm1022_detect 1, @_ }, 290 303 }, 291 304 { … … 1188 1201 # Registers used: 1189 1202 # 0x01: Configuration 1190 # 0x02: Hyster is1203 # 0x02: Hysteresis 1191 1204 # 0x03: Overtemperature Shutdown 1192 1205 # Detection really sucks! It is only based on the fact that the LM75 has only … … 1363 1376 # We may assume an i2c_set_slave_addr was already done. 1364 1377 # $_[2]: Address 1365 # Returns: undef if not detected, ( 8) if detected.1378 # Returns: undef if not detected, (7) if detected. 1366 1379 # Registers used: 1367 1380 # 0x3e: Company ID … … 1379 1392 return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; 1380 1393 return unless i2c_smbus_read_byte_data($file,0x48) == $addr; 1394 1395 return (7); 1396 } 1397 1398 # $_[0]: Chip to detect (0 = ADM1022, 1 = THMC50) 1399 # $_[1]: A reference to the file descriptor to access this chip. 1400 # We may assume an i2c_set_slave_addr was already done. 1401 # $_[2]: Address 1402 # Returns: undef if not detected, (8) if detected. 1403 # Registers used: 1404 # 0x3e: Company ID 1405 # 0x3f: Revision 1406 # 0x40: Configuration 1407 # Note: Detection overrules a previous LM78 or ADM9240 detection 1408 sub adm1022_detect 1409 { 1410 my $reg; 1411 my ($chip, $file,$addr) = @_; 1412 $reg = i2c_smbus_read_byte_data($file,0x3e); 1413 return unless ($chip == 0 and $reg == 0x41) or 1414 ($chip == 1 and $reg == 0x49); 1415 return unless (i2c_smbus_read_byte_data($file,0x40) & 0x80) == 0x00; 1416 return unless (i2c_smbus_read_byte_data($file,0x3f) & 0xc0) == 0xc0; 1381 1417 1382 1418 return (8);
