Changeset 1490

Show
Ignore:
Timestamp:
08/10/02 20:29:40 (6 years ago)
Author:
mds
Message:

enable if not enabled (remove force parameter), check for

uninitialized base address; remove compilation warning

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r1489 r1490  
    2121  Library: Fix fan3_div writes for w8378* and it87 
    2222  Module dmi_scan: new 
     23  Module i2c-i801: Check for uninitialized base address; 
     24                   enable if not enabled 
    2325  Module i2c-piix4: Refuse to load on IBM systems 
    2426  Module lm92: Fix in-kernel initialization 
  • lm-sensors/trunk/doc/busses/i2c-i801

    r1460 r1490  
    2020----------------- 
    2121 
    22 * force: int 
    23   Forcibly enable the ICH. DANGEROUS! 
    2422* force_addr: int 
    2523  Forcibly enable the ICH at the given address. EXTREMELY DANGEROUS! 
  • lm-sensors/trunk/kernel/busses/i2c-i801.c

    r1459 r1490  
    119119 
    120120/* insmod parameters */ 
    121  
    122 /* If force is set to anything different from 0, we forcibly enable the 
    123    I801. DANGEROUS! */ 
    124 static int force = 0; 
    125 MODULE_PARM(force, "i"); 
    126 MODULE_PARM_DESC(force, "Forcibly enable the I801. DANGEROUS!"); 
    127121 
    128122/* If force_addr is set to anything different from 0, we forcibly enable 
     
    226220        if (force_addr) { 
    227221                i801_smba = force_addr & 0xfff0; 
    228                 force = 0; 
    229222        } else { 
    230223                pci_read_config_word(I801_dev, SMBBA, &i801_smba); 
    231224                i801_smba &= 0xfff0; 
     225                if(i801_smba == 0) { 
     226                        printk(KERN_ERR "i2c-i801.o: SMB base address uninitialized - upgrade BIOS or use force_addr=0xaddr\n"); 
     227                        return -ENODEV; 
     228                } 
    232229        } 
    233230 
     
    244241        pci_write_config_byte(I801_dev, SMBHSTCFG, temp); 
    245242/* If force_addr is set, we program the new address here. Just to make 
    246    sure, we disable the I801 first. */ 
     243   sure, we disable the device first. */ 
    247244        if (force_addr) { 
    248245                pci_write_config_byte(I801_dev, SMBHSTCFG, temp & 0xfe); 
     
    253250                     "address %04x!\n", i801_smba); 
    254251        } else if ((temp & 1) == 0) { 
    255                 if (force) { 
    256 /* NOTE: This assumes I/O space and other allocations WERE 
    257    done by the Bios!  Don't complain if your hardware does weird  
    258    things after enabling this. :') Check for Bios updates before 
    259    resorting to this.  */ 
    260                         pci_write_config_byte(I801_dev, SMBHSTCFG, 
    261                                               temp | 1); 
    262                         printk 
    263                             (KERN_WARNING "i2c-i801.o: WARNING: I801 SMBus interface has been FORCEFULLY " 
    264                              "ENABLED!\n"); 
    265                 } else { 
    266                         printk 
    267                             (KERN_ERR "SMBUS: Error: Host SMBus controller not enabled!\n"); 
    268                         error_return = -ENODEV; 
    269                         goto END; 
    270                 } 
     252                pci_write_config_byte(I801_dev, SMBHSTCFG, temp | 1); 
     253                printk(KERN_WARNING "i2c-i801.o: enabling SMBus device\n"); 
    271254        } 
    272255 
     
    591574        int hwpec = 0; 
    592575        int block = 0; 
    593         int ret, xact
     576        int ret, xact = 0
    594577 
    595578#ifdef HAVE_PEC