Changeset 648

Show
Ignore:
Timestamp:
12/01/99 16:47:11 (13 years ago)
Author:
frodo
Message:

i2c-detect now checks whether SMBus quick write is in the

functionality matrix.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/prog/detect/i2cdetect.c

    r500 r648  
    3737  int i,j,res,i2cbus,file; 
    3838  char filename[20]; 
     39  long funcs; 
    3940   
    4041 
     
    6061    fprintf(stderr,"Error: Could not open file `%s': %s\n",filename, 
    6162            strerror(errno)); 
     63    exit(1); 
     64  } 
     65 
     66  if (ioctl(file,I2C_FUNCS,&funcs) < 0) { 
     67    fprintf(stderr, 
     68            "Error: Could not get the adapter functionality maxtrix: %s\n", 
     69            strerror(errno)); 
     70    exit(1); 
     71  } 
     72  if (! (funcs & I2C_FUNC_SMBUS_QUICK)) { 
     73    fprintf(stderr, 
     74            "Error: Can't use SMBus Quick Write command " 
     75            "on this bus (ISA bus?)\n"); 
    6276    exit(1); 
    6377  }