Changeset 1076
- Timestamp:
- 04/21/01 22:54:47 (12 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 3 modified
-
CHANGES (modified) (1 diff)
-
doc/chips/sis5595 (modified) (2 diffs)
-
kernel/chips/sis5595.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r1073 r1076 42 42 Save BIOS pin configuration of temps and fans 43 43 Module sensors: Disabled, moved to i2c package as i2c-proc.c 44 Module sis5595: Fix temp, add in4 for chip revision 0xc0. 44 Module sis5595: Fix temp, add in4 for chip revision 0xc0; 45 Allow force_addr=0xaddr 45 46 Module via686a: Allow force_addr=0xaddr (for A7V/K7V boards) 46 47 Module w83781d: Don't reinitialize as99127f chip; this may cause fan/temp -
lm-sensors/trunk/doc/chips/sis5595
r1070 r1076 20 20 Module Parameters 21 21 ----------------- 22 None 22 force_addr=0xaddr Set the I/O base address. Useful for boards 23 that don't set the address in the BIOS. Does not do a 24 PCI force; the device must still be present in lspci. 25 Don't use this unless the driver complains that the 26 base address is not set. 27 Example: 'modprobe sis5595 force_addr=0x290' 23 28 24 29 … … 81 86 will do no harm, but will return 'old' values. 82 87 88 Problems 89 -------- 90 Some chips refuse to be enabled. We don't know why. 91 The driver will recognize this and print a message in dmesg. 83 92 84 93 Chip Features -
lm-sensors/trunk/kernel/chips/sis5595.c
r1070 r1076 54 54 #endif 55 55 56 /* If force_addr is set to anything different from 0, we forcibly enable 57 the device at the given address. */ 58 static int force_addr = 0; 59 MODULE_PARM(force_addr, "i"); 60 MODULE_PARM_DESC(force_addr, 61 "Initialize the base address of the sensors"); 62 56 63 /* Addresses to scan. 57 64 Note that we can't determine the ISA address until we have initialized … … 129 136 #define FAN_FROM_REG(val,div) ((val)==0?-1:(val)==255?0:1350000/((val)*(div))) 130 137 131 #define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?(((val)-5)/10):\ 132 ((val)+5)/10),0,255)) 133 #define TEMP_FROM_REG(val) (((val)>0x80?(val)-0x100:(val))*10) 138 /* Version 1 datasheet temp=.83*reg + 52.12 */ 139 #define TEMP_FROM_REG(val) (((((val)>=0x80?(val)-0x100:(val))*83)+5212)/10) 140 /* inverse 1.20*val - 62.77 */ 141 #define TEMP_TO_REG(val) (SENSORS_LIMIT(((val)<0?\ 142 ((((val)*12)-6327)/100):\ 143 ((((val)*12)-6227)/100)),0,255)) 134 144 135 145 #define ALARMS_FROM_REG(val) (val) … … 302 312 { 303 313 u16 val; 304 char c;305 314 306 315 if (!pci_present()) … … 317 326 return -ENODEV; 318 327 319 *address = (val & 0xfff8);320 if (*address== 0) {321 printk("sis5595.o: Sensor base address uninitialized - upgrade BIOS?\n");328 *address = val & ~(SIS5595_EXTENT - 1); 329 if (*address == 0 && force_addr == 0) { 330 printk("sis5595.o: base address not set - upgrade BIOS or use force_addr=0xaddr\n"); 322 331 return -ENODEV; 323 332 } 324 325 if (PCIBIOS_SUCCESSFUL != 326 pci_read_config_byte(s_bridge, SIS5595_ENABLE_REG, &c)) 327 return -ENODEV; 328 if((c & 0x80) == 0) { 329 printk("sis5595.o: Sensors not enabled - upgrade BIOS?\n"); 330 return -ENODEV; 331 } 333 if (force_addr) 334 *address = force_addr; /* so detect will get called */ 335 332 336 return 0; 333 337 } … … 343 347 const char *client_name = "SIS5595 chip"; 344 348 char val; 349 u16 a; 345 350 346 351 /* Make sure we are probing the ISA bus!! */ … … 351 356 } 352 357 358 if(force_addr) 359 address = force_addr & ~(SIS5595_EXTENT - 1); 353 360 if (check_region(address, SIS5595_EXTENT)) { 354 361 printk("sis5595.o: region 0x%x already in use!\n", address); 355 362 return -ENODEV; 363 } 364 if(force_addr) { 365 printk("sis5595.o: forcing ISA address 0x%04X\n", address); 366 if (PCIBIOS_SUCCESSFUL != 367 pci_write_config_word(s_bridge, SIS5595_BASE_REG, address)) 368 return -ENODEV; 369 if (PCIBIOS_SUCCESSFUL != 370 pci_read_config_word(s_bridge, SIS5595_BASE_REG, &a)) 371 return -ENODEV; 372 if ((a & ~(SIS5595_EXTENT - 1)) != address) { 373 /* doesn't work for some chips? */ 374 printk("sis5595.o: force address failed\n"); 375 return -ENODEV; 376 } 377 } 378 379 if (PCIBIOS_SUCCESSFUL != 380 pci_read_config_byte(s_bridge, SIS5595_ENABLE_REG, &val)) 381 return -ENODEV; 382 if((val & 0x80) == 0) { 383 printk("sis5595.o: enabling sensors\n"); 384 if (PCIBIOS_SUCCESSFUL != 385 pci_write_config_byte(s_bridge, SIS5595_ENABLE_REG, 386 val | 0x80)) 387 return -ENODEV; 388 if (PCIBIOS_SUCCESSFUL != 389 pci_read_config_byte(s_bridge, SIS5595_ENABLE_REG, &val)) 390 return -ENODEV; 391 if((val & 0x80) == 0) { /* doesn't work for some chips! */ 392 printk("sis5595.o: sensors enable failed - not supported?\n"); 393 return -ENODEV; 394 } 356 395 } 357 396
