Changeset 667

Show
Ignore:
Timestamp:
12/08/99 21:37:09 (9 years ago)
Author:
frodo
Message:

Changes regarding the new i2c_check_addr function

Changes in sensors.c:

sensors_detect now skips addresses which are already taken. Even a
force parameter can not override this, as it could lead to major
problems.
For ISA addresses, the same is done; but the client drivers still need
a check if they claim more than one ISA address (as all of the current
ISA clients do).

Changes in chip drivers:

Removed the comment about needing address registration

Changes in i2cdetect.c:

Marks addresses which are already claimed

Changes in sensors-detect:

Warns when an address is already claimed, and skips it.

Files:

Legend:

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

    r639 r667  
    2626* Better general locking, or at least a once-over to check no race-conditions 
    2727  remain. This is part of the SMP-safeness, and can better be done at once. 
    28 * Test SIS5595(/91/98) sensor support. Write generic i2c support.  
     28* Test SIS5595(/91/98) sensor support and SMBus support 
    2929  Thomas Dickel <Thomas.Dickel@mni.fh-giessen.de> owns one SIS5595. 
    3030* adm9240: check whether the current voltage computations are correct. 
  • lm-sensors/trunk/kernel/chips/adm1021.c

    r645 r667  
    214214    goto ERROR0; 
    215215 
    216   /* We need address registration for the I2C bus too. That is not yet 
    217      implemented. */ 
    218  
    219216  /* OK. For now, we presume we have a valid client. We now create the 
    220217     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/adm9240.c

    r645 r667  
    368368    goto ERROR0; 
    369369 
    370   /* We need address registration for the I2C bus too. That is not yet 
    371      implemented. */ 
    372  
    373370  /* OK. For now, we presume we have a valid client. We now create the 
    374371     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/bt869.c

    r645 r667  
    186186    goto ERROR0; 
    187187 
    188   /* Here, we have to do the address registration check for the I2C bus. 
    189      But that is not yet implemented. */ 
    190  
    191188  /* OK. For now, we presume we have a valid client. We now create the 
    192189     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/eeprom.c

    r645 r667  
    180180                                        I2C_FUNC_SMBUS_WRITE_WORD_DATA)) 
    181181    goto ERROR0; 
    182  
    183   /* Here, we have to do the address registration check for the I2C bus. 
    184      But that is not yet implemented. */ 
    185182 
    186183  /* OK. For now, we presume we have a valid client. We now create the 
  • lm-sensors/trunk/kernel/chips/gl518sm.c

    r666 r667  
    318318    goto ERROR0; 
    319319 
    320   /* We need address registration for the I2C bus too. That is not yet 
    321      implemented. */ 
    322  
    323320  /* OK. For now, we presume we have a valid client. We now create the 
    324321     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/gl520sm.c

    r645 r667  
    313313    goto ERROR0; 
    314314 
    315   /* We need address registration for the I2C bus too. That is not yet 
    316      implemented. */ 
    317  
    318315  /* OK. For now, we presume we have a valid client. We now create the 
    319316     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/lm75.c

    r645 r667  
    159159                                        I2C_FUNC_SMBUS_WORD_DATA)) 
    160160    goto ERROR0; 
    161  
    162   /* Here, we have to do the address registration check for the I2C bus. 
    163      But that is not yet implemented. */ 
    164161 
    165162  /* OK. For now, we presume we have a valid client. We now create the 
  • lm-sensors/trunk/kernel/chips/lm78.c

    r645 r667  
    320320    goto ERROR0; 
    321321 
    322   /* We need address registration for the I2C bus too. That is not yet 
    323      implemented. */ 
    324322  if (is_isa) { 
    325323    if (check_region(address,LM78_EXTENT)) 
  • lm-sensors/trunk/kernel/chips/lm80.c

    r646 r667  
    311311    goto ERROR0; 
    312312 
    313   /* Here, we have to do the address registration check for the I2C bus. 
    314      But that is not yet implemented. */ 
    315  
    316313  /* OK. For now, we presume we have a valid client. We now create the 
    317314     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/ltc1710.c

    r645 r667  
    173173    goto ERROR0; 
    174174 
    175   /* Here, we have to do the address registration check for the I2C bus. 
    176      But that is not yet implemented. */ 
    177  
    178175  /* OK. For now, we presume we have a valid client. We now create the 
    179176     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/matorb.c

    r645 r667  
    147147 
    148148 
    149   /* Here, we have to do the address registration check for the I2C bus. 
    150      But that is not yet implemented. */ 
    151  
    152149  /* OK. For now, we presume we have a valid client. We now create the 
    153150     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/thmc50.c

    r645 r667  
    205205    goto ERROR0; 
    206206 
    207   /* Here, we have to do the address registration check for the I2C bus. 
    208      But that is not yet implemented. */ 
    209  
    210207  /* OK. For now, we presume we have a valid client. We now create the 
    211208     client structure, even though we cannot fill it completely yet. 
  • lm-sensors/trunk/kernel/chips/w83781d.c

    r663 r667  
    654654    goto ERROR0; 
    655655 
    656   /* We need address registration for the I2C bus too. That is not yet 
    657      implemented. */ 
    658656  if (is_isa) { 
    659657    if (check_region(address,W83781D_EXTENT)) 
  • lm-sensors/trunk/kernel/sensors.c

    r645 r667  
    2626#include <linux/sysctl.h> 
    2727#include <linux/proc_fs.h> 
     28#include <linux/ioport.h> 
    2829 
    2930#include "version.h" 
     
    614615       addr <= (is_isa?0xffff:0x7f);  
    615616       addr ++) { 
     617    if ((is_isa && check_region(addr,1)) ||  
     618        (!is_isa && i2c_check_addr(adapter,addr))) 
     619      continue; 
    616620 
    617621    /* If it is in one of the force entries, we don't do any detection 
  • lm-sensors/trunk/prog/detect/i2cdetect.c

    r648 r667  
    8888    for(j = 0; j < 16; j++) { 
    8989      if (ioctl(file,I2C_SLAVE,i+j) < 0) { 
    90         fprintf(stderr,"Error: Could not set address to %d: %s\n",i+j, 
    91                 strerror(errno)); 
    92         exit(1); 
     90        if (errno == EBUSY) { 
     91          printf("UU "); 
     92          continue; 
     93        } else { 
     94          fprintf(stderr,"Error: Could not set address to %02x: %s\n",i+j, 
     95                  strerror(errno)); 
     96          exit(1); 
     97        } 
    9398      } 
    9499 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r665 r667  
    10831083    } 
    10841084 
    1085     i2c_set_slave_addr(\*FILE,$addr) or print("Can't set address to $_?!?\n"),  
    1086                                     next; 
     1085    i2c_set_slave_addr(\*FILE,$addr) or  
     1086        printf("Client at address 0x%02x can not be probed - unload all client drivers first!\n",$addr), next; 
    10871087 
    10881088    next unless i2c_smbus_write_quick(\*FILE,$SMBUS_WRITE) >= 0;